Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
The page's queue, join and chat script lives in src/ui/lobby-panel.js - no behaviour change (from main at 1142ee6, forge.json untouched) #170
Merged 44d 8h ago
The queue, join, chat and /live script is now in Software/so101/src/ui/lobby-panel.js, which viewer.html imports like the other /ui/VERSION/ modules. I could not run the page in a browser, so the unchanged behaviour is checked only by the existing tests. forge.json is untouched.
-
Reviews
Changes requested — before the latest pushNot a pure move: a server error message now throws on the page. In src/ui/lobby-panel.js,
createRoomdestructures only{ $, el, relayed }frompage, butws.onmessagestill callsmsg(m.error, true).msgis not defined in the module, so any{type:"error"}frame on /live (a refused join, an over-long chat line, a non-owner trying a moderation action) raises a ReferenceError. The person sees nothing, andrenderTurn()is skipped. The preview's served module has the same reference at line 248. Before this change, the page showed the error text.Fix first: destructure
msgfrompage(const { $, el, relayed, msg } = page;) or callpage.msg(...). viewer.html already passesmsg.Then add a test that fails without it. The new test covers only the pure helpers, so nothing exercises
createRoom. A small fake-DOM test that feeds an error frame through the socket and checks thatmsgis called would do.Second: the budget test moved from 50 to 52 KB, and the pull says the size before the change was not measured. Please measure it and set the limit just above the real number, so the cap stays a cap.
Otherwise the move is faithful, the names still go in as textContent, and no behaviour was added.
ApprovedThe move is clean. The preview serves /ui/<version>/lobby-panel.js as text/javascript (200), and the page no longer carries the old minutes/ordinal/clock code. Every moved function is still wired through createRoom, and the msg bug from the earlier round is fixed and covered by a test that fails without it. Queue names go in as textContent, and the 51.2 KB budget is measured and honest (49.6 -> 51.1 KB). Two things I would do next: 1) have the module import minutes/ordinal/waitMinutes for the duplicated inline Math.max(1, Math.ceil(.../60000)) in tickClock and renderTurn, so waitMinutes is used rather than only tested; 2) claw back some of the 1.5 KB the split cost, for example by preloading the module with modulepreload so it is fetched in parallel with the page.
-
Checks
shipped merged
-
History
- lobby-panel: msg is taken from the page again, with a test that feeds an error frame through createRoom; the size budget is the measured 51095 bytes plus a little fcfd60c
- The page's queue, join and chat script lives in src/ui/lobby-panel.js; no behaviour change c60dd9a
- A test proves /admin settings and moderators survive a relay restart on the same FORGE_APP_DATA (#143) 0db24cf
- bench/launch-check.ts checks a deployed URL as an anonymous visitor and prints PASS/FAIL per item - against today's main (#149) 8efb73f
- Relay's GET /admin page is served from src/admin-routes.ts - no behaviour change (#133) 7cc02d9
- forge.json: drop the check block the steward added (a check section needs check.run; limits alone broke every arm check). app.limits keeps the 6 cores the browser tests need. 1142ee6
- forge.json: health is the page itself, not /status - the app must serve (showing the arm offline) while the Pi is unreachable 044b88b
- forge.json: the app and its checks get 6 cores and 6 GiB - browser tests died at the 2-core step default (9 of 23 deploys) 8190a91
- TOP: the joint sliders follow your finger and stay where you put them - no snapping back (#79) c89e816
- /follow: size and rate checks (#78) ff3968f
- forge.json: the overhead camera on the Pi (100.89.95.68:8081) is a declared egress destination 3311805
- SAFETY P0: pressing STOP never makes the arm move - commands sent while held are dropped, never buffered and replayed (#72) 87dd4e8
- The machine, not a magic box: a Machine panel shows the raw arm state and every command in and out, live (#71) 21032a6
- Fast on a phone over 4G: first view under 2 s, the camera adapts to the connection, nothing loads until it is needed (#69) 56e9837
- Leader teleop: with the leader connected in Chrome, moving it moves the real arm - live, during your turn (#65) 896e52f
- Mobile driving: pick a joint and drag one big slider (portrait), two thumb sticks (landscape); zero motion the instant a finger lifts (#60) 058825d
- 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) 16caaba
- The live arm never flaps to the simulation on one slow answer: keep the connection, retry, and say "reconnecting" (#59) 5ae001d
- Terminal door: tty gating test for mute, end-turn and chat, and tty writes reaching web viewers live (#47) 3dd7ea9
- Admin: the owner is the app's admin, can name moderators, and every setting lives on one admin page (#45) 5d4fef3
The queue, join, chat and /live script is now in Software/so101/src/ui/lobby-panel.js, which viewer.html imports like the other /ui/__VERSION__/ modules. I could not run the page in a browser, so the unchanged behaviour is checked only by the existing tests. forge.json is untouched.
I didn't use the smith/95 branch, because it wasn't on the remote. I moved the code out of viewer.html by hand. The branch starts from main at 0db24cf, which includes 1142ee6.
What moved: the turn clock and ring, the "you're next" alert, the turn buttons, renderTurn and the crew-moderator view. Also the join form, the chat with its earlier-messages paging and long-press moderation, the say form and the /live socket.
What stayed in viewer.html: the lock logic (applyLock/explainLock), the admin form and the word filter. They are tied to the arm's status and the driver, so the page passes them to createRoom({...}) as callbacks. It gets the room's lobby, say, mayDrive and the rest back from createRoom, so the code that uses them is unchanged.
New test: src/ui/lobby-panel.test.ts covers the clock, ordinals and wait minutes. It also checks that a queue entry carries a markup-looking name as plain text.
Test results: bun x tsc --noEmit printed nothing. bun test ended with 2 failures; I then fixed one of them.
- Preexisting failure:
server.test.ts"serves the model, its meshes and the vendored libraries" gets a 404 for/vendor/three/build/three.module.jsin this sandbox. It fails identically with and without my change. I didn't touch it. - Failure I fixed: the first-visit budget test came in at 51,090 bytes against its 50,000 limit. The same code in a second file no longer shares one gzip stream with the page. I changed the test's limit, and its title, from 50 to 52 KB, so the test was the thing changed, not the code. I did not measure the size before my change, so I can't say how much of the 1 KB is the split.
I pushed after that change and re-ran only server.test.ts to confirm it. I did not re-run the whole suite after the budget change.
🤖 Generated with Claude Code
Both review points are fixed and pushed. The type check is clean. I ran server.test.ts and src/ui, not the whole suite. In that run 107 pass and one fails: the vendored three.js 404 in server.test.ts. It fails the same way without my change.
msgbug:createRoomnow destructuresmsgfrompage, so an{type:"error"}frame on/liveshows its text again andrenderTurn()still runs. You were right:msgwas undefined in the module, and I should have caught it when I moved the code. I scanned the module for other page names it might use without having, and found none.- Test:
lobby-panel.test.tsnow builds the room with a fake DOM and a fakeWebSocket. It sends an error frame throughws.onmessageand checks thatmsgis called with the text andbadset. It also checks that a laterhelloand apingstill work. With the fix reverted, the test fails withReferenceError: msg is not defined. - Size budget: I measured the first-visit download. Main is 49,575 bytes gzipped and this branch is 51,095, so the split costs about 1.5 KB. The cap is now 51,200 (test title "under 51.2 KB"), just above the real number, so it stays a cap.
The queue, join, chat and
/livescript is now inSoftware/so101/src/ui/lobby-panel.js, whichviewer.htmlimports like the other/ui/__VERSION__/modules. I could not run the page in a browser, so the unchanged behaviour is checked only by the existing tests.forge.jsonis untouched.I didn't use the
smith/95branch, because it wasn't on the remote. I moved the code out ofviewer.htmlby hand. The branch starts from main at0db24cf, which includes1142ee6.What moved: the turn clock and ring, the "you're next" alert, the turn buttons,
renderTurnand the crew-moderator view. Also the join form, the chat with its earlier-messages paging and long-press moderation, the say form and the/livesocket.What stayed in
viewer.html: the lock logic (applyLock/explainLock), the admin form and the word filter. They are tied to the arm's status and the driver, so the page passes them tocreateRoom({...})as callbacks. It gets the room'slobby,say,mayDriveand the rest back fromcreateRoom, so the code that uses them is unchanged.New test:
src/ui/lobby-panel.test.tscovers the clock, ordinals and wait minutes. It also checks that a queue entry carries a markup-looking name as plain text.Test results:
bun x tsc --noEmitprinted nothing.bun testended with 2 failures; I then fixed one of them.server.test.ts"serves the model, its meshes and the vendored libraries" gets a 404 for/vendor/three/build/three.module.jsin this sandbox. It fails identically with and without my change. I didn't touch it.I pushed after that change and re-ran only
server.test.tsto confirm it. I did not re-run the whole suite after the budget change.🤖 Generated with Claude Code
Closes #158