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 3 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. |
…ightly v0.0.18 Resolved conflict in Sidebar.tsx — kept new useSettings hooks from PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 boolean setting and threads it through sidebar/UI state defaults; primary impact is a behavioral change to initial project expansion state.
Overview
Adds a new client-side setting,
sidebarProjectsDefaultExpanded(defaultfalse), to control the startup/default expansion state of sidebar projects.Threads this default through the sidebar and UI state layer by replacing hardcoded
?? truefallbacks with the new setting, updatingsyncProjects/toggleProjectto accept adefaultExpandedparameter, and passing the setting into project-sync points in the environment runtime service.Exposes the toggle in Settings → General with reset/dirty-state support, and updates desktop/web persistence tests to include the new field.
Reviewed by Cursor Bugbot for commit 77a80f6. 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 77a80f6.