Commit 4403132
refactor(settings-ui): HA-faithful redesign, auto-save, dedicated package (#1695)
* refactor(settings-ui): HA-faithful redesign, auto-save, dedicated package
- Move settings UI into src/ha_mcp/settings_ui/ package; extract markup,
CSS and JS into settings.html/settings.css/settings.js loaded at import
- Restyle controls to match the HA frontend (ha-switch, ha-button, ha-alert,
filled fields); replace persistent status pills with an HA-style toast
- Auto-save Server Settings fields (drop the Save buttons); keep the Backups
and Tool-Security-Policies form Save buttons
- Add read-only/writes/deletes capability badges via a shared
categorize_capability(), the same classifier that routes the
read/write/delete proxies, so badge and routing never disagree
- Fix mid-save data loss in advanced auto-save: preserve pending edits across
the post-save reload and guard against re-entrancy
* fix(packaging): point PyInstaller spec and parity comments at settings_ui/
The settings UI assets moved into src/ha_mcp/settings_ui/; the PyInstaller
spec still referenced the old src/ha_mcp/settings.js|css paths, failing every
binary Build. Point the spec at the settings_ui/ dir, add settings.html (now
a third mandatory asset), and bundle into ha_mcp/settings_ui. Update the stale
src/ha_mcp/settings.* / settings_ui.py cross-reference comments in the docs
site to the new paths.
* fix(settings-ui): address Gemini review (toast timer race, a11y)
- Clear the 200ms leave-removal timer when a toast is reused so a
replace-on-new toast is not yanked from the DOM by the prior removal
- Add aria-live (polite/assertive) to the toast alongside role so every
screen reader announces the update
- Drop the redundant aria-label on the theme <select> (the wrapping
<label> with visible text already supplies the accessible name)
- Promote panel-server and panel-accessibility section titles from h3 to
h2 so the heading hierarchy no longer skips a level (styling is
class-controlled, no visual change)
- Add a regression test for the toast removal-timer race and assert aria-live
---------
Co-authored-by: Sergey <sergey@example.com>1 parent 9a8e274 commit 4403132
23 files changed
Lines changed: 2119 additions & 1444 deletions
File tree
- packaging/binary
- site/src
- layouts
- styles
- src/ha_mcp
- settings_ui
- transforms
- tests
- src/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
| 347 | + | |
| 348 | + | |
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
| |||
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
| 383 | + | |
| 384 | + | |
382 | 385 | | |
383 | 386 | | |
384 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| |||
0 commit comments