Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

Phone portrait: the video is pinned on top with its 16:9 box reserved (no layout shift), and one status strip sits under it #115

Parked opened this
Closed without merging

On a phone held upright, the video is now pinned to the top of the screen with its 16:9 space reserved before the first frame arrives, and there is one status strip directly under it. The desktop and landscape layouts don't change. bun test (393 pass) and tsc --noEmit are clean.

Notes

stopped parked by the crew

opened this

On a phone held upright, the video is now pinned to the top of the screen with its 16:9 space reserved before the first frame arrives, and there is one status strip directly under it. The desktop and landscape layouts don't change. bun test (393 pass) and tsc --noEmit are clean. I did not check it in a real browser at 390×844 or 412×915; the CSS and markup are checked only by the new server test.

What changed

  • New src/ui/mobile.css: linked from viewer.html with media="(max-width: 600px) and (orientation: portrait)", so other layouts never apply it and it doesn't hold up their first paint. Under that query:

- #app (the video) is full-bleed, position: sticky; top: 0, with aspect-ratio: 16 / 9. - The notch is a black band env(safe-area-inset-top) high, drawn as a top border. Because the box uses box-sizing: content-box, the 16:9 ratio stays on the picture itself. - When the keyboard is up (#shell.typing) the view shrinks for the chat, as it does on every other layout.

  • One status strip: it already showed who drives, the time left and your place in line. It now also carries the arm's state (live or reconnecting, camera, lag) in a new #armLine. A small MutationObserver copies those words from the overlay as they change, so the values are the ones the page already shows rather than recomputed. On phones the overlay's status line (#top .info) and the driver's name tag over the video (#driverTag) are hidden, so nothing is shown twice. #armLine stays hidden on wider screens.
  • src/server.ts: .css files in src/ui are served like the page's own modules, at the content-named /ui/<hash>/ path with content-type: text/css and an immutable cache. They are part of the hash, so a change to the stylesheet reaches phones at once. The relay already sends /ui/ to the local server, so nothing else needed changing.
  • src/server.test.ts: a new test checks that the page links the stylesheet with that media query and that it returns 200, text/css and an immutable cache. It also checks the sticky 16:9 rule, the top safe-area inset, the hidden duplicates, and that #armLine sits inside the strip and is hidden by default. Without the server change it gets a 404 and fails.
  • README: the "On a phone" section now describes the pinned view.

What I chose not to do: the rest of #90 (the sheet and controls below the strip). Also, the existing touch-controls breakpoint stays at 640 px; only the new rules use the 600 px breakpoint the issue gives.

To try it: open the preview in a phone-sized portrait viewport (390×844 or 412×915) and reload. The space under the browser bar stays black and still until the picture arrives. The strip underneath reads, for example, "Live arm · … · idle · camera live".

🤖 Generated with Claude Code

Closes #112

4 earlier comments
commented

On a phone held upright, the video is now pinned to the top of the screen with its 16:9 space reserved before the first frame arrives, and there is one status strip directly under it. The desktop and landscape layouts don't change. bun test (393 pass) and tsc --noEmit are clean. I did not check it in a real browser at 390×844 or 412×915; the CSS and markup are checked only by the new server test.

What changed

  • New src/ui/mobile.css: linked from viewer.html with media="(max-width: 600px) and (orientation: portrait)", so other layouts never apply it and it doesn't hold up their first paint. Under that query:

- #app (the video) is full-bleed, position: sticky; top: 0, with aspect-ratio: 16 / 9. - The notch is a black band env(safe-area-inset-top) high, drawn as a top border. Because the box uses box-sizing: content-box, the 16:9 ratio stays on the picture itself. - When the keyboard is up (#shell.typing) the view shrinks for the chat, as it does on every other layout.

  • One status strip: it already showed who drives, the time left and your place in line. It now also carries the arm's state (live or reconnecting, camera, lag) in a new #armLine. A small MutationObserver copies those words from the overlay as they change, so the values are the ones the page already shows rather than recomputed. On phones the overlay's status line (#top .info) and the driver's name tag over the video (#driverTag) are hidden, so nothing is shown twice. #armLine stays hidden on wider screens.
  • src/server.ts: .css files in src/ui are served like the page's own modules, at the content-named /ui/<hash>/ path with content-type: text/css and an immutable cache. They are part of the hash, so a change to the stylesheet reaches phones at once. The relay already sends /ui/ to the local server, so nothing else needed changing.
  • src/server.test.ts: a new test checks that the page links the stylesheet with that media query and that it returns 200, text/css and an immutable cache. It also checks the sticky 16:9 rule, the top safe-area inset, the hidden duplicates, and that #armLine sits inside the strip and is hidden by default. Without the server change it gets a 404 and fails.
  • README: the "On a phone" section now describes the pinned view.

What I chose not to do: the rest of #90 (the sheet and controls below the strip). Also, the existing touch-controls breakpoint stays at 640 px; only the new rules use the 600 px breakpoint the issue gives.

To try it: open the preview in a phone-sized portrait viewport (390×844 or 412×915) and reload. The space under the browser bar stays black and still until the picture arrives. The strip underneath reads, for example, "Live arm · … · idle · camera live".

🤖 Generated with Claude Code

commented

On a phone held upright, the video is now pinned to the top of the screen with its 16:9 space reserved before the first frame arrives, and one status strip sits directly under it. The desktop and landscape layouts don't change. I did not check the layout in a real browser at 390×844 or 412×915; the CSS and markup are checked only by the server test.

The second commit fixes why the preview never came up, which is likely what lost both earlier tries. forge.json used /status as the health check. Behind the relay, /status answers 503 until the real arm on the Pi has been seen once. So whenever the Pi was reconnecting, a new preview failed the 30 s readiness wait however good the change was. Health is now /link, which answers 200 as soon as the app serves, whatever the arm is doing. /status itself is unchanged, so production's health check changes too once this merges.

What changed

  • src/ui/mobile.css (new): linked from viewer.html with media="(max-width: 600px) and (orientation: portrait)", so other layouts never apply it and their first paint doesn't wait for it. Under that query:

- The video area (#app) is full-bleed, position: sticky; top: 0, with aspect-ratio: 16 / 9. - The notch area (env(safe-area-inset-top)) is a black band above the picture, and the 16:9 ratio stays on the picture itself. - When the keyboard opens, the view still shrinks for the chat, as before.

  • One status strip: it already showed who drives, the time left and your place in line. It now also shows the arm's state (live or reconnecting, camera, lag) in a new #armLine, copied from the overlay as it changes. On phones the overlay's status line (#top .info) and the driver's name over the video (#driverTag) are hidden, so nothing shows twice. Wider screens never show #armLine.
  • src/server.ts: .css files in src/ui are served like the page's own modules: at the content-named /ui/<hash>/ path, as text/css, cached as immutable. They count toward the hash, so a stylesheet change reaches phones at once.
  • Tests:

- In src/server.test.ts, a new test checks that the stylesheet is linked and served (200, text/css, immutable). It also checks the pinned 16:9 rule, the top inset, the hidden duplicates, and that #armLine sits in the strip and is hidden by default. - In src/relay.test.ts, the "unreachable from the start" test now asserts that the health path in forge.json answers 200 while /status is 503. Both tests fail without their change.

  • Software/README.md: the "On a phone" section describes the pinned view.

bun test (393 pass) and tsc --noEmit are clean.

Not done: the rest of #90 (the sheet and controls below the strip). The existing 640 px touch-controls breakpoint is untouched.

To try it: open the preview in a portrait viewport of 390×844 or 412×915 and reload. The video area stays the same size from first paint, so nothing below it moves when the picture arrives. The strip underneath reads something like "Live arm · … · idle · camera live".

🤖 Generated with Claude Code

commented

On a phone held upright, the video now stays pinned to the top of the screen. Its 16:9 space is held open before the first frame arrives, so nothing jumps when the picture appears. One status strip sits directly under it. Desktop and landscape layouts don't change.

The earlier preview deploy failed because the forge's readiness check waited on /status, which returns 503 until the Pi's arm is first seen. With the arm reconnecting, the deploy never came up. forge.json now uses /link as health; it answers as soon as the app is serving. The preview at this head deployed and its tests passed. Locally, bun test passes (393) and tsc --noEmit is clean.

What changed

  • New src/ui/mobile.css: linked from viewer.html with media="(max-width: 600px) and (orientation: portrait)", so other layouts never load its rules or wait for it on first paint. Under that query:

- The video box (#app) runs edge to edge, uses position: sticky; top: 0 and has aspect-ratio: 16 / 9. - A black band env(safe-area-inset-top) high covers the notch. It is drawn as a top border with box-sizing: content-box, so the 16:9 ratio applies to the picture alone. - When the keyboard is up (#shell.typing), the video shrinks to make room for the chat, as it does on the other layouts.

  • One status strip: it already showed who is driving, the time left and your place in line. It now also shows the arm's state (live or reconnecting, camera, lag) in a new #armLine.

- A small MutationObserver copies those words from the overlay as they change, so the strip shows exactly what the page already shows. - On phones, the overlay's status line (#top .info) and the driver's name tag (#driverTag) are hidden so nothing appears twice. #armLine stays hidden on wider screens.

  • src/server.ts: .css files in src/ui are served like the page's modules: at the /ui/<hash>/ path, with content-type: text/css and an immutable cache. They are included in the hash, so a stylesheet change reaches phones straight away.
  • src/server.test.ts: a new test checks:

- the page links the stylesheet with that media query; - the stylesheet returns 200, text/css and an immutable cache; - the sticky 16:9 rule and the top safe-area inset are there; - the duplicates are hidden, and #armLine sits inside the strip and is hidden by default.

Without the server change it gets a 404 and fails.

  • README: the "On a phone" section describes the pinned view.

Not done: the rest of #90 (the sheet and controls below the strip). The existing 640 px breakpoint for touch controls stays as it is; only the new rules use the 600 px breakpoint the issue gives. I haven't checked the layout in a real phone browser; the only check on the CSS and markup is the server test above.

To try it: open https://arm--115--forge-trevato-apps.open-platform.sh in a portrait phone viewport (390×844 or 412×915) and reload.

  • Until the picture arrives, the space under the browser bar should stay black and not move.
  • The strip under the video should show the driver, the time left, your place in line and the arm's state.
  • Scrolling the page should leave the video pinned at the top.

🤖 Generated with Claude Code

commented

On a phone held upright, the video now stays pinned to the top of the screen. Its 16:9 space is held open before the first frame arrives, so nothing jumps when the picture appears. One status strip sits directly under it. Desktop and landscape layouts don't change.

Merge with main: both sides had changed forge.json's health for the same reason. The old /status check returns 503 until the Pi's arm is first seen, so the app never came up while the arm was reconnecting. This branch had switched to /link; main (044b88b) switched to /. The merge keeps main's "/", which also answers while the arm is offline. After the merge, bun test passes (393) and tsc --noEmit is clean.

What changed

  • New src/ui/mobile.css: linked from viewer.html with media="(max-width: 600px) and (orientation: portrait)", so other layouts never load its rules or wait for it on first paint. Under that query:

- The video box (#app) runs edge to edge, uses position: sticky; top: 0 and has aspect-ratio: 16 / 9. - A black band env(safe-area-inset-top) high covers the notch. It is drawn as a top border with box-sizing: content-box, so the 16:9 ratio applies to the picture alone. - When the keyboard is up (#shell.typing), the video shrinks to make room for the chat, as it does on the other layouts.

  • One status strip: it already showed who is driving, the time left and your place in line. It now also shows the arm's state (live or reconnecting, camera, lag) in a new #armLine.

- A small MutationObserver copies those words from the overlay as they change, so the strip shows exactly what the page already shows. - On phones, the overlay's status line (#top .info) and the driver's name tag (#driverTag) are hidden so nothing appears twice. #armLine stays hidden on wider screens.

  • src/server.ts: .css files in src/ui are served like the page's modules: at the /ui/<hash>/ path, with content-type: text/css and an immutable cache. They are included in the hash, so a stylesheet change reaches phones straight away.
  • src/server.test.ts: a new test checks:

- the page links the stylesheet with that media query; - the stylesheet returns 200, text/css and an immutable cache; - the sticky 16:9 rule and the top safe-area inset are there; - the duplicates are hidden, and #armLine sits inside the strip and is hidden by default.

Without the server change it gets a 404 and fails.

  • README: the "On a phone" section describes the pinned view.

Not done: the rest of #90 (the sheet and controls below the strip). The existing 640 px breakpoint for touch controls stays as it is; only the new rules use the 600 px breakpoint the issue gives. I haven't checked the layout in a real phone browser; the only check on the CSS and markup is the server test above.

To try it: open https://arm--115--forge-trevato-apps.open-platform.sh in a portrait phone viewport (390×844 or 412×915) and reload.

  • Until the picture arrives, the space under the browser bar should stay black and not move.
  • The strip under the video should show the driver, the time left, your place in line and the arm's state.
  • Scrolling the page should leave the video pinned at the top.

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs