Skip to content

feat: add widgets sidebar toggle button to tabbar#3140

Open
mswiszcz wants to merge 3 commits intowavetermdev:mainfrom
mswiszcz:feat/sidebar-toggle
Open

feat: add widgets sidebar toggle button to tabbar#3140
mswiszcz wants to merge 3 commits intowavetermdev:mainfrom
mswiszcz:feat/sidebar-toggle

Conversation

@mswiszcz
Copy link
Copy Markdown

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).

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).
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 27, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8f8f46e3-d293-4c8f-b0db-9c2dbf449870

📥 Commits

Reviewing files that changed from the base of the PR and between 2899d98 and 7a61e68.

📒 Files selected for processing (1)
  • frontend/types/gotypes.d.ts
✅ Files skipped from review due to trivial changes (1)
  • frontend/types/gotypes.d.ts

Walkthrough

A 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)

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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add widgets sidebar toggle button to tabbar' directly and clearly summarizes the main change: adding a toggle button for the widgets sidebar in the tabbar.
Description check ✅ Passed The description is directly related to the changeset, explaining both the feature (toggle button) and the persistence mechanism (workspace metadata), which aligns with all file changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Mar 27, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

The 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)
  • frontend/app/workspace/workspace-layout-model.ts - Resolved previous issue

Reviewed by minimax-m2.5

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 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

📥 Commits

Reviewing files that changed from the base of the PR and between 96c2526 and 337ca7f.

📒 Files selected for processing (6)
  • frontend/app/tab/tabbar.tsx
  • frontend/app/workspace/workspace-layout-model.ts
  • frontend/app/workspace/workspace.tsx
  • frontend/types/gotypes.d.ts
  • pkg/waveobj/metaconsts.go
  • pkg/waveobj/wtypemeta.go

mswiszcz and others added 2 commits March 27, 2026 23:39
…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>
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.

2 participants