Skip to content

fix(wework): collapse file list and capture Tauri verification - #1926

Merged
qdaxb merged 3 commits into
mainfrom
fix/wework-collapse-file-list
Jul 13, 2026
Merged

qdaxb merged 3 commits into
mainfrom
fix/wework-collapse-file-list

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Collapse the workspace file list by default when a concrete file link opens the right panel.
  • Keep the file list expanded when users open the Files tab directly, and allow restoring it with the existing toggle.
  • Add ai:verify capture so isolated Tauri verification can save a PNG without macOS screen-recording permission.

Root cause

The file workspace panel always initialized its directory tree as visible. File-open requests selected the requested preview but did not distinguish that focused preview flow from browsing the Files tab directly.

User and developer impact

Opening a file from a conversation now prioritizes the preview area while preserving manual file-list navigation. Contributors can also retain visual evidence from the real isolated Tauri WebView.

Validation

  • pnpm --filter wework test — 154 files, 1535 tests passed.
  • pnpm --filter wework exec vitest run src/components/layout/DesktopWorkbenchLayout.test.tsx — 125 tests passed.
  • TypeScript, ESLint, Prettier, and git diff --check passed.
  • Pre-push Wework quality checks passed.
  • Isolated Tauri QA:
    • Direct Files-tab browsing kept the file list visible.
    • Clicking a real verify.txt conversation link opened the preview with the tree container at width zero.
    • The toggle exposed the accessible name 显示目录树, and the automated recovery path restored the 240px file list.
    • ai:verify capture produced a 1200×720 PNG from the Tauri WebView.

Summary by CodeRabbit

  • New Features

    • Added desktop verification support for capturing selected interface areas as PNG images.
    • Added a command-line capture option with configurable output paths and clear success feedback.
  • Bug Fixes

    • Opening a requested workspace file now automatically collapses the directory tree for a cleaner view.
  • Documentation

    • Updated verification guidance to include capturing a final visual result after assertions.
  • Tests

    • Added coverage for directory tree collapsed and expanded states, including accessibility labels.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 49cc5cb2-79d2-440b-b97d-c207ddef5b63

📥 Commits

Reviewing files that changed from the base of the PR and between e2a7232 and 5892835.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • wework/AGENTS.md
  • wework/package.json
  • wework/scripts/ai-verify.mjs
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/layout/workspace-panels/FileWorkspacePanel.tsx
  • wework/src/e2e/automation.ts

📝 Walkthrough

Walkthrough

Adds PNG screenshot capture to the desktop verification workflow and collapses the directory tree when opening a requested file, with corresponding documentation and test coverage.

Changes

Desktop verification capture

Layer / File(s) Summary
Screenshot capture rendering
wework/package.json, wework/src/e2e/automation.ts
Adds html2canvas and a capture desktop control action that renders a selected element as a PNG data URL.
Capture CLI output handling
wework/scripts/ai-verify.mjs, wework/AGENTS.md
Adds CLI dispatch, selector defaults, PNG validation, output-file writing, and documented capture usage.

Workspace directory tree behavior

Layer / File(s) Summary
Directory tree state on file opening
wework/src/components/layout/workspace-panels/FileWorkspacePanel.tsx, wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
Opening a requested file collapses the directory tree, with tests covering toggle state and accessible labels.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VerifyCLI
  participant DesktopAutomation
  participant html2canvas
  participant OutputFile
  VerifyCLI->>DesktopAutomation: execute capture action
  DesktopAutomation->>html2canvas: render selected element
  html2canvas-->>DesktopAutomation: return PNG data URL
  DesktopAutomation-->>VerifyCLI: return screenshot payload
  VerifyCLI->>OutputFile: write decoded PNG bytes
Loading

Possibly related PRs

  • wecode-ai/Wegent#1885: Updates related directory-tree assertions in the same workbench layout test suite.
  • wecode-ai/Wegent#1896: Introduces the verification session and desktop control protocol extended here with capture.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: collapsing the file list and adding Tauri verification capture support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-collapse-file-list

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qdaxb
qdaxb marked this pull request as ready for review July 13, 2026 11:14
@qdaxb
qdaxb merged commit 1a5e21c into main Jul 13, 2026
20 checks passed
@qdaxb
qdaxb deleted the fix/wework-collapse-file-list branch July 13, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant