Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
stack streams on larger view #562
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
On an iPad (either way up), a laptop or any screen wider than a phone, the cameras now stack in one column on the left with the top view above the side view. The 3D model fills the larger space on the right at full height, so you no longer get three columns. Every camera now starts on by default.
shipped merged
On an iPad (either way up), a laptop or any screen wider than a phone, the cameras now stack in one column on the left with the top view above the side view. The 3D model fills the larger space on the right at full height, so you no longer get three columns. Every camera now starts on by default.
- Layout (
src/viewer.html): when the model and at least one camera are on, each camera is 16:9 and as wide as its share of the height allows, capped at 45% of the view. The model gets the rest. The rules live in@media (min-width: 601px), (orientation: landscape), so the upright-phone layout inui/mobile.cssis untouched. A phone on its side still shows one view at a time. - What starts on (
src/ui/views.js): the start-up rule moved out of the inline script into this module. Wider than a phone, every camera and the model start on; a narrow screen still starts with the first camera alone. A viewer's saved choice still wins, so a browser that saved "Cam 1 + 3D" before this change keeps that until Cam 2 is tapped once. After that, Cam 2 stacks under Cam 1. - Sizes: on an iPad in landscape (1180×820, with the 400 px sheet) each camera is about 351×197 and the model about 427 px wide. Upright it's about 369×207 per camera, with about 449 px for the model.
- Not done: when the cameras are on without the model, they still sit side by side, as before. The fix uses
:has()and container-query units, which Safari has supported since 16.
Tests: the new src/ui/views.test.ts covers the start-up rule. The new src/stack-layout.test.ts reads the served stylesheet and checks that both cameras fit one above the other with the model wider than the camera column, at iPad (both ways), iPad Pro and laptop sizes. Both pass, as do the existing landscape, portrait, page, server and relay suites. The type check shows the same 35 errors it already shows on main and none in the new files. Nothing has been checked on a real iPad yet: the preview for this branch is the place to try it, with two cameras and the model on.
🤖 Generated with Claude Code
Approved. The preview serves / (200) with the new media block and the versioned views.js (200, text/javascript). The cameras-left, model-right layout sits only under (min-width: 601px), (orientation: landscape), so the upright phone keeps ui/mobile.css. Moving the start-up rule into views.js is a clean extraction and it is tested. No server, identity or terminal surface changes, so the security and both-doors items do not apply.
Two things I would do next:
- Check it on a real iPad and on a phone on its side with two cameras and the model on. The stack-layout test only reads the CSS arithmetic, not a rendered page.
- Add a fallback for browsers without :has() or container units (older than Safari 16). Today they fall back to the old side-by-side row, which is acceptable. A short note in the README would say so.
On an iPad (either way up), a laptop or any screen wider than a phone, the cameras now stack in one column on the left with the top view above the side view. The 3D model fills the larger space on the right at full height, so you no longer get three columns. Every camera now starts on by default.
src/viewer.html): when the model and at least one camera are on, each camera is 16:9 and as wide as its share of the height allows, capped at 45% of the view. The model gets the rest. The rules live in@media (min-width: 601px), (orientation: landscape), so the upright-phone layout inui/mobile.cssis untouched. A phone on its side still shows one view at a time.src/ui/views.js): the start-up rule moved out of the inline script into this module. Wider than a phone, every camera and the model start on; a narrow screen still starts with the first camera alone. A viewer's saved choice still wins, so a browser that saved "Cam 1 + 3D" before this change keeps that until Cam 2 is tapped once. After that, Cam 2 stacks under Cam 1.:has()and container-query units, which Safari has supported since 16.Tests: the new
src/ui/views.test.tscovers the start-up rule. The newsrc/stack-layout.test.tsreads the served stylesheet and checks that both cameras fit one above the other with the model wider than the camera column, at iPad (both ways), iPad Pro and laptop sizes. Both pass, as do the existing landscape, portrait, page, server and relay suites. The type check shows the same 35 errors it already shows on main and none in the new files. Nothing has been checked on a real iPad yet: the preview for this branch is the place to try it, with two cameras and the model on.🤖 Generated with Claude Code
Closes #561