feat: add widgets sidebar toggle button to view menu#3140
feat: add widgets sidebar toggle button to view menu#3140sawka merged 5 commits intowavetermdev:mainfrom
Conversation
Add ability to toggle the Widgets sidebar visibility via a button in the tabbar. State persists across sessions and workspaces through workspace metadata (layout:widgetsvisible).
|
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:
WalkthroughThis change adds a new metadata key Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
New Changes (commit d15a05a..HEAD)Added "Toggle Widgets Bar" menu item in View menu ( Other Observations (not in diff)The menu approach provides a workaround for toggling the widgets bar, but the underlying issue remains: the derived atom at line 75 in Files Reviewed (2 files)
Reviewed by minimax-m2.5-20260211 · 2,230,012 tokens Reviewed by minimax-m2.5-20260211 · 286,672 tokens |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/app/workspace/workspace-layout-model.ts`:
- Around line 173-177: The widgets visibility is only read at construction in
initializeFromMeta(), so WorkspaceLayoutModel's
widgetsSidebarVisible/widgetsSidebarVisibleAtom can retain the previous
workspace value; extract the savedWidgetsSidebarVisible load into a small method
(e.g., reloadWidgetsVisibility) that reads
globalStore.get(this.getWidgetsSidebarVisibleAtom()), sets
this.widgetsSidebarVisible and globalStore.set(this.widgetsSidebarVisibleAtom,
...), and call that method both from initializeFromMeta() and whenever the
active workspace changes (or from the existing workspace-switch handler) so the
per-workspace value is reloaded on workspace switches.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d00a0da6-63f0-475a-986a-6388c88e2c67
📒 Files selected for processing (6)
frontend/app/tab/tabbar.tsxfrontend/app/workspace/workspace-layout-model.tsfrontend/app/workspace/workspace.tsxfrontend/types/gotypes.d.tspkg/waveobj/metaconsts.gopkg/waveobj/wtypemeta.go
…pace bleed The widgetsSidebarVisible state was only loaded once at construction time via initializeFromMeta(). Since WorkspaceLayoutModel is a singleton, switching workspaces would keep the previous workspace's value. Replace the local boolean + PrimitiveAtom with a derived atom that reads directly from workspace meta, eliminating the duplicated state entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
CRITICAL: Toggle button removed - widgets sidebar cannot be toggled
The WidgetsSidebarButton component that was previously in frontend/app/tab/tabbar.tsx has been removed. The PR description states "Add ability to toggle the Widgets sidebar visibility via a button in the tabbar," but the button was removed in commit d15a05ac. Without a toggle mechanism, users have no way to show/hide the widgets sidebar, making the feature non-functional.
| this.vtabWidth = VTabBar_DefaultWidth; | ||
| this.vtabVisible = false; | ||
| this.panelVisibleAtom = jotai.atom(false); | ||
| this.widgetsSidebarVisibleAtom = jotai.atom( |
There was a problem hiding this comment.
CRITICAL: Missing setter - the derived atom has no write functionality
The widgetsSidebarVisibleAtom is now a derived read-only atom (no getter/setter pair). There is no way to update the value. Compare with how panelVisibleAtom works in this file - it has a setter method setAIPanelVisible() that updates the atom and persists to meta. The widgets sidebar needs similar setter functionality to persist visibility changes to layout:widgetsvisible.
Add ability to toggle the Widgets sidebar visibility via a button in the tabbar. State persists across sessions and workspaces through workspace metadata (layout:widgetsvisible). --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: sawka <mike@commandline.dev>
Add ability to toggle the Widgets sidebar visibility via a button in the tabbar. State persists across sessions and workspaces through workspace metadata (layout:widgetsvisible).