Skip to content

fix(formatter-settings): disable Save when settings unchanged (closes #349) - #464

Merged
EVWorth merged 1 commit into
mainfrom
fix/349-formatter-save-dirty
Aug 1, 2026
Merged

fix(formatter-settings): disable Save when settings unchanged (closes #349)#464
EVWorth merged 1 commit into
mainfrom
fix/349-formatter-save-dirty

Conversation

@EVWorth

@EVWorth EVWorth commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Adds dirty tracking to FormatterSettingsDialog. The Save button starts disabled when the local state matches the persisted settings — preventing a no-op round-trip to localStorage when the dialog is opened-and-closed without edits. A small accent-colored dot appears in the dialog title as an unsaved-changes indicator. Save re-enables after any field change.

Files

  • src/components/editor/FormatterSettingsDialog.tsx — adds useMemo shallowEqual diff; disabled={!isDirty} on Save; dirty-dot in title; short-circuit in handleSave.
  • src/components/editor/__tests__/FormatterSettingsDialog.test.tsx — 4 new tests covering: disabled-by-default, enabled-after-change (with dirty dot), Save-click-with-no-changes-doesnt-overwrite, existing save+close flow updated to first mutate a setting.

Test plan

  • vitest: src/components/editor/__tests__/FormatterSettingsDialog.test.tsx — 13/13 pass
  • vitest: full frontend suite — 1527/1527 pass
  • tsc --noEmit clean
  • eslint clean
  • cargo fmt / clippy — no Rust files touched

Closes #349

@EVWorth
EVWorth marked this pull request as ready for review August 1, 2026 18:07
@EVWorth
EVWorth merged commit a10d73d into main Aug 1, 2026
10 checks passed
@EVWorth
EVWorth deleted the fix/349-formatter-save-dirty branch August 1, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1/bug] FormatterSettingsDialog Save button is always enabled — no dirty detection

1 participant