Spec v2 rebuild: full HomeLab module (steps 1-11) #3
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/specv2-step1-schema"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Full rebuild of Ion-HomeLab from Spec v2. All 11 build steps: schema/seed (641 types, 12 manufacturers), server API, rack visualiser, device types, brands/providers, locations/rooms, devices/NIC editor, services/connectors, network map, floorplans, dashboard/settings/backup (includes the D-54 path-traversal RCE fix). 151 server tests, 153 client tests, build clean. Not yet visually verified in a browser - needs testing before merge.
Built from staging/spec/phase-7-specv2 (40k lines, written from the reference source rather than from prose summaries). Data layer: 30 tables (was 27). 641 device types (was 602 - the reference inserts 39 in code, and those 39 are the only ones carrying real per-type icons and the only ones covering all four rack faces). 12 manufacturers (was 8), all with logos wired. standalone_devices gains nics/ports/psus/bbus, without which three of the four render faces cannot be built at all. Added resolveTypeIcon: custom icon -> brand logo -> generic, whose absence is why 641 types previously rendered as one grey box. Three global rules, as enforced primitives rather than advice: G-1 merge.js every update is read-merge-write. Eight places in the reference blank columns a request never mentioned, up to a restore whose missing 'strategy' field wiped the database. G-2 errors.js no silent failures. The reference's live poll swallows errors and reports "Live" over a dead host. G-3 serialize.js credentials never reach the browser. The reference returns the UniFi password, Proxmox token secret and Hawser token. API: 8 route files including the /api/rv/* family the rack visualiser needs. All four connectors ported faithfully - Proxmox keeps skipVerify and rejectUnauthorized:false for self-signed certs; UniFi gains the skipVerify flag it never had. Every route carries a permission guard except /api/health and /api/whoami. Deleted: the self-updater, and two unauthenticated privilege-escalation endpoints (setup/complete, user-groups). 151 tests, written to fail on a missing feature rather than to count rows.2,580 lines across 24 files, replacing a 274-line version that shipped NONE of the render faces. A grep for hostFace|switchFace|powershelfFace|imageFace across the old client returned zero matches. Drawing layer: rackGeometry.js plus all five faces (Simple, Host, Switch, Powershelf, Image), drawing from the nics/ports/psus/bbus columns the schema rebuild added. Interaction layer: RackShell, RackFrame, DropBand, AddDeviceModal, DevicePopup, useRackDragDrop - double-click to add, drag between U slots, drag from an external list, three-state drop bands, swap-on-drop. Three reference defects fixed, each with a test that fails on regression: - the device popup re-declares U_HEIGHT = 44 and renders only row 1 of a switch's ports, dropping half of them. Now renders all 48. - collision detection checks only the U under the pointer, so a 2U device can be dropped overlapping its neighbour. Now validates the full span. - a mousemove+mouseup listener pair leaks on every popup open. useEffect cleanup on all of them. U_HEIGHT is 53, not the 44 the reference's JS hardcodes: the CSS defines 53px rows and the CSS is what renders, so the JS value puts every device up to 369px above its slot on a 42U rack. Three of the four geometry constants exist only in the stylesheet, which is how the previous build guessed them wrong. uPosition counts from the TOP; the previous build inverted it and mispositioned every multi-U device. faceplateWidth is compared as a string so a 10" faceplate cannot silently normalise to 19". All 10 label tokens resolve with a global regex - the previous build implemented 3 and resolved only the first occurrence. Deleted as invented: zoom, and the front/rear view toggle. Neither exists in the reference. Adds vitest to the client, which had no test runner. 22 tests.