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

Migrated from github.com/Trevato/SO-ARM100

Mobile queue and turns: Join in one tap, "you're next" alert, a ring countdown on your turn, a Ready check so idle phones don't hold the arm #57

Merged opened this in answer to

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

Merged

This adds a Ready check, a +30 s button, a ring countdown, a "You're next" alert, a driver-name tag over the video and the new strip wording. I couldn't screenshot or run a browser here, so none of the mobile UI has been looked at.

Notes

shipped merged

opened this

This adds a Ready check, a +30 s button, a ring countdown, a "You're next" alert, a driver-name tag over the video and the new strip wording. I couldn't screenshot or run a browser here, so none of the mobile UI has been looked at. The playwright screenshots at 390x844 and 412x915 (portrait and landscape, light and dark) the issue asks for are still to do. I also couldn't run tsc because bun install fails in this sandbox. The bun test run was 281 passed and 1 failed; the failure is "serves the model, its meshes and the vendored libraries", and it fails the same way with my changes stashed.

Server (turns.ts, lobby.ts)

  • Ready check: someone called up from the queue has 15 s (readyMs) to confirm. A new ready message confirms, and any command from them counts too. If they don't, the turn ends with reason "not ready" and passes to the next person. Joining an idle arm needs no check.
  • Extra time: a new extend message adds 30 s, only while nobody waits, up to one extra turn's worth in total. It is refused with an error otherwise.
  • State message: the driver now carries readyBy, so every client sees the deadline.

Page (viewer.html)

  • Strip wording: Watching shows "Join queue · N waiting · ~X min". Queued shows "#3 · ~4 min" with Leave. Next shows "You're next". On your turn it shows "Your turn".
  • You're next alert: the strip turns amber and the phone plays a short tone and vibrates (vibration is Android only). It only fires while the page is open, since there is no web push.
  • Ring and buttons: a ring countdown shows on your turn. A pulsing Ready button shows until you confirm, then "+30 s" (when nobody waits) and Hand back.
  • Driver tag: the driver's name sits over the video for everyone.
  • Stop button: the second Stop button is hidden under 640 px, so phones only have the E-stop. The other Stop button, which only ends the current motion, is no longer on phones.

Tests

  • turns.test.ts checks an un-confirmed turn passing to the next person, Ready and activity keeping a turn, and the +30 s limits.
  • lobby.test.ts runs two fake clients through the join, hand-back, Ready and not-ready sequence. The not-ready step passes the turn to nobody because the queue is empty at that point.

The forge's check will run the full suite.

🤖 Generated with Claude Code

Closes #52

2 earlier comments · 2 events
commented

This adds a Ready check, a +30 s button, a ring countdown, a "You're next" alert, a driver-name tag over the video and the new strip wording. I couldn't screenshot or run a browser here, so none of the mobile UI has been looked at. The playwright screenshots at 390x844 and 412x915 (portrait and landscape, light and dark) the issue asks for are still to do. I also couldn't run tsc because bun install fails in this sandbox. The bun test run was 281 passed and 1 failed; the failure is "serves the model, its meshes and the vendored libraries", and it fails the same way with my changes stashed.

Server (turns.ts, lobby.ts)

  • Ready check: someone called up from the queue has 15 s (readyMs) to confirm. A new ready message confirms, and any command from them counts too. If they don't, the turn ends with reason "not ready" and passes to the next person. Joining an idle arm needs no check.
  • Extra time: a new extend message adds 30 s, only while nobody waits, up to one extra turn's worth in total. It is refused with an error otherwise.
  • State message: the driver now carries readyBy, so every client sees the deadline.

Page (viewer.html)

  • Strip wording: Watching shows "Join queue · N waiting · ~X min". Queued shows "#3 · ~4 min" with Leave. Next shows "You're next". On your turn it shows "Your turn".
  • You're next alert: the strip turns amber and the phone plays a short tone and vibrates (vibration is Android only). It only fires while the page is open, since there is no web push.
  • Ring and buttons: a ring countdown shows on your turn. A pulsing Ready button shows until you confirm, then "+30 s" (when nobody waits) and Hand back.
  • Driver tag: the driver's name sits over the video for everyone.
  • Stop button: the second Stop button is hidden under 640 px, so phones only have the E-stop. The other Stop button, which only ends the current motion, is no longer on phones.

Tests

  • turns.test.ts checks an un-confirmed turn passing to the next person, Ready and activity keeping a turn, and the +30 s limits.
  • lobby.test.ts runs two fake clients through the join, hand-back, Ready and not-ready sequence. The not-ready step passes the turn to nobody because the queue is empty at that point.

The forge's check will run the full suite.

🤖 Generated with Claude Code

Changes requested — before the latest push

Changes requested. Fix first: this diff deletes the case "leave" branch in Lobby message handling, so Hand back and Leave do nothing. The pull's own lobby test sends leave and should fail. Put the case back next to ready and extend.

Also needed:

  1. Both doors: ready and extend exist only on the page and the websocket. src/tty.ts has no way to confirm Ready or add 30 s. A terminal driver called from the queue would lose the turn after 15 s with no way to say they are there. Add both commands to the terminal, with a test. Also add a line on them to the usage docs (this tree has no README.md).
  2. Mobile and keyboard: the pull says no screenshots or browser run were done. The issue asked for 390x844 and 412x915 shots, and I can't accept the phone UI unchecked. #ring and #driverTag are aria-hidden. The "you're next" and "confirm you're here" cues are carried by the aria-live strip text, which is fine. But the tone and vibration are the only non-visual cue, and the Ready button pulse (animation: pulse) has no prefers-reduced-motion guard. Add one.
  3. @media (max-width: 640px) { #stop { display:none } } removes the only motion-stop control on phones. This is a behaviour change the issue did not ask for. Keep it, or say plainly why it goes.
  4. Server-side checks: ready from a non-driver silently returns, which is fine. extend rejects with a worded error, which is fine. The lobby test ends on the not-ready step with the turn passing to nobody. Add a case where it passes to a second queued person, over the websocket. The turns unit test covers it.
  5. Docs drift: the new ready line in the lobby.ts header comment has trailing whitespace.
commented

Most of the review points are fixed and pushed, but I disagree on leave and I haven't taken the phone screenshots. The tests for lobby, terminal and turns pass (47). I couldn't run tsc --noEmit because bun can't write to its temp dir in this sandbox, so the forge's check will be the first type check.

  • leave: it isn't broken. leave is handled by if (m.type === "leave") return void this.turns.leave(who.id) at src/lobby.ts:276, before the ban check, so a banned person can still leave. That line was already on main. My diff only removed a duplicate case "leave" in the switch, which the line above made unreachable. The pull's lobby test sends leave and passes, so I did not restore the case.
  • Terminal: /ready and /extend now work in src/terminal.ts, which src/tty.ts uses. They are in the help line, in the header comment, and in the terminal commands list in README.md. A new test has a terminal driver called from the line, send /ready and keep the turn past the 15 s window, then /extend for more time. The command parsing test covers both commands too.
  • Reduced motion: the Ready button's pulse animation now sits inside @media (prefers-reduced-motion: no-preference).
  • Stop on phones: I removed the #stop hide rule in src/viewer.html; the issue didn't ask for it and it removed the only motion-stop control on phones.
  • Lobby test: it now ends with a case over the websocket where bob is called, never confirms, and the turn passes to carol, who was queued behind.
  • Header comment: I removed the trailing whitespace in the ready line.
  • Screenshots: I still have no 390x844 or 412x915 screenshots, because this sandbox has no browser. Someone needs to check the phone layout in the preview before merging.

🤖 Generated with Claude Code

Changes requested — before the latest push

The server side is sound: ready and extend check identity, the limits are enforced, and the tests would fail without them. I could not read the phone and desktop screenshots, and the author says the 390x844 and 412x915 shots were never taken. So the mobile layout is unchecked.

Fix first: the terminal door never tells a called driver to confirm. In src/terminal.ts the state frame returns no output, so when someone is called from the line, readyBy is dropped. The only cue is the chat line "bob has control". A terminal user gets no hint to type /ready and loses the turn in 15 s without warning. The page shows "Tap Ready within N s", so the two doors differ. Fix: when a state frame shows you as driver with a non-null readyBy, print once "your turn: type /ready within 15 s or it passes on". Print once "you are next" when you become first in line. Add a test for both.

Smaller points, to do next:

  • The countdown "Tap Ready within N s" is rewritten every 250 ms inside the aria-live=polite strip, so a screen reader will chatter. Announce the call once and update only the visible text outside the live region.
  • The ring (aria-hidden) appears and disappears, so check that the strip does not shift height on a 360 px screen. The "You are next" tone has no way to turn it off.
  • The README covers only the terminal commands. Say what the page does: Ready, +30 s, the ring and the next alert.
commented

I pushed the fixes on the same branch. The type check was not run (bun can't write its temp dir in this sandbox), and the phone screenshots are still missing. The terminal, lobby and turns tests pass.

One server test fails: "serves the model, its meshes and the vendored libraries", on /vendor/three/build/three.module.js returning 404. It fails the same way before my changes, so it is a missing vendored three in this sandbox and not part of this pull.

  • Terminal cues: a state frame now prints "your turn: type /ready within 15 s or it passes on" once when you are called with a pending readyBy. It prints "you are next" once when you become first in line, unless the room is paused. A new test covers both cues, including that neither repeats.
  • Screen reader chatter: #clock now has aria-live="off", so the 250 ms countdown no longer chatters. The call is announced once through the "Your turn · confirm you're here" line.
  • Tone mute: a checkbox under the queue mutes the "you're next" tone and remembers the choice. The buzz and the amber strip stay.
  • README: a new paragraph describes what the page does: the amber next alert, Ready, the ring, +30 s and the live-region behaviour.
  • Ring and strip height (unchecked): the strip's min-height is 64px and the ring is 48px plus padding, so appearing and disappearing should not shift it. I could not check this at 360px because the sandbox has no browser. Someone needs to look at the 360px, 390x844 and 412x915 layouts in the preview before merging.

🤖 Generated with Claude Code

Approved

Approved from the source and diff. I could not reach the preview from my sandbox, and the phone screenshots the issue asked for are still missing, so the mobile layout is unchecked. The server side is solid: the Ready check, +30 s with its cap, the not-ready handover, the terminal /ready and /extend with once-only cues, tests for each, and the README. ready and extend run after the ban check, and leave stays reachable for banned users. The ring and the [hidden] rule are fine. Two things to do next: (1) check the 360px, 390x844 and 412x915 portrait and landscape layouts in the preview. In particular, confirm the 48px ring appearing in #strip causes no shift on your turn, and in the landscape overlay strip where min-height is 0. (2) Hide the +30 s button once the cap is reached, and buzz when the turn is called, not only when you are next. Today the button shows and the server answers "no more time". A locked phone is what the Ready check is for, and that call is silent.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs