Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

Tapping the presence line opens a list of who is here, the driver highlighted and guests with a colour dot; Escape or an outside tap closes it #429

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

Tapping the presence line now opens a list of who is here, and Escape or a tap outside it closes it. The type check didn't run, and bun test ended with one failure that has nothing to do with this change. I haven't opened the page in a browser, so the layout is unchecked.

Notes

shipped merged

opened this

Tapping the presence line now opens a list of who is here, and Escape or a tap outside it closes it. The type check didn't run, and bun test ended with one failure that has nothing to do with this change. I haven't opened the page in a browser, so the layout is unchecked.

  • Presence line: #presenceLine in src/viewer.html is now a <button>, at least 44 px tall. Tapping it sends {type:'who'}, and the list is drawn when the server answers.
  • Rendering: the new pure helper whoList in src/ui/lobby-panel.js builds the list. Names go in as text. The driver's row is bold with a lighter background. A guest gets a dot only if its colour matches #rrggbb.
  • Placement: the list is absolutely positioned under the strip, so it shouldn't move the camera box. The 44 px button does make the presence row taller than the old text line. Check that on the preview.
  • Tests: lobby-panel.test.ts covers the driver highlight, a guest's dot, and a bad colour getting none.
  • Check results: the full run was 657 pass and 1 fail.

- Failing test: server.test.ts:545 expects the vendored three.js file to be served, and gets a 404. - Why I think it's unrelated: bun install can't write to its temp directory here, so node_modules is missing. I didn't confirm this against main. - Type check: tsc --noEmit couldn't run for the same reason, so the forge's check is the first real type check.

  • Not run here: the first-visit gzip budget test (I didn't look for where it lives). forge.json is untouched.

🤖 Generated with Claude Code

Closes #398

2 earlier comments · 2 events
commented

Tapping the presence line now opens a list of who is here, and Escape or a tap outside it closes it. The type check didn't run, and bun test ended with one failure that has nothing to do with this change. I haven't opened the page in a browser, so the layout is unchecked.

  • Presence line: #presenceLine in src/viewer.html is now a <button>, at least 44 px tall. Tapping it sends {type:'who'}, and the list is drawn when the server answers.
  • Rendering: the new pure helper whoList in src/ui/lobby-panel.js builds the list. Names go in as text. The driver's row is bold with a lighter background. A guest gets a dot only if its colour matches #rrggbb.
  • Placement: the list is absolutely positioned under the strip, so it shouldn't move the camera box. The 44 px button does make the presence row taller than the old text line. Check that on the preview.
  • Tests: lobby-panel.test.ts covers the driver highlight, a guest's dot, and a bad colour getting none.
  • Check results: the full run was 657 pass and 1 fail.

- Failing test: server.test.ts:545 expects the vendored three.js file to be served, and gets a 404. - Why I think it's unrelated: bun install can't write to its temp directory here, so node_modules is missing. I didn't confirm this against main. - Type check: tsc --noEmit couldn't run for the same reason, so the forge's check is the first real type check.

  • Not run here: the first-visit gzip budget test (I didn't look for where it lives). forge.json is untouched.

🤖 Generated with Claude Code

Changes requested — before the latest push

The who list renders safely (names as text, colour validated) and the server already answers {type:'who'}. Three things block it. First: only whoList is tested; the behaviour the issue is about (tap opens, second tap closes, Escape closes and refocuses, outside pointerdown closes, a tap inside the box does not close) has no test and would pass if the handlers were deleted. createRoom is already testable in this file, so add those cases. Second: a person who taps the presence line twice within 1 s gets no reply (lobby.ts drops it silently), so whoAsked stays true, aria-expanded says true and nothing is open until another tap; also a dropped socket leaves it stuck. Reset whoAsked and aria-expanded on close/reconnect or when no answer arrives, and re-ask on the next tap. Third: the README does not mention the list; add a line on how to open it. Also verify on a 360px phone: the presence row grew to 44px min-height and ui/mobile.css may stack it; the pull says the layout was never opened. The box needs role/labelling for screen readers (aria-haspopup='true' promises a menu; use a labelled region or aria-controls on the box and drop haspopup). The terminal already has a who command, so the both-doors rule is met.

commented

The presence line now opens a who list with its interaction tested. A stuck "asked" state is fixed, the box has proper labelling, and the README has a line on it. src/ui tests pass (149), but tsc still can't run in this sandbox, so the forge's check is the first type check. I haven't opened the page at 360 px or anywhere else.

  • Interaction tests: lobby-panel.test.ts now drives createRoom with a real listener table.

- A tap sends who, and the answer opens the box. - A second tap closes it. - Escape closes it and refocuses the button. - A tap outside closes it, while a tap inside the box or on the button does not. - An answer nobody asked for opens nothing.

  • Stuck state:

- A tap with no box open now always asks again, so a reply dropped by the 1 s throttle can't leave the button stuck. - aria-expanded is true only while the box is open. - A closed socket closes the box and clears the asked state; a test covers this.

  • Accessibility:

- The box is #whoBox, a region labelled "Who is here". - The button has aria-controls="whoBox", and aria-haspopup is gone. - Focus moves to the box when it opens.

  • Layout:

- The button is a 44 px tap target on a 16 px row, using height: 44px; margin: -14px 0; line-height: 44px, so it should not grow the strip. - mobile.css has no rule for the presence row; its only strip rule is #strip { position: relative }. - The negative margin does let the tap area overlap the lines above and below it. Those lines aren't interactive, but check the preview at 360 px.

  • README: one paragraph in Software/README.md says how to open and close the list, and notes that the terminal's who command gives the same list.

🤖 Generated with Claude Code

Changes requested — before the latest push

The list itself works and is well tested: the server already answers who (lobby.ts:418, throttled), names are set as text, the colour is validated, Escape and an outside tap close it, and the README line is there. I found one thing to fix before it lands. The served HTML has <button id="presenceLine" ...></button> with no text and no accessible name. It is a focusable, empty button from first paint until the first presence frame arrives, and for good with JavaScript off or the socket down. A screen reader announces "button" and nothing else, and a keyboard user tabs onto an invisible control that does nothing.

Fix first: give the button a name that does not depend on the socket, e.g. aria-label="Who is here" in viewer.html, or put the presence text in it as a label. Then, if the text is empty, hide it with #presenceLine:empty{pointer-events:none} and disabled, so nothing dead can be reached. Also add a :focus-visible outline to the button, since background:none; border:0 is easy to leave without one. The aria-controls="whoBox" points at an id that does not exist while the box is closed. That is harmless, but you could set it only when open.

Next, after that: (1) check the margin:-14px 0 overlap at 360px on the preview, because the 44px tap area sits over the clock and cap lines; (2) the tests would be stronger with one that asserts the button has a name.

commented

The presence button now has an accessible name from first paint and can't be reached while it does nothing. src/ui tests pass, but the full src/server.test.ts run still fails at line 545, the vendored-three 404 from earlier. tsc can't run here.

  • Name: viewer.html now has aria-label="Who is here" on the button, so the name no longer depends on the socket.
  • Disabled state: the button starts disabled. The first valid presence frame enables it, and a closed socket disables it again.
  • Disabled styling: #presenceLine:disabled has pointer-events: none and the default cursor.
  • Focus ring: I added a :focus-visible outline.
  • aria-controls: it is set to whoBox only while the box is open and removed on close.
  • Tests:

- One test reads the served HTML and asserts the button has the label, starts disabled, and has no aria-haspopup. - Another checks aria-controls comes and goes with the box. - A third checks the button is disabled after the socket closes.

  • 360 px overlap: the margin: -14px 0 overlap is unchanged and I haven't looked at it on the preview. The overlapped clock and cap lines aren't interactive.

🤖 Generated with Claude Code

Approved

Works as the issue asks. The preview serves the button with a name from first paint, disabled until a presence frame. The server already answers who (lobby.ts, throttled, no ids) and the terminal has who, so both doors are covered and the README says so. Names go in as text, colours are validated as #rrggbb, and the tests drive open, close, Escape, outside tap and a lost answer. Two things I would do next: (1) aria-label="Who is here" hides the counts ("12 here · 4 signed in") from screen readers; put the counts in the accessible name or use aria-describedby. (2) With JavaScript off the button stays disabled and empty; give it a server-rendered fallback text. Also check the -14px overlap at 360 px on a real phone.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs