Repository navigation
feat(wework): add expandable workspace panel - #2224
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe 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. ChangesRight workspace expansion
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
wework/e2e/desktop/task-flow.e2e.mjs (1)
7549-7633: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winConsider 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
📒 Files selected for processing (11)
docs/en/wework/workbench.mddocs/zh/wework/workbench.mdwework/e2e/desktop/task-flow.e2e.mjswework/src/components/chat/ScrollableMessageArea.tsxwework/src/components/layout/DesktopWorkbenchLayout.test.tsxwework/src/components/layout/DesktopWorkbenchMain.tsxwework/src/components/layout/workspace-panels/WorkspacePanelActions.test.tsxwework/src/components/layout/workspace-panels/WorkspacePanelActions.tsxwework/src/e2e/automation.tswework/src/i18n/locales/en/common.jsonwework/src/i18n/locales/zh-CN/common.json
There was a problem hiding this comment.
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 winWait for a submit-specific browser state.
fillalready makes the controlled input equalretainedBrowserUrl, sowaitForControlValuecan pass beforesubmitcommits 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 winDefensively reset
sendingon optimistic-open rollback.
setSending(true)is set at the top ofsend, but the new!targetAddressrollback branch only callssetAddress(null); it relies onhandleError(invoked insidecreateTemporaryRuntimeTask) to also callsetSending(false). If the callee ever resolves falsy without callingonError, 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 liftTest 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/renderWorkspacePanelLayouthelpers 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
📒 Files selected for processing (5)
wework/e2e/desktop/task-flow.e2e.mjswework/src/components/layout/DesktopWorkbenchLayout.test.tsxwework/src/components/layout/DesktopWorkbenchMain.tsxwework/src/components/layout/workspace-panels/RightWorkspacePanel.tsxwework/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
There was a problem hiding this comment.
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
📒 Files selected for processing (12)
docs/en/wework/workbench.mddocs/zh/wework/workbench.mdwework/e2e/desktop/task-flow.e2e.mjswework/src/components/chat/composer/ProjectWorkBar.test.tsxwework/src/components/chat/composer/ProjectWorkBar.tsxwework/src/components/chat/composer/WorktreeBranchSelector.tsxwework/src/components/common/BranchSelector.tsxwework/src/components/layout/DesktopWorkbenchLayout.test.tsxwework/src/components/layout/DesktopWorkbenchMain.tsxwework/src/components/layout/workspace-panels/RightWorkspacePanel.tsxwework/src/i18n/locales/en/common.jsonwework/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
…ace-panel # Conflicts: # wework/e2e/desktop/task-flow.e2e.mjs # wework/src/components/layout/DesktopWorkbenchMain.tsx
Summary
Verification
pnpm --filter wework lintpnpm --filter wework typecheckpnpm --filter wework test(220 files, 2184 tests)Screenshot coverage
The desktop E2E flow now captures:
workspace-panel-01-default-split.pngworkspace-panel-02-expanded.pngworkspace-panel-03-expanded-sidebar-hidden.pngworkspace-panel-04-restored-split.pngSummary by CodeRabbit