Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR centralizes the default values for the three Zoo auto-close settings, then updates the webview state, settings UI, and diff cleanup paths to read those shared defaults. Tests were adjusted to expect ChangesZoo auto-close defaults
Sequence Diagram(s)sequenceDiagram
participant ClineProvider
participant SettingsView
participant UISettings
ClineProvider->>SettingsView: post webview state with autoCloseZooOpened* defaults
SettingsView->>UISettings: pass checkbox props
SettingsView->>ClineProvider: send updateSettings(autoCloseZooOpened*)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: #719
Description
autoCloseZooOpenedFilesdefaulted totrue, so on upgrade every edited file's tab was closed the instant its diff was accepted — reversing years of prior behavior with no opt-in. This was the core of the community-reported regression ("the editor in the right frame does not show anymore"; "files being edited no longer show up"). The checkbox only became user-toggleable after #668 fixed #667 (where it couldn't be unchecked), so upgraders had no escape hatch until that follow-up shipped.This PR flips the default to opt-in (
false) so edited files stay open by default (the long-standing behavior), and centralizes the three auto-close defaults in a single source of truth so the value can't silently diverge across consumers again — that same divergence (saved-but-not-read-back) is what allowed the #667 bug to slip through in the first place.How:
DEFAULT_AUTO_CLOSE_ZOO_OPENED_FILES/_AFTER_USER_EDITED/_NEW_FILESconstants to@roo-code/types(mirroring the existingDEFAULT_WRITE_DELAY_MSpattern). Deliberately using exported constants rather than zod.default(...)to match the convention used by every other boolean setting inglobal-settings.ts.?? true/?? false:DiffViewProvider.saveChanges(accept path)DiffViewProvider.revertChanges(deny path)DiffViewProvider.keepOrCloseEditedFilesignature defaults + decision-table commentClineProvider.getStateToPostToWebviewUISettings(3 checkboxes)SettingsView— the save payload. This one matters most: without it, a user who never touched the checkbox would havetruewritten back to global state on the next save, silently undoing the opt-in default.Note on interaction: with the new default, enabling only
autoCloseZooOpenedFilesAfterUserEditedno longer closes touched tabs on its own — the override is (and was documented as) a refinement that has no effect when the base setting is off. The affected test was updated to set both.Test Procedure
Node 20.20.2 (the repo's required version). Unit tests (all green):
Type checks (both clean):
pnpm exec tsc --noEmitinsrc/andwebview-ui/. Prettier + eslint clean on all changed files.New/changed coverage:
DiffViewProvidertest: transient tab is kept whenautoCloseZooOpenedFilesis unset (the opt-in default).UISettingstest: checkbox is unchecked when the prop is unset (regression guard against re-introducing?? true).userTouchedDocument close/keep behaviorsuite to enable auto-close explicitly in itsgetStatemock — those tests assert the close path, which is no longer the default.Manual repro (reviewers): with all settings at defaults, have Zoo edit an existing file and accept the diff → the file's tab should remain open in the editor (previously it closed immediately). Toggling "Auto-close files Zoo opened" on restores the close-on-accept behavior.
Pre-Submission Checklist
Screenshots / Videos
No visible UI layout change — only the default checked-state of one existing checkbox flips (checked → unchecked).
Documentation Updates
Additional Notes
AGENTS.md, changesets are managed separately by maintainers — a maintainer will need to add one. This is a user-visible default change and warrants a behavioral note.Get in Touch
Summary by CodeRabbit
New Features
Bug Fixes