feat(settings): configurable ΔE₀₀ traffic-light thresholds (#184) #200

Closed
gronod wants to merge 1 commits from feat/184-configurable-delta-e into enh/178-swatch-grid
Owner

Closes #184.

This branch stacks on enh/178-swatch-grid and makes the Stage 3 swatch-grid traffic-light thresholds user-configurable.

Changes

  • Added AppSettings.delta_e_good_max and AppSettings.delta_e_warning_max (defaults 2.0 / 5.0) with serde default functions and a validate() method.
  • Backend save_settings validates the invariant good < warning and non-negative values; unit tests cover defaults, deserialization defaults, and validation.
  • Added Settings dialog UI with two type="number" inputs, live frontend validation, and an error hint.
  • settings.js loads and persists the thresholds and dispatches a settings-saved custom event on success.
  • swatch_grid.js listens for settings-saved, reloads thresholds, and re-classifies all already-rendered patches. New patches use the current thresholds and store their raw ΔE in data-delta-e.
  • Tooltip now includes the ΔE classification word (Good / Warning / Bad).
  • Updated AGENTS.md, README.md, and ROADMAP.md.

Verification

  • CARGO_INCREMENTAL=0 cargo test in src-tauri/: 75 passed (including 3 new settings tests).
Closes #184. This branch stacks on `enh/178-swatch-grid` and makes the Stage 3 swatch-grid traffic-light thresholds user-configurable. ### Changes - Added `AppSettings.delta_e_good_max` and `AppSettings.delta_e_warning_max` (defaults 2.0 / 5.0) with serde default functions and a `validate()` method. - Backend `save_settings` validates the invariant `good < warning` and non-negative values; unit tests cover defaults, deserialization defaults, and validation. - Added Settings dialog UI with two `type="number"` inputs, live frontend validation, and an error hint. - `settings.js` loads and persists the thresholds and dispatches a `settings-saved` custom event on success. - `swatch_grid.js` listens for `settings-saved`, reloads thresholds, and re-classifies all already-rendered patches. New patches use the current thresholds and store their raw ΔE in `data-delta-e`. - Tooltip now includes the ΔE classification word (Good / Warning / Bad). - Updated `AGENTS.md`, `README.md`, and `ROADMAP.md`. ### Verification - `CARGO_INCREMENTAL=0 cargo test` in `src-tauri/`: 75 passed (including 3 new settings tests).
gronod added 1 commit 2026-09-04 00:45:06 +01:00
- Add AppSettings fields delta_e_good_max / delta_e_warning_max with
  serde defaults (2.0 / 5.0) and validation on save.
- Add Settings dialog UI for the two threshold inputs with live frontend
  validation and a backend validate() method / unit tests.
- Dispatch a settings-saved custom event so the swatch grid can re-classify
  existing patches on the fly.
- Refactor swatch_grid.js to load thresholds from settings, classify using
  current bounds, store raw ΔE on each patch element, and re-classify on
  settings change.
- Update AGENTS.md, README.md, and ROADMAP.md.

Generated with Devin
gronod added 1 commit 2026-09-06 08:54:40 +01:00
gronod closed this pull request 2026-09-06 08:54:47 +01:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.