fix(client): inset mobile lobby name-plate from the well frame (#146) #158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/146-lobby-nameplate-margin"
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?
What this does
On the "Scanning the yard…" lobby screen the player's handle shows in an
INMATEname-plate. #120 sized that plate to the full play-well width in portrait (to stop it overflowing the well backdrop) — but that left it hugging the well frame edge-to-edge with zero horizontal margin. This insets the portrait plate by 24px each side so it floats inside the well with breathing room.Closes #146.
Scope correction (worth a read)
The issue body said "zero margin between text-content and frame edge" and the fix-direction proposed inner text-padding (8–12px). Probing at source first surfaced two things:
drawCheckin) and showed the 12-char-max text has ample margin there — which looked like the premise was refuted. But the actual#146target is the lobby name-plate (drawLobby, the#120screen), where the plate isboxW = YOU_WELL.w— the whole well width, genuinely zero-gap to the well frame. So the premise holds, on the lobby plate-vs-well-frame (not text-vs-plate).How
lobbyPlateWidth(portrait, wellW)→portrait ? wellW − 2·24 : 440. Landscape is unchanged (440; its wide canvas has no competing backdrop frame). One call-site swap indrawLobby; the plate stays centered (boxXalready derives fromboxW).Verification — render-capture (before/after)
Narrow 360px portrait viewport, max-length (12-char) handle:
/tmp/cap-146-lobby-before.png)./tmp/cap-146-lobby-after.png).That before/after is the mutation-closed-loop (before = unmodified
YOU_WELL.w; after = the inset). The 12-char monospace handle still has ample room inside the narrower plate.tsc --noEmitclean, full Playwright suite 79 passed.What this does NOT do
lobbyPlateWidth.render.tstouches browser-only APIs (new Image()) at module scope, so it isn't node-importable — same reason the siblingcheckinBoxRecthas no unit test. Canvas-layout invariants here are verified by render-capture per the UI mutation-verification discipline, not a.spec.drawCheckin) — its text already clears its frame; not the reported screen.🤖 Generated with Claude Code
✅ APPROVED — mobile lobby name-plate margins (#146)
Reviewed at head
5235bb0(on current maince68a32). Tiny, correct, and verified by capture.The fix
lobbyPlateWidth(portrait, wellW)insets the portrait plate tomax(0, wellW − 48)(24px each side, clamped + centered), landscape stays 440. It's the right polish on #120: #120 sized the plate to the full well width to stop the 440px overflow, which then left it hugging the well frame edge-to-edge on mobile; this gives it breathing room. TheMath.max(0, …)guards a pathologically-narrow well. Clean.Verified by capture (my own)
Drove the "Scanning the yard" lobby at 360px portrait — the INMATE plate now sits with a clear margin inside the well frame (vs the frame-hugging #120 state). The no-node-unit-pin justification is sound: render.ts isn't node-importable (
new Image()at module scope, same constraint as checkinBoxRect), so a unit pin would be placebo — verify-by-capture is the honest call, exactly per the fake-test-anti-pattern. tsc clean.One thing I surfaced (non-blocking, NOT caused by this PR)
Running the full suite twice (flake-detection), I hit an intermittent flake: run 1 came back 78 passed + 1 flaky-retry on
nav.spec.ts:126 — "checkin × Backspace → noop at screen level"; run 2 was a clean 79 passed. It's unrelated to #146 (this PR is render-only and doesn't touch checkin), and it recovers on retry so CI greens — but worth noting it flaked despite already polling (the TABLE-loop's poll is meant to absorb exactly the cold-run jitter the comment describes). So the poll-is-deterministic guarantee has an occasional edge on that row. Suggest a quick look / tracker — possibly thetoCheckinarrange racing the DOM-input focus, or a marginal poll timeout. Flagging since I saw it; doesn't gate this merge.79/79 (clean run), tsc clean. Closes #146. Merge-ready → Bosun.