Vacuum first-use path: materialize the marker, count rectangle rooms, fix the toasts

Audit HP-1540-01 (High): an auto-discovered vacuum has no config marker
until the device dialog is saved once, yet the live-position section was
already interactive. setVac, _vacSaveMatrix and auto-calibration all did
cfg.markers.find(...) and silently bailed out — while the auto-calibration
toast still claimed success. Every vacuum edit now materializes a minimal
marker (same id/binding the dialog Save would produce), _vacSaveMatrix
reports whether the write landed, and success toasts are gated on it.

HP-1540-04: the auto-calibration room matcher accepted only polygon rooms
and told users their room names did not match. It goes through the shared
roomPoly() now, so legacy x/y/w/h rectangles count like everywhere else.

HP-1540-06: the no-rooms/no-match/rough-fit toasts pointed at the removed
point calibration; they now point at the fit panel that shipped instead,
and docs/VACUUM.md Setup UX describes the actual UI. Also extracted
vacMapIdFromAttrs as the explicit frontend half of the map-id contract
(backend half lands with HP-1540-02).

Regressions: demo/smoke_vacuum_firstuse.mjs starts from cfg.markers=[]
(the fixture gap the audit called out) with rectangle plan rooms and a
zero map_index, and fails 11 checks on the v1.54.0 bundle; i18n unit test
asserts no point/точк wording in either language.
This commit is contained in:
Matysh
2026-07-31 13:07:16 +03:00
parent 77327c07d4
commit 69c5a4c41d
8 changed files with 221 additions and 28 deletions
+10 -6
View File
@@ -91,12 +91,16 @@ marker is edited as usual.
## Setup UX
A «Живая позиция» section in the device dialog, vacuum markers only:
status line (which source was found / room-only / nothing), one button
(«Настроить автоматически» for Tier A, «Калибровка по трём точкам» for
Tier B), three checkboxes (live position / trail / room highlight, all
on), and for multi-map robots a per-map calibration status list. The
source entity is discovered via the device registry — no YAML, no
entity pickers.
status line (which source was found / nothing), the «Настроить
автоматически» button (Tier A — the integration reports a room list),
the «Подогнать вручную» button opening the fit panel (drag the ghost
map, stretch by the corners, rotate/mirror), one «Живая позиция на
плане» checkbox (on by default), the «Показывать путь робота» select
(never / while cleaning / always), and for multi-map robots a list of
calibrated maps. The source entity is discovered via the device
registry — no YAML, no entity pickers. The section works before the
marker is ever saved: the first vacuum edit materialises the marker
itself (HP-1540-01).
## Storage & validation