fix(web): preserve project filter through settings - #6480
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:
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 |
ApprovabilityVerdict: Approved 4c4b495 This PR performs a standard React state-lifting refactor, moving You can customize Macroscope's approvability policy. Learn more. |
4c4b495 to
2439c03
Compare
Problem
The new sidebar kept its project filter in
ThreadSidebarcomponent state. Opening Settings replaces that component with the settings navigation, so returning to the thread sidebar reset the filter to “All projects.”Fix
Hoist the selected project scope into
AppSidebarLayout, which remains mounted across Settings navigation, and pass the value and setter intoThreadSidebar. Existing project validation and filtering behavior remains unchanged, and the filter is not persisted across reloads.Impact
Users can open Settings and return without losing their selected sidebar project filter.
Validation
pnpm --filter @t3tools/web typecheckvp test run src/components/Sidebar.logic.test.ts src/components/ui/sidebar.test.tsx --project unit(111 tests)git diff --checkNo screenshots included because the change only preserves state across navigation and has no visual before/after difference.
Note
[!NOTE]
Preserve project filter in sidebar across settings navigation
Lifts
projectScopeKeystate from Sidebar.tsx into AppSidebarLayout.tsx so the selected project filter survives re-renders caused by navigating through settings. The sidebar now receives the key and its change handler as props instead of managing its own local state.Macroscope summarized 2439c03.
Note
Low Risk
Small React state lift with no API, auth, or persistence changes; behavior is limited to preserving in-session UI state across sidebar swaps.
Overview
Fixes the new thread sidebar resetting its project filter to “All projects” after visiting Settings.
projectScopeKeyis lifted fromSidebarintoAppSidebarLayout, which stays mounted when Settings replaces the thread sidebar with settings nav.ThreadSidebarnow receivesprojectScopeKeyandonProjectScopeKeyChangeas props instead of owning local state. Existing validation (clearing the scope when the project disappears) and list filtering behavior are unchanged; the filter is still not persisted across reloads.Reviewed by Cursor Bugbot for commit 2439c03. Bugbot is set up for automated code reviews on this repo. Configure here.