Skip to content

feat(wework): add expandable workspace panel - #2224

Merged
qdaxb merged 16 commits into
mainfrom
feature/expand-workspace-panel
Jul 29, 2026
Merged

qdaxb merged 16 commits into
mainfrom
feature/expand-workspace-panel

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add an expand/restore control to the Wework right workspace
  • keep the conversation composer available while the workspace fills the main content area
  • allow the left sidebar to collapse independently for a right-workspace-only layout
  • preserve the expanded state per conversation and reset it when the workspace closes
  • document the interaction in Chinese and English

Verification

  • pnpm --filter wework lint
  • pnpm --filter wework typecheck
  • pnpm --filter wework test (220 files, 2184 tests)
  • focused layout and workspace action tests
  • Prettier, typography guard, and lifecycle guard
  • real Tauri interaction review for default split, expanded, expanded with sidebar hidden, and restored split states
  • pre-push Wework ESLint, TypeScript, and unit-test checks

Screenshot coverage

The desktop E2E flow now captures:

  1. workspace-panel-01-default-split.png
  2. workspace-panel-02-expanded.png
  3. workspace-panel-03-expanded-sidebar-hidden.png
  4. workspace-panel-04-restored-split.png

Summary by CodeRabbit

  • New Features
    • Added an expanded right-workspace mode so files/previews/audits use the main area while preserving access to the composer.
    • Added restore controls to return to the side-by-side layout; expanded state is remembered across conversation switches and exits when the right workspace is closed.
    • In expanded chat, the composer view is simplified and includes a “latest turn” restore action.
  • Documentation
    • Documented expand/restore behavior in English and Chinese.
  • Tests
    • Expanded desktop E2E and layout tests to verify sizing, composer visibility, URL retention, and multi-step restore behavior.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The desktop workbench adds persisted right-workspace expansion, maximize/restore controls, updated chat and panel layout behavior, desktop automation commands, focused tests, E2E coverage, localized labels, workbar styling, and user documentation.

Changes

Right workspace expansion

Layer / File(s) Summary
Persisted expansion state and layout
wework/src/components/layout/DesktopWorkbenchMain.tsx
Persists rightPanelExpanded, updates panel sizing and visibility, resets expansion during panel and session transitions, and wires expansion into panel rendering.
Expansion controls and labels
wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx, wework/src/components/layout/workspace-panels/WorkspacePanelActions.test.tsx, wework/src/i18n/locales/*/common.json
Adds maximize/restore controls, accessibility state, localized labels, and component coverage.
Expanded chat rendering and layout validation
wework/src/components/chat/ScrollableMessageArea.tsx, wework/src/components/layout/workspace-panels/*, wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
Supports expanded chat restoration and conditional message content, with tests for sizing, composers, backgrounds, resize handles, sidebar behavior, and restoration.
Desktop automation and E2E coverage
wework/src/e2e/automation.ts, wework/e2e/desktop/task-flow.e2e.mjs
Adds desktop-control commands and validates URL retention, expanded layouts, composer isolation, and sidebar sizing.
Workbar layout and user documentation
wework/src/components/chat/composer/*, wework/src/components/common/BranchSelector.tsx, docs/*/wework/workbench.md
Adjusts desktop workbar widths and menu alignment, adds branch titles and assertions, and documents expansion and restoration behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant WorkspacePanelActions
  participant DesktopWorkbenchMain
  participant RightWorkspacePanel
  participant TemporaryChatPanel
  User->>WorkspacePanelActions: Click expand panel
  WorkspacePanelActions->>DesktopWorkbenchMain: Toggle rightPanelExpanded
  DesktopWorkbenchMain->>RightWorkspacePanel: Render expanded workspace
  RightWorkspacePanel->>TemporaryChatPanel: Pass expanded state
  TemporaryChatPanel-->>User: Show expanded composer and restore control
  User->>TemporaryChatPanel: Click restore conversation
  TemporaryChatPanel->>DesktopWorkbenchMain: Collapse rightPanelExpanded
  DesktopWorkbenchMain-->>User: Restore split layout
Loading

Possibly related PRs

🚥 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 clearly summarizes the main change: adding an expandable workspace panel.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/expand-workspace-panel

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 25, 2026 21:10
@qdaxb

qdaxb commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
wework/e2e/desktop/task-flow.e2e.mjs (1)

7549-7633: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consider covering the "Latest turn" restore path too.

This block only exercises restore-conversation-from-expanded-workspace-button ("Restore panel"). docs/en/wework/workbench.md (and the zh equivalent) also document restoring via Latest turn above the composer while the panel is expanded, but that path isn't exercised anywhere in this new coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 7549 - 7633, Extend the
workspace-panel flow around expandedWorkspaceSnapshot to cover restoring through
the “Latest turn” control above the composer, not only
restore-conversation-from-expanded-workspace-button. While the right workspace
panel is expanded, activate Latest turn, wait for right-workspace-resize-handle
to return, finish animations, and verify the panel is restored to split mode
alongside the existing restore-panel coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@wework/e2e/desktop/task-flow.e2e.mjs`:
- Around line 7549-7633: Extend the workspace-panel flow around
expandedWorkspaceSnapshot to cover restoring through the “Latest turn” control
above the composer, not only
restore-conversation-from-expanded-workspace-button. While the right workspace
panel is expanded, activate Latest turn, wait for right-workspace-resize-handle
to return, finish animations, and verify the panel is restored to split mode
alongside the existing restore-panel coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 420b0f96-eb18-4d94-b71f-5fd5f3bf1ff7

📥 Commits

Reviewing files that changed from the base of the PR and between 59da892 and 02e73a7.

📒 Files selected for processing (11)
  • docs/en/wework/workbench.md
  • docs/zh/wework/workbench.md
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/components/chat/ScrollableMessageArea.tsx
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/workspace-panels/WorkspacePanelActions.test.tsx
  • wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx
  • wework/src/e2e/automation.ts
  • wework/src/i18n/locales/en/common.json
  • wework/src/i18n/locales/zh-CN/common.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
wework/e2e/desktop/task-flow.e2e.mjs (1)

7538-7545: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Wait for a submit-specific browser state.

fill already makes the controlled input equal retainedBrowserUrl, so waitForControlValue can pass before submit commits navigation. Wait for a navigation-specific observable instead; otherwise this does not protect the conversation-switch race it describes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 7538 - 7545, Replace the
waitForControlValue check after control.command('submit',
activeBrowserInputSelector) with a submit-specific navigation observable that
confirms the built-in browser committed retainedBrowserUrl before switching
conversations. Keep the existing error context and bottom-panel toggle flow, but
ensure the wait cannot pass solely because the input was already filled.
wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx (1)

231-244: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Defensively reset sending on optimistic-open rollback.

setSending(true) is set at the top of send, but the new !targetAddress rollback branch only calls setAddress(null); it relies on handleError (invoked inside createTemporaryRuntimeTask) to also call setSending(false). If the callee ever resolves falsy without calling onError, the composer would be stuck in a "sending" state.

🛡️ Suggested defensive fix
       if (!targetAddress) {
         setAddress(null)
+        setSending(false)
         return
       }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx` around
lines 231 - 244, Update the !targetAddress rollback branch in send to also reset
sending to false before returning, independently of handleError. Preserve the
existing setAddress(null) cleanup and return behavior.
wework/src/components/layout/DesktopWorkbenchLayout.test.tsx (1)

1-4723: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Test file far exceeds the 1000-line split threshold.

This spec file is now well over 4700 lines and this PR keeps appending new test cases to it (e.g., the two expand/restore tests and the two optimistic-open tests). As per coding guidelines, "Favor cohesive modules, explicit interfaces, and standard practices; split files over 1000 lines and delete dead code." Consider splitting by concern (e.g., layout/resize tests, right-workspace expansion tests, temporary-chat runtime tests) into separate spec files sharing the createWorkbenchMocks/renderWorkspacePanelLayout helpers via an extracted test-utils module.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/DesktopWorkbenchLayout.test.tsx` around lines 1
- 4723, The DesktopWorkbenchLayout test suite exceeds the 1000-line file limit
and should be split by concern. Extract shared setup helpers such as
createWorkbenchMocks and renderWorkspacePanelLayout into a test-utils module,
then move layout/resize, right-workspace expansion, and temporary-chat runtime
tests into focused spec files while preserving their existing behavior and
imports.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@wework/e2e/desktop/task-flow.e2e.mjs`:
- Around line 7538-7545: Replace the waitForControlValue check after
control.command('submit', activeBrowserInputSelector) with a submit-specific
navigation observable that confirms the built-in browser committed
retainedBrowserUrl before switching conversations. Keep the existing error
context and bottom-panel toggle flow, but ensure the wait cannot pass solely
because the input was already filled.

In `@wework/src/components/layout/DesktopWorkbenchLayout.test.tsx`:
- Around line 1-4723: The DesktopWorkbenchLayout test suite exceeds the
1000-line file limit and should be split by concern. Extract shared setup
helpers such as createWorkbenchMocks and renderWorkspacePanelLayout into a
test-utils module, then move layout/resize, right-workspace expansion, and
temporary-chat runtime tests into focused spec files while preserving their
existing behavior and imports.

In `@wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx`:
- Around line 231-244: Update the !targetAddress rollback branch in send to also
reset sending to false before returning, independently of handleError. Preserve
the existing setAddress(null) cleanup and return behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a08163d-b98c-49b4-9d7a-73dd8ec6cffa

📥 Commits

Reviewing files that changed from the base of the PR and between eb58010 and 9665557.

📒 Files selected for processing (5)
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/workspace-panels/RightWorkspacePanel.tsx
  • wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • wework/src/components/layout/DesktopWorkbenchMain.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wework/src/components/chat/composer/ProjectWorkBar.tsx`:
- Line 901: Update the nested current-project trigger using the
project-work-button styling in ProjectWorkBar so it also includes the full-width
class, matching its w-full wrapper. Preserve the existing current-project
rendering and styling while ensuring the ProjectWorkBar test assertion passes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 89185f55-8c63-4660-ad8b-e8c0f6e540c5

📥 Commits

Reviewing files that changed from the base of the PR and between 5622630 and aa9dfe1.

📒 Files selected for processing (12)
  • docs/en/wework/workbench.md
  • docs/zh/wework/workbench.md
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/components/chat/composer/ProjectWorkBar.test.tsx
  • wework/src/components/chat/composer/ProjectWorkBar.tsx
  • wework/src/components/chat/composer/WorktreeBranchSelector.tsx
  • wework/src/components/common/BranchSelector.tsx
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/workspace-panels/RightWorkspacePanel.tsx
  • wework/src/i18n/locales/en/common.json
  • wework/src/i18n/locales/zh-CN/common.json
🚧 Files skipped from review as they are similar to previous changes (7)
  • docs/zh/wework/workbench.md
  • wework/src/i18n/locales/zh-CN/common.json
  • wework/src/i18n/locales/en/common.json
  • wework/src/components/layout/workspace-panels/RightWorkspacePanel.tsx
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx

@qdaxb
qdaxb enabled auto-merge July 29, 2026 10:09
@qdaxb
qdaxb added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 447b8b6 Jul 29, 2026
35 checks passed
@qdaxb
qdaxb deleted the feature/expand-workspace-panel branch July 29, 2026 12:16
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