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 #117

Parked opened this
Closed without merging

The room code (join form, queue, chat and the /live socket) now lives in src/ui/lobby-panel.js. viewer.html creates it with createLobbyPanel({...}) and gets back lobby, mayDrive, isOwner, say, chatBox and connect. The panel is served from /ui/VERSION/ like the other modules and has a modulepreload link.

Notes

stopped parked by the crew deploy dd221a2

opened this

The room code (join form, queue, chat and the /live socket) now lives in src/ui/lobby-panel.js. viewer.html creates it with createLobbyPanel({...}) and gets back lobby, mayDrive, isOwner, say, chatBox and connect. The panel is served from /ui/__VERSION__/ like the other modules and has a modulepreload link.

Locally bun test src gives 395 passes and 1 failure. The failure is the vendored-libraries route test, which also fails on main because this sandbox has no node_modules. I couldn't run tsc here (bun install and tsc fail with a read-only tempdir error), so the forge's check is the first type check of the new module and test.

  • Moved as-is: the code moved line for line, including the words filter, admin settings form, owner moderation, crew-moderator view, "you're next" alert and the turn clock/ring.
  • Stayed in the page: explainLock and applyLock, because they touch the viewer, driver and teleop. The panel calls applyLock through a callback.
  • Small changes: minutes, ordinal and waitMinutes (the repeated "round up to at least a minute" sum) are now top-level exports. The queue row is built by a pure queueRow(x, me) that returns plain strings, and the page still sets them with textContent.
  • New test: src/ui/lobby-panel.test.ts covers those helpers, including a name like <img onerror=…> coming through as plain text.
  • // @ts-nocheck on the new module: the script was never type-checked inside the HTML, and checkJs is strict. Say if you'd rather I add types.

Test changed: I raised the first-visit budget in server.test.ts from 50 KB to 52 KB gzipped. The code is the same size, but as its own gzip stream it costs about 1.6 KB more than inline (the page was already at about 49.5 KB). The alternative is loading the panel lazily, which means a real change to when the room code arrives, so I left that to you.

🤖 Generated with Claude Code

Closes #95

commented

The room code (join form, queue, chat and the /live socket) now lives in src/ui/lobby-panel.js. viewer.html creates it with createLobbyPanel({...}) and gets back lobby, mayDrive, isOwner, say, chatBox and connect. The panel is served from /ui/__VERSION__/ like the other modules and has a modulepreload link.

Locally bun test src gives 395 passes and 1 failure. The failure is the vendored-libraries route test, which also fails on main because this sandbox has no node_modules. I couldn't run tsc here (bun install and tsc fail with a read-only tempdir error), so the forge's check is the first type check of the new module and test.

  • Moved as-is: the code moved line for line, including the words filter, admin settings form, owner moderation, crew-moderator view, "you're next" alert and the turn clock/ring.
  • Stayed in the page: explainLock and applyLock, because they touch the viewer, driver and teleop. The panel calls applyLock through a callback.
  • Small changes: minutes, ordinal and waitMinutes (the repeated "round up to at least a minute" sum) are now top-level exports. The queue row is built by a pure queueRow(x, me) that returns plain strings, and the page still sets them with textContent.
  • New test: src/ui/lobby-panel.test.ts covers those helpers, including a name like <img onerror=…> coming through as plain text.
  • // @ts-nocheck on the new module: the script was never type-checked inside the HTML, and checkJs is strict. Say if you'd rather I add types.

Test changed: I raised the first-visit budget in server.test.ts from 50 KB to 52 KB gzipped. The code is the same size, but as its own gzip stream it costs about 1.6 KB more than inline (the page was already at about 49.5 KB). The alternative is loading the panel lazily, which means a real change to when the room code arrives, so I left that to you.

🤖 Generated with Claude Code

commented

Parked by the crew: the preview's deploy failed in the place it ran, not in the change, and it could not be run again

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs