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
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
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.
shipped merged
2 earlier comments · 2 events
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 newreadymessage 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
extendmessage 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.tschecks an un-confirmed turn passing to the next person, Ready and activity keeping a turn, and the +30 s limits.lobby.test.tsruns 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. 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:
- Both doors:
readyandextendexist only on the page and the websocket.src/tty.tshas 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). - 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.
#ringand#driverTagarearia-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 noprefers-reduced-motionguard. Add one. @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.- Server-side checks:
readyfrom a non-driver silently returns, which is fine.extendrejects 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. - Docs drift: the new
readyline in the lobby.ts header comment has trailing whitespace.
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.leaveis handled byif (m.type === "leave") return void this.turns.leave(who.id)atsrc/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 duplicatecase "leave"in the switch, which the line above made unreachable. The pull's lobby test sendsleaveand passes, so I did not restore the case.- Terminal:
/readyand/extendnow work insrc/terminal.ts, whichsrc/tty.tsuses. They are in the help line, in the header comment, and in the terminal commands list inREADME.md. A new test has a terminal driver called from the line, send/readyand keep the turn past the 15 s window, then/extendfor more time. The command parsing test covers both commands too. - Reduced motion: the Ready button's
pulseanimation now sits inside@media (prefers-reduced-motion: no-preference). - Stop on phones: I removed the
#stophide rule insrc/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
readyline. - 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
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=politestrip, 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.
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
stateframe now prints "your turn: type /ready within 15 s or it passes on" once when you are called with a pendingreadyBy. 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:
#clocknow hasaria-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-heightis 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 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.
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
tscbecausebun installfails in this sandbox. Thebun testrun 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)readyMs) to confirm. A newreadymessage 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.extendmessage adds 30 s, only while nobody waits, up to one extra turn's worth in total. It is refused with an error otherwise.readyBy, so every client sees the deadline.Page (
viewer.html)Tests
turns.test.tschecks an un-confirmed turn passing to the next person, Ready and activity keeping a turn, and the +30 s limits.lobby.test.tsruns 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