Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Oct 12, 2025

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:

  • Added an initial-mount guard in webview-ui/src/components/settings/SettingsView.tsx so non-user programmatic syncs on first render do not mark the view as dirty.
  • Refined change detection in setApiConfigurationField to skip dirty-state when:
    • Automatic initialization transitions uninitialized values (undefined/null/empty) to a real value, or
    • Non-user programmatic syncs occur during initial mount.
  • Unskipped and fixed tests in webview-ui/src/components/settings/tests/SettingsView.unsaved-changes.spec.tsx to assert correct behavior.

Test Procedure

  • Repro steps (pre-fix): Change Mode or API on main UI, open Settings, click Done → unsaved dialog incorrectly appears.
  • Post-fix verification:
    • No dialog appears when opening Settings immediately after Mode/API changes and clicking Done.
    • Dialog appears only after user-initiated changes inside Settings.
  • Automated tests run:
    • webview-ui: SettingsView change detection and unsaved-changes specs.

Pre-Submission Checklist

Screenshots / Videos

No UI appearance changes; behavior only.

Documentation Updates

  • No documentation updates are required.

Additional Notes

  • This change preserves genuine dirty-state prompts for actual user edits inside Settings.
  • Touch points:
    • webview-ui/src/components/settings/SettingsView.tsx
    • webview-ui/src/components/settings/tests/SettingsView.unsaved-changes.spec.tsx

Get in Touch

@hannesrudolph


Important

Fixes false unsaved-changes prompt in SettingsView.tsx by adding an initial-mount guard and refining change detection logic, with updated tests in SettingsView.unsaved-changes.spec.tsx.

  • Behavior:
    • Fixes false unsaved-changes prompt in SettingsView.tsx by adding an initial-mount guard to prevent marking the view as dirty during non-user programmatic syncs.
    • Refines setApiConfigurationField to skip dirty-state for automatic initialization and non-user syncs during initial mount.
  • Tests:
    • Unskips and fixes tests in SettingsView.unsaved-changes.spec.tsx to verify no unsaved changes prompt for automatic initializations and correct prompt for user changes.
    • Tests include scenarios for initialization from undefined/null to value and automatic model ID syncs.

This description was created by Ellipsis for 2503f3c. You can customize this summary. It will automatically update as commits are pushed.

@hannesrudolph hannesrudolph requested review from Copilot and removed request for Copilot October 12, 2025 20:56
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Oct 12, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 12, 2025
@hannesrudolph
Copy link
Collaborator Author

This was an automatic PR generation test, did not check to see if it works or makes sense. Was testing workflow and model integration.

@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 14, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG] Unsaved-changes prompt after Mode/API change without edits

2 participants