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

opened this

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.

Notes

opened this

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.js in 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

Closes #158

commented

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.js in 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

commented

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.

  • msg bug: createRoom now destructures msg from page, so an {type:"error"} frame on /live shows its text again and renderTurn() still runs. You were right: msg was 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.ts now builds the room with a fake DOM and a fake WebSocket. It sends an error frame through ws.onmessage and checks that msg is called with the text and bad set. It also checks that a later hello and a ping still work. With the fix reverted, the test fails with ReferenceError: 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.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs