From 9bf90cbbed40a784cd8b556c5909accc7de3756f Mon Sep 17 00:00:00 2001 From: Pouzor Date: Fri, 31 Jul 2026 20:55:18 +0200 Subject: [PATCH] fix(rack): draw the desktop NAS plates like the boxes they are MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first cut put the drive bays in a squat block across the top half and left the name across the middle, which looked nothing like a UGREEN DXP or a Synology DS: their front is two to five tall tray doors filling the height, over a thin strip carrying the badge, the LED and the sockets. The name band was the blocker — it was nailed to mid-height for every plate, so anything tall wore its name across its own artwork. `labelBox.y` (default 0.5, so rack gear is untouched) now places the band, and the status LED rides it. The NAS plates put it at 0.86 with the trays above and the ports on the same strip. Bay corners also scaled badly: a flat 1.5px radius reads as a square hole once the cells are as large as a 3U tray, so the radius now follows the cell size. ha-relevant: yes --- frontend/src/rack/README.md | 2 +- .../src/rack/__tests__/Faceplate.test.tsx | 45 +++++++++++++++++++ .../src/rack/__tests__/faceplates.test.ts | 14 +++++- frontend/src/rack/components/Faceplate.tsx | 10 +++-- frontend/src/rack/faceplates.ts | 38 +++++++++------- frontend/src/types/rack.ts | 8 ++++ 6 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 frontend/src/rack/__tests__/Faceplate.test.tsx diff --git a/frontend/src/rack/README.md b/frontend/src/rack/README.md index 1ea8cc5..7ce29c3 100644 --- a/frontend/src/rack/README.md +++ b/frontend/src/rack/README.md @@ -20,7 +20,7 @@ Create one from **New Canvas → Kind → Rack**. | Faceplates | Declarative templates in `faceplates.ts`, drawn as SVG in unit coordinates so a plate scales with U height and rack width. Applying a template seeds ports; the user edits them afterwards. `suggestFaceplate()` picks one from the device's discovery type. Chosen from `FaceplatePicker` — a visual catalog, not a `