Buildings and levels for the floor map, and make every identifier searchable

This commit is contained in:
2026-08-17 13:03:54 -04:00
parent 47fb65fdd2
commit fbd99041b0
54 changed files with 4173 additions and 880 deletions

View File

@@ -10,6 +10,67 @@ ADR-007 and ADR-002.
## [Unreleased]
The floor map became a set of drawings instead of one picture. A site can hold
more than one building, a building more than one level, and every map position
now records which drawing its coordinates belong to. Driven by a real move: a
second floor was added, a new blueprint changed size, and machines relocated.
### Added
- Buildings and levels (ADR-017). Each level owns its own blueprint per theme
and its own native pixel size; `assets.mapx`/`mapy` are pixels of the level
named by the new `assets.levelid`, not of the site.
- A bulk repositioning tool on the map editor: filter by unplaced, by
needs-review, or by level, search, then place markers and confirm them. New
`POST /api/mappositions/positions` and `/verify`.
- Landmark recalibration (`POST /api/mappositions/transform`). Name two or more
points that appear on both the old and new drawing and every marker on the
level moves onto the new one. Defaults to a dry run that reports each old and
new position and anything that would land off the drawing. The transform is
solved PER AXIS from the landmarks, never derived from image dimensions: a
taller drawing that gained a level below did not rescale, and a
dimension-derived scale would stretch Y by 1.57 and be wrong everywhere.
- Position snapshots with restore, taken before any bulk change including a
restore, so an undo is itself undoable.
- A buildings and levels admin under Settings: name and order levels, see each
level's id and marker count, upload a blueprint per theme, choose the default.
- `assets.mapverifiedat`, the record of when a position was last confirmed
against the current drawing. A bulk transform clears it, because a transform
is a starting guess and nothing in the coordinates says which markers moved.
### Changed
- Plugin contract to 0.20.0 (additive; see CONTRACT-STABILITY.md). A plugin that
writes a map position must now write its level.
- A position whose level is unknown renders as "level unknown" and is NOT drawn
on the default level. Drawing it there would look entirely correct while
pointing at the wrong part of the building.
- `GET /api/printers/install-list?format=text` gained `levelid` as a NINTH
field, appended. Fields 0-7 are unchanged because the shipped Pascal installer
reads them by index.
- Knowledge base: an article whose topic is a retired (`isactive = 0`)
application no longer appears in listings, searches or the counts, and the
topic picker offers every active application rather than only installable
ones.
### Migration
- `7d33_buildings_and_levels` converts an existing single-map site: it creates
one building and one default level carrying the blueprint paths and dimensions
from the old `map_*` settings, then assigns every already-placed asset and
location to it. Nothing moves on screen. The old settings rows are left in
place so a rollback still finds them. Verified end to end on MySQL 5.6 from a
production-shaped database.
### Known gaps
- The Pascal printer-installer map still compiles in one drawing's dimensions and
bundles one blueprint, so it is accurate for the default level only. See
section 6 of PRINTER-INSTALLER.md.
- The setup wizard still asks for a single site-wide blueprint and writes
settings that no longer drive the map.
- Map PDF export covers the current level only.
## [0.10.0] - 2026-08-17
A security release. The Windows installer left the directories it creates