fix(desktop): make v2 right sidebar toggle reactive#3421
Conversation
The hover icon swap was silently broken because isOpen was read via a one-shot collections.get() call instead of a live query, so the component never re-rendered when rightSidebarOpen changed.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughReplaced synchronous local state lookup in the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 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 docstrings
🧪 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 |
Greptile SummaryThis PR fixes a reactivity bug in the
Confidence Score: 5/5Safe to merge — the change is a one-file, targeted bug fix that adopts the codebase's established reactive pattern. The fix is minimal and correct: it replaces a non-reactive read with No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Hotkey as ⌘L Hotkey
participant Toggle as RightSidebarToggle
participant Collection as v2WorkspaceLocalState
participant LiveQuery as useLiveQuery
Note over Toggle,LiveQuery: Before fix — one-shot read
Toggle->>Collection: .get(workspaceId)
Collection-->>Toggle: snapshot (stale, no re-render on change)
Hotkey->>Collection: .update(workspaceId, draft)
Note over Toggle: Toggle never re-renders — icon stays stale
Note over Toggle,LiveQuery: After fix — reactive subscription
LiveQuery->>Collection: subscribe query (workspaceId)
Collection-->>Toggle: live rows (triggers re-render on any change)
Hotkey->>Collection: .update(workspaceId, draft)
Collection-->>LiveQuery: row changed
LiveQuery-->>Toggle: re-render with updated isOpen
Reviews (1): Last reviewed commit: "fix(desktop): make v2 right sidebar togg..." | Re-trigger Greptile |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
…perset-sh#3421) The hover icon swap was silently broken because isOpen was read via a one-shot collections.get() call instead of a live query, so the component never re-rendered when rightSidebarOpen changed.
All 9 upstream commits have been individually cherry-picked via PR#159~#163: | Upstream | Our PR | Description | |---|---|---| | d656b7e (superset-sh#3415) | #159 (PR#1) | terminal clipboard handling | | 31fcf19 (superset-sh#3416) | #162 (PR#4) | v1 split pane startup sizing fix | | 039edf2 (superset-sh#3403) | #161 (PR#3) | Cmd+Alt+Arrow spatial pane focus | | b18a00c (superset-sh#3421) | #159 (PR#1) | v2 right sidebar toggle reactive | | 3dd1de2 (superset-sh#3420) | #161 (PR#3) | v2 diff viewer + tab title resolution | | b42a114 (superset-sh#3418) | #159 (PR#1) | CodeMirror hotkey enablement | | c925f4d (superset-sh#3422) | #160 (PR#2) | unbound defaults + restore prev/next tab/workspace | | bb12c09 (superset-sh#3419) | #163 (PR#5) | version bump 1.5.3 | | 47efa73 (superset-sh#3432) | #159 (PR#1) | pending/update-required error selectable | Fork-specific features preserved: - auto-updater (IS_FORK, GitHub Releases API) - QuitMode/cleanupMainWindowResources lifecycle - GitHubSyncService, SpreadsheetViewer - BROWSER_RELOAD / BROWSER_HARD_RELOAD / SEARCH_IN_FILES hotkeys - HotkeyCategory "Browser" - v1 deep-link navigation (useSearch/WorkspaceSearchParams) - v1 tRPC-based PREV/NEXT_WORKSPACE handlers - v1 CLOSE_TERMINAL/CLOSE_TAB hotkey handlers - v2 extra state (rightSidebarOpenViewWidth, showPresetsBar)
Summary
LuPanelRight→LuPanelRightOpen/LuPanelRightClose) was silently broken:isOpenwas read via a one-shotcollections.v2WorkspaceLocalState.get(workspaceId)call, so the component never re-rendered whenrightSidebarOpenchanged.useLiveQuery(matchinguseV2WorkspacePaneLayout) so the toggle reactively reflects the current state, and the hover icon now matches the left sidebar toggle's behavior.Test plan
Summary by cubic
Make the v2 right sidebar toggle reactive so the hover icon reflects the current open state. Replaced a one-off state read with a live query tied to
v2WorkspaceLocalState.useLiveQueryfrom@tanstack/react-dbwitheqfrom@tanstack/dbto subscribe to per-workspacev2WorkspaceLocalState.Written for commit 94efc23. Summary will update on new commits.
Summary by CodeRabbit