feat: add setting to control default project expansion on startup#1923
feat: add setting to control default project expansion on startup#1923alecramos-sudo wants to merge 2 commits intopingdotgg:mainfrom
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 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 |
…ngdotgg#1910) Projects now default to collapsed in the sidebar on restart. A new "Expand projects on startup" toggle in Settings > General lets users restore the previous always-expanded behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f9e789a to
cb8887c
Compare
The guard used `?? defaultExpanded` (defaulting to false) to compute current state, but callers without the setting would short-circuit incorrectly when the user's preference was true. Using strict equality (===) against the explicit state avoids the mismatch entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved Adds a new user preference setting for sidebar project expansion with straightforward implementation following existing patterns. Changes are self-contained to UI behavior, include appropriate tests, and don't affect security or critical paths. You can customize Macroscope's approvability policy. Learn more. |
Summary
Closes #1910
Changes
packages/contracts/src/settings.ts— newsidebarProjectsDefaultExpandedboolean inClientSettingsSchema(defaults tofalse)apps/web/src/uiStateStore.ts—syncProjects,toggleProject,setProjectExpandedaccept the setting asdefaultExpandedparameterapps/web/src/components/Sidebar.tsx— uses the setting as the fallback for expansion stateapps/web/src/components/settings/SettingsPanels.tsx— settings UI toggle with reset supportapps/web/src/environments/runtime/service.ts— passes the setting tosyncProjectscallsapps/web/src/hooks/useSettings.ts— exportsgetClientSettingsSnapshotfor non-React contextsTest plan
🤖 Generated with Claude Code
Note
Low Risk
Low risk: adds a new client-side setting and threads it through sidebar/UI state defaults; main impact is a behavioral default change for project expansion on startup.
Overview
Projects in the sidebar now default to the user’s preferred expansion state on startup instead of always expanding; the new default is collapsed.
Adds a new client setting
sidebarProjectsDefaultExpanded(persisted with existing client settings) and exposes it as an “Expand projects on startup” toggle in General settings with reset support. The sidebar anduiStateStorenow use this setting as the fallback when no per-project expansion state has been stored, including during project syncing and when toggling a project.Reviewed by Cursor Bugbot for commit 9c493cf. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add setting to control default project expansion on sidebar startup
sidebarProjectsDefaultExpandedboolean field toClientSettingsSchema(default:false), replacing the previously hardcodedtruedefault throughout the sidebar and UI state store.syncProjectsandtoggleProjectin uiStateStore.ts to accept adefaultExpandedparameter, and threads the client setting value through from runtime/service.ts and Sidebar.tsx.Macroscope summarized 9c493cf.