Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Phone portrait: a bottom tab bar Drive / Queue / Chat (/ Mod for admins) shows one panel at a time (from main at 1142ee6, forge.json untouched) #177
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
Phone portrait (≤640 px wide) now has a bottom tab bar: Drive, Queue and Chat, plus Mod for the room owner. I could not render the page here. The layout rules are untested in a browser, so check it on the preview at 390x844 and 412x915.
shipped merged
3 earlier comments · 1 event
Phone portrait (≤640 px wide) now has a bottom tab bar: Drive, Queue and Chat, plus Mod for the room owner. I could not render the page here. The layout rules are untested in a browser, so check it on the preview at 390x844 and 412x915.
Tests: bun test on server.test.ts, src/ui and stop-layout.test.ts gives 117 passing and 1 failing. tsc couldn't run (bun can't write to its temp dir in this sandbox). The failing test is the vendored three.js route in server.test.ts (404). It also fails with my changes stashed, because node_modules/three isn't in this checkout.
What changed
- The bar: 56 px plus the bottom safe-area inset, with 56 px targets.
- Forge pill: the bar's right padding keeps the pill off the last tab.
- Hidden elsewhere: it is hidden on desktop and in landscape, where the old sheet tabs apply. STOP stays in the status strip, in no tab.
- Panels: Drive shows the view, plus the controls on your turn. Queue, Chat and Mod show the sheet alone. Panels switch through the existing
showTab. - Hash: the tab lives in
location.hash. An unknown hash, or#modfor a non-owner, falls back to Drive. - Files: the logic is
src/ui/tabs.js, the stylessrc/ui/tabs.css, and the testssrc/ui/tabs.test.ts. The Drive/Queue/Chat/Mod to sheet-tab mapping and the glue are insrc/viewer.html. - Server: it now serves
.cssfromsrc/uiastext/css, same versioned URL and immutable caching as.js, with a test.
Things to look at
- Branch 113 wasn't on the forge, so I rebuilt this on current main.
forge.jsonis untouched. - Mod appears for the owner only, because the code has no separate moderator role. The crew moderator is a bot, not a person with the role.
- The Machine tab isn't reachable from the phone-portrait bar. It is still in the sheet tabs elsewhere.
- Your turn starting switches to Drive. When it ends, a viewer on Drive moves to Chat.
- The first-visit size test (under 50 KB gzipped) was over by about 200 bytes. I trimmed comments and glue to fit rather than change the limit.
🤖 Generated with Claude Code
The branch now merges with main and I've pushed it. The one conflict was in viewer.html, where my tabs.js import sat next to main's new lobby-panel.js import. I kept both.
Tests: I ran server.test.ts and src/ui after the change, not the whole suite, and the whole suite after the merge but before the size fix. In the server.test.ts and src/ui run, 119 tests pass and 1 fails. The failure is the vendored three.js route (404), the same test that failed before my changes, because node_modules/three isn't in this checkout. tsc did not run (bun can't write to its temp dir in this sandbox).
Size budget: after the merge the first-visit gzip test was over main's 51.2 KB limit, at 51,516 bytes. I stopped importing tabs.js up front. The page now fetches it only on a phone in portrait, which is the only place the bar shows, so desktop and landscape visits no longer download it. The test passes with the limit unchanged.
I haven't tested the lazy load in a browser. The bar's buttons and panel switching now wait for that fetch on first load.
Tests and the server change for .css are fine, and the preview serves tabs.css and an empty #dock. Three things make phone portrait worse than before, so I'm requesting changes. Fix first: the Machine tab. The phone-portrait CSS hides #tabs (display:none) and the dock has no Machine entry, so everything Machine shows is unreachable on the phone, where it was reachable before. Add Machine to the dock (or keep it in the sheet) for the viewers who had it; this is a regression, not new scope. Second: the dock is filled only after a dynamic import of tabs.js, but #tabs is already hidden by CSS, so until that fetch finishes (or if it fails) a phone user has no navigation at all, and the dock row is reserved empty. Keep the old #tabs visible until the dock is drawn (e.g. a class set by drawDock that the CSS keys on), and handle the import failing. Third, accessibility: the dock is role=tablist with role=tab buttons but no aria-controls, no roving tabindex or arrow keys (the existing sheet tabs have them), and the panels are not labelled by the tabs; mirror the pattern the sheet tabs already use. Also the README does not mention the phone tab bar or the #drive/#queue/#chat/#mod hashes.
All three of juniper's points are addressed on the branch and pushed. I haven't run any of this in a browser. server.test.ts, src/ui and stop-layout.test.ts give 123 passing and 1 failing. The failure is the vendored three.js route (404), which fails on main too because node_modules/three isn't in this checkout. I didn't run tsc this round.
- Machine: it is now a dock tab for everyone, as it was in the sheet. The order is Drive, Queue, Chat, Mod (owner only), Machine. Its panel shows alone like Queue and Chat.
- No navigation before the dock exists: every phone-portrait rule in
tabs.cssnow depends on adockedclass thatdrawDocksets only aftertabs.jshas loaded and the buttons are drawn. Until then the sheet's own tabs stay visible and no empty dock row is reserved. If the import fails,drawDockcatches it and leaves the sheet's tabs in place. Leaving portrait removesdocked. - Accessibility:
- Each dock button now has aria-controls, pointing at the sheet panel it shows.
- That panel's aria-labelledby points back at the dock button.
- The selected tab has tabindex 0 and the others -1.
- Left and right arrow keys move between tabs and wrap.
- The key logic is arrow() in src/ui/tabs.js, with a test. buildDock() in tabs.js draws the buttons.
- README: it now describes the phone bar, its tabs, the
#drive,#queue,#chat,#modand#machinehashes, and the fallback to the sheet's tabs.
I moved the dock drawing and arrow-key code into tabs.js to keep the first visit under the 51.2 KB limit. The Machine tab and the extra ARIA code had pushed the page over it, and tabs.js loads only on a phone in portrait. I did not raise the limit.
I pushed once with that size test failing before I fixed it. The final commit passes it.
I couldn't see the cause in the deploy log you sent. It stops partway through the tests, with every test shown passing. So I'm treating this as likely fixed, not confirmed. The preview deploy will show whether it is.
After merging main I reproduced one failure that wasn't the missing three.js module: the first-visit size test. The page plus the modules it loads up front came to 51,434 bytes gzipped, over the 51,200 limit. The merge pulled in main's refusal.js and viewer changes, which used up my headroom.
I fixed it by moving the dock logic (mountDock: drawing the tabs, the hash, the ARIA wiring, the arrow keys) out of viewer.html into src/ui/tabs.js. That module still loads only on a phone in portrait. Behavior is unchanged, and I did not raise the limit.
Full bun test after the change: 435 pass, 1 fails. The failure is the vendored three.js route (404). This checkout has no node_modules, and bun install can't write to its temp dir in this sandbox, so the deploy's bun install is the check that matters for that test. tsc did not run.
I pushed the merged branch (3e8df91).
Approved. The preview serves the page with tabs.css linked, and tabs.css and tabs.js both answer 200 with the right types. The bar draws only after tabs.js loads, so with JavaScript off or a failed import the sheet tabs stay. It is hidden on desktop and in landscape. The bar has roving tabindex, arrow keys, aria-controls and aria-labelledby, and 56px targets. The server change is narrow (the same regex and immutable caching, with a test). README and the direction are fine, and forge.json is untouched. I could not render it at 360/390px here.
Two things to do next:
- Test mountDock with a small DOM stub. Today only the pure helpers are tested. The hash fallback, the ARIA wiring, the aria-selected state and the Drive-to-Chat switch when a turn ends have no test.
- Check on a real 360px phone that Drive with no turn (sheet collapsed to 0 rows) and Queue, Chat and Machine each fill the screen without layout shift when the bar appears after the lazy import. If the shift shows, reserve the dock row from first paint.
Phone portrait (≤640 px wide) now has a bottom tab bar: Drive, Queue and Chat, plus Mod for the room owner. I could not render the page here. The layout rules are untested in a browser, so check it on the preview at 390x844 and 412x915.
Tests:
bun testonserver.test.ts,src/uiandstop-layout.test.tsgives 117 passing and 1 failing.tsccouldn't run (bun can't write to its temp dir in this sandbox). The failing test is the vendored three.js route inserver.test.ts(404). It also fails with my changes stashed, becausenode_modules/threeisn't in this checkout.What changed
showTab.location.hash. An unknown hash, or#modfor a non-owner, falls back to Drive.src/ui/tabs.js, the stylessrc/ui/tabs.css, and the testssrc/ui/tabs.test.ts. The Drive/Queue/Chat/Mod to sheet-tab mapping and the glue are insrc/viewer.html..cssfromsrc/uiastext/css, same versioned URL and immutable caching as.js, with a test.Things to look at
forge.jsonis untouched.🤖 Generated with Claude Code
Closes #159