feat: add widgets sidebar toggle button to tabbar#3140
feat: add widgets sidebar toggle button to tabbar#3140mswiszcz wants to merge 3 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).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughA widgets-sidebar visibility feature was added. A memoized WidgetsSidebarButton component was introduced and exported; it reads and toggles a persisted visibility value via WorkspaceLayoutModel. WorkspaceLayoutModel gained a jotai atom and public getWidgetsSidebarVisible() / setWidgetsSidebarVisible(visible) methods that persist the flag to workspace meta (setter performs an immediate update). The workspace layout now conditionally mounts based on that state. Type definitions were extended: frontend MetaType gains "layout:widgetsvisible"?: boolean, backend adds MetaKey_LayoutWidgetsVisible and LayoutWidgetsVisible *bool on the meta struct. 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: No Issues Found | Recommendation: Merge OverviewThe previous issue regarding widgets sidebar visibility state bleeding across workspace switches has been resolved. The fix uses a derived atom pattern that reads workspace meta at read time, making it inherently workspace-aware. Files Reviewed (1 file)
Reviewed by minimax-m2.5 |
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>
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).