fix: Prevent false unsaved-changes prompt after Mode/API change (#8230) #8632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #8230
Roo Code Task Context (Optional)
No Roo Code task context for this PR
Description
This PR fixes a bug where the Settings dialog showed an “unsaved changes” prompt after switching Mode/API from the main interface, even when no edits were made inside Settings.
Key implementation details:
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
No UI appearance changes; behavior only.
Documentation Updates
Additional Notes
Get in Touch
@hannesrudolph
Important
Fixes false unsaved-changes prompt in
SettingsView.tsxby adding an initial-mount guard and refining change detection logic, with updated tests inSettingsView.unsaved-changes.spec.tsx.SettingsView.tsxby adding an initial-mount guard to prevent marking the view as dirty during non-user programmatic syncs.setApiConfigurationFieldto skip dirty-state for automatic initialization and non-user syncs during initial mount.SettingsView.unsaved-changes.spec.tsxto verify no unsaved changes prompt for automatic initializations and correct prompt for user changes.This description was created by
for 2503f3c. You can customize this summary. It will automatically update as commits are pushed.