fix(web): make changed-files collapse persistence configurable#2260
fix(web): make changed-files collapse persistence configurable#2260Marve10s wants to merge 5 commits into
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 |
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. Unresolved review comments identify a bug: the new You can customize Macroscope's approvability policy. Learn more. |
4d1dffc to
bc2b8d9
Compare
Dismissing prior approval to re-evaluate bc2b8d9
|
it being turn based is intentional. you might collapse a big block cause it was part of a merge commit, but then still wanting to keep track of future turns |
Feels annoying since I do have lots of threads where I need to scroll a lot to see actual output. I can turn it into configuration option in settings so everyone would be able to toggle it. I will leave current version as default |
Sounds good! |
Dismissing prior approval to re-evaluate 68b66b4
|
@juliusmarminge Seems like works fine , added a toggle in settings. Lmk if there any issue |
Dismissing prior approval to re-evaluate dd4351a
41af439 to
7c4037b
Compare
7c4037b to
d03f177
Compare
|
@juliusmarminge Sorry for tagging you, wanted to ask if you have any plans on reviewing old PRs? I have a couple of them and they are all more than 2 weeks old, so I'm not sure if they would be visible among all the new PRs coming in. |
|
Yes. Will get back to reviewing stuff, just have some pretty large PRs that will conflict a bunch so will get those in first |
Great, thank you! Let me know if you are looking for any free help, I'd love to help. Can review, test, record demos, etc. |
There was a problem hiding this comment.
🟠 High
The defaultOpenChangedFiles setting is included in changedSettingLabels (shown as "Changed-files default state") but missing from the updateSettings call in restoreDefaults. After confirming the reset dialog, users see the setting listed as being reset but the value is never actually restored to default.
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/web/src/components/settings/SettingsPanels.tsx around line 461:
The `defaultOpenChangedFiles` setting is included in `changedSettingLabels` (shown as "Changed-files default state") but missing from the `updateSettings` call in `restoreDefaults`. After confirming the reset dialog, users see the setting listed as being reset but the value is never actually restored to default.
Evidence trail:
apps/web/src/components/settings/SettingsPanels.tsx lines 397-399: `defaultOpenChangedFiles` checked in `changedSettingLabels` as 'Changed-files default state'. Lines 463-475: `updateSettings` call in `restoreDefaults` omits `defaultOpenChangedFiles` while including all other settings tracked in `changedSettingLabels`. Verified at REVIEWED_COMMIT.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3a01b7b. Configure here.
| settings.confirmThreadArchive, | ||
| settings.confirmThreadDelete, | ||
| settings.addProjectBaseDirectory, | ||
| settings.defaultOpenChangedFiles, |
There was a problem hiding this comment.
Restore defaults omits new defaultOpenChangedFiles setting
Medium Severity
The changedSettingLabels memo correctly detects when defaultOpenChangedFiles differs from the default and shows "Changed-files default state" in the restore confirmation dialog. However, the restoreDefaults callback's updateSettings call does not include defaultOpenChangedFiles, so clicking "Restore default settings" tells the user this setting will be reset but never actually resets it.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3a01b7b. Configure here.



Summary
This keeps changed-files collapse scoped per turn by default, and adds a settings toggle for people who want collapse state to persist across future turns in the same thread and survive relaunch.
What Changed
Review Feedback Addressed
User Impact
Users who prefer the old per-turn behavior keep it by default. Users who want changed-files blocks to stay collapsed across future prompts can enable the new toggle in Settings.
Validation
bun run --cwd apps/web test -- src/uiStateStore.test.ts src/components/chat/MessagesTimeline.test.tsx src/localApi.test.tsbun run --cwd apps/web test:browser -- src/components/chat/MessagesTimeline.browser.tsxbun run --cwd apps/web test:browser -- src/components/settings/SettingsPanels.browser.tsxbun run --cwd apps/desktop test -- src/clientPersistence.test.tsbun fmtbun lintbun typecheckNote
Make changed-files collapse state configurable per user setting
defaultOpenChangedFilesboolean toClientSettingsSchema(defaulttrue) and exposes a toggle in the General settings panel via SettingsPanels.tsx.AssistantChangedFilesSectionInner, where it determines the initial expansion state per assistant turn.uiStateStorerelative to the default; toggling back to the default removes the override to keep persisted state minimal.trueper-turn overrides are no longer dropped and legacy thread-wide booleans are ignored on reload.setThreadChangedFilesExpandednow requires adefaultExpandedargument, and the store immediately persists project and per-turn changed-files state instead of relying solely on debounced persistence.📊 Macroscope summarized 3a01b7b. 6 files reviewed, 2 issues evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues
Note
Medium Risk
Changes UI-state persistence semantics and storage schema for changed-files expand/collapse, which could affect how existing users’ preferences hydrate and persist across sessions.
Overview
Adds a new client setting,
defaultOpenChangedFiles(defaulttrue), exposed in General settings and plumbed throughChatViewintoMessagesTimelineto control whether changed-files blocks start expanded or collapsed.Updates changed-files expand/collapse tracking to be per-turn with a helper (
getThreadChangedFilesExpanded) and a revisedsetThreadChangedFilesExpandedthat stores overrides relative to the configured default and prunes them when toggled back to default; legacy persisted thread-wide boolean values are ignored during hydration.Adjusts
uiStateStorepersistence so key store actions immediately callpersistState(in addition to the debounced subscriber) and updates tests/fixtures across web + desktop to include the new setting and cover the new per-turn/default-aware behavior.Reviewed by Cursor Bugbot for commit 3a01b7b. Bugbot is set up for automated code reviews on this repo. Configure here.
Closes #2158