feat(room): storeys, walls and AP placement in the Room Builder - #1824
Open
clonea1 wants to merge 4 commits into
Open
feat(room): storeys, walls and AP placement in the Room Builder#1824clonea1 wants to merge 4 commits into
clonea1 wants to merge 4 commits into
Conversation
New tab (index.html nav + section, wired in app.js following the same
container-lookup + component pattern as the other tabs) backed by
GET/POST /api/v1/config/room. A 2D top-down canvas: set room width/
depth, add/remove sensor nodes, drag them into place or type exact
X/Y/Z, save. Save applies immediately (live, no restart) and persists
to room_config.json, which future launches load automatically -
replacing the --node-positions CLI-only workflow.
Metric/imperial unit toggle (display-only - this.config and everything
sent to the API always stay in meters, remembered per-browser via
localStorage). Compass badge + explanatory text establishing (0,0,0)
as the room's Northwest corner, +X = East, +Y = South, so placements
can be oriented to the real room.
Rows are matched to their node by array index rather than by id -
id is itself one of the editable fields, and using it as the lookup
key meant renaming a node into an id already in use broke the row<->
node link (two rows silently reading/writing the same node object,
which looked like one node jumping onto or stacking with another).
Duplicate ids are now also caught client-side (warned while editing,
hard-blocked on save) ahead of the server's own validation, and a
server-side validation rejection (200 OK with an {"error": ...} body,
not a failure status) is now checked for explicitly rather than
silently treated as a successful save.
Co-Authored-By: claude-flow <ruv@ruv.net>
(cherry picked from commit 4cc202a)
Extracted POST /api/v1/config/room's validation into a pure validate_room_config(&RoomConfig) -> Result<(), String> function so it's unit-testable without a full SharedState/axum harness; behavior unchanged, the handler just delegates to it now. 9 new tests: load-missing/malformed-file defaults, save+load round trip, and validation for non-positive/non-finite dimensions, non-finite node coordinates, duplicate node ids, and an empty node list. Also adds a "Reload from Saved" button to the Room Builder UI (discards unsaved local edits, re-fetches the live server config). Co-Authored-By: claude-flow <ruv@ruv.net> (cherry picked from commit a3b9907)
Extends the Room Builder from a single flat rectangle to a building: multiple storeys, walls drawn per storey, and a placed access point. Storeys share one origin. The origin (0, 0, 0) is the north-west corner of the first floor at floor level, and every storey is measured from it rather than being re-zeroed, so a node's X/Y means the same thing on every floor and distances between nodes on different storeys are plain Euclidean. Nodes and walls on other storeys are drawn faintly rather than hidden, which is what lets an upper-floor node be lined up against the wall below it. Storey elevation is derived from ceiling height plus subfloor thickness rather than typed in directly, because those are the two numbers someone can actually measure. Heights are entered in inches. A node carries `floor` alongside `z`. That is redundant for geometry and deliberately so: it is what the builder groups by and what walls are associated with, and deriving it from `z` would guess wrong for a node mounted high in a stairwell. `floor` is optional, so a config written before storeys existed keeps working unchanged. Every persisted field is served back by GET /api/v1/config/room. That response body is hand-maintained and will not complain when it falls behind the struct, so it carries a comment saying so at the point where the next field will be added -- a field that is saved but not served looks exactly like "the setting will not stick". Wall entry takes a start and an end and refuses a zero-length wall, which is otherwise easy to stage by double-tapping a corner. Co-Authored-By: claude-flow <ruv@ruv.net>
…al Vec ruvnet#1791 landed node_positions_config as a positional Vec<[f32;3]> keyed by active-node rank, not the HashMap<u8,[f32;3]> this branch was written against, so the Room Builder handlers stopped compiling. Read path enumerates and derives the id from the index, matching the convention the fusion path uses -- the Room Builder exists to show where the server thinks nodes are, so describing a different binding than fusion applies would be worse than showing nothing. Write path builds the vector indexed BY node id before assigning, so a sparse id set still lands each node in the right slot instead of shifting everything after a gap. Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the Room Builder from a single flat rectangle to a building: multiple
storeys, walls drawn per storey, and a placed access point.
Storeys share one origin. The origin (0, 0, 0) is the north-west corner of the
first floor at floor level, and every storey is measured from it rather than
being re-zeroed, so a node's X/Y means the same thing on every floor and
distances between nodes on different storeys are plain Euclidean. Nodes and
walls on other storeys are drawn faintly rather than hidden, which is what lets
an upper-floor node be lined up against the wall below it.
Storey elevation is derived from ceiling height plus subfloor thickness rather
than typed in directly, because those are the two numbers someone can actually
measure. Heights are entered in inches.
A node carries
flooralongsidez. That is redundant for geometry anddeliberately so: it is what the builder groups by and what walls are associated
with, and deriving it from
zwould guess wrong for a node mounted high in astairwell.
flooris optional, so a config written before storeys existed keepsworking unchanged.
Every persisted field is served back by GET /api/v1/config/room. That response
body is hand-maintained and will not complain when it falls behind the struct,
so it carries a comment saying so at the point where the next field will be
added -- a field that is saved but not served looks exactly like "the setting
will not stick".
Wall entry takes a start and an end and refuses a zero-length wall, which is
otherwise easy to stage by double-tapping a corner.
Rebased onto current
mainbefore opening: staged before today's seven merges, so it needed replaying to avoid reading as a revert of them. Clean rebase, no files deleted.