fix(web): persist the Settled shelf's collapsed state#4573
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
Collapsing Settled in Sidebar V2 read as a lasting preference but was component state, so every relaunch brought the history back. Move it to the useLocalStorage hook used for other client-only UI prefs, defaulting to expanded so nothing changes for anyone who hasn't collapsed it.
d033bcc to
6d84f3f
Compare
ApprovabilityVerdict: Approved Simple UI preference persistence using an existing localStorage hook. The change is self-contained with no impact on business logic or sensitive functionality. You can customize Macroscope's approvability policy. Learn more. |
What changed
The Settled shelf in Sidebar V2 now remembers whether you collapsed it.
Why
Collapsing a section reads as a lasting preference, not a per-session one. Tucking history away and finding it back on every relaunch means re-collapsing it forever.
Note
Persist the Settled shelf's collapsed state in local storage
Replaces the in-memory
useStateforsettledShelfExpandedin SidebarV2.tsx withuseLocalStorage, keyed att3code:sidebar-v2:settled-expanded. The shelf now defaults to expanded on first visit and retains its state across page reloads.Macroscope summarized 6d84f3f.
Note
Low Risk
UI preference only—no server, auth, or data-path changes; worst case is a bad stored boolean falling back to the default expanded state.
Overview
Persists whether the Sidebar V2 Settled shelf is expanded across reloads by storing that preference in
localStorageinstead of session-only React state.settledShelfExpandedinSidebarV2.tsxnow usesuseLocalStoragewith keyt3code:sidebar-v2:settled-expanded, default expanded (true), andSchema.Booleanfor read/write validation. Collapse/expand behavior is unchanged; only the toggle’s expanded/collapsed choice survives a new session.Reviewed by Cursor Bugbot for commit 6d84f3f. Bugbot is set up for automated code reviews on this repo. Configure here.