Home Screen app reaches the screen's bottom when the viewport is short (#445) #447

Closed
kayg wants to merge 1 commit from issue/445-bottom-band into dev
Owner

Fixes #445.

Cause. In the device screenshot the new-note button (position: fixed; bottom: 18px + safe-bottom) sits 52 pt above the band, not above the screen's bottom. So on kayg's iPhone even fixed boxes end a status bar (62 pt) short, along with innerHeight, svh/dvh and the visual viewport. #405 (home-screen.ts) measured the app with a fixed box, so it measured the short height. It also wrote that height into --screen-h, so the backdrop, which had been 100lvh, stopped short too. The page still covers the whole screen, so the strip below showed the page's own background as a flat band. WebKit bugs 301994 and 301108 describe this.

Fix.

  • home-screen.ts: when the page runs under the status bar (top safe area > 0) or the phone is on its side, and the window is the screen's full width, the screen's own size counts too. screen.width and screen.height don't swap when the phone turns, so the side that matches the window's width says which is which. The taller of that and the fixed box sets --vh and --screen-h. With an opaque status bar (no top safe area) the app keeps the window's height, so it never grows past what you can see. It is re-measured on resize as well as by the ResizeObserver.
  • On the Home Screen, the new-note button and the phone bar are position: absolute in the app's box (now measured to the real bottom), not fixed.
  • keyboard.svelte.ts: with the keyboard down, the bar rests on the app's bottom edge, not on the short visual viewport.
  • Safari tabs, Android and desktop are unchanged: fitHomeScreen still returns early there.

Tests. home-screen.spec.ts gets a new short-window model: the window is one status bar shorter than screen.height, as on the device. It checks that the list's scroller, its glass, the backdrop, the body and the button reach the screen's bottom (320, 375, 390 and 402, light and dark). It also checks that the note's bar rests above the home indicator, and that under an opaque status bar the app stays at the window's height. Before the fix, 12 of the 13 new tests fail, and their numbers match the device (for example, at 402x874 the stack ends at 812 and the button sits 52 above that). After the fix, all 13 pass on chromium-390 and webkit-390.

Run with --no-deps on chromium-390 and webkit-390: phone-edges, phone-bars, safe-areas, pwa, bar-*, home-screen, keyboard. Results are on the issue.

Unproven. Playwright can't shorten the layout viewport inside a real web view, so it can't show whether iOS paints the boxes that now extend below its short viewport. The band shows the page's background, so the page is painted there, but only the phone can confirm. The device checklist is on #445.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Fixes #445. **Cause.** In the device screenshot the new-note button (`position: fixed; bottom: 18px + safe-bottom`) sits 52 pt above the band, not above the screen's bottom. So on kayg's iPhone even fixed boxes end a status bar (62 pt) short, along with `innerHeight`, `svh`/`dvh` and the visual viewport. #405 (`home-screen.ts`) measured the app with a fixed box, so it measured the short height. It also wrote that height into `--screen-h`, so the backdrop, which had been `100lvh`, stopped short too. The page still covers the whole screen, so the strip below showed the page's own background as a flat band. WebKit bugs 301994 and 301108 describe this. **Fix.** - `home-screen.ts`: when the page runs under the status bar (top safe area > 0) or the phone is on its side, and the window is the screen's full width, the screen's own size counts too. `screen.width` and `screen.height` don't swap when the phone turns, so the side that matches the window's width says which is which. The taller of that and the fixed box sets `--vh` and `--screen-h`. With an opaque status bar (no top safe area) the app keeps the window's height, so it never grows past what you can see. It is re-measured on `resize` as well as by the ResizeObserver. - On the Home Screen, the new-note button and the phone bar are `position: absolute` in the app's box (now measured to the real bottom), not `fixed`. - `keyboard.svelte.ts`: with the keyboard down, the bar rests on the app's bottom edge, not on the short visual viewport. - Safari tabs, Android and desktop are unchanged: `fitHomeScreen` still returns early there. **Tests.** `home-screen.spec.ts` gets a new short-window model: the window is one status bar shorter than `screen.height`, as on the device. It checks that the list's scroller, its glass, the backdrop, the body and the button reach the screen's bottom (320, 375, 390 and 402, light and dark). It also checks that the note's bar rests above the home indicator, and that under an opaque status bar the app stays at the window's height. Before the fix, 12 of the 13 new tests fail, and their numbers match the device (for example, at 402x874 the stack ends at 812 and the button sits 52 above that). After the fix, all 13 pass on chromium-390 and webkit-390. Run with `--no-deps` on chromium-390 and webkit-390: phone-edges, phone-bars, safe-areas, pwa, bar-*, home-screen, keyboard. Results are on the issue. **Unproven.** Playwright can't shorten the layout viewport inside a real web view, so it can't show whether iOS paints the boxes that now extend below its short viewport. The band shows the page's background, so the page is painted there, but only the phone can confirm. The device checklist is on #445. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Home Screen app reaches the screen's bottom when the viewport is short (#445)
Some checks failed
CI / server (pull_request) Successful in 1m8s
CI / rust (pull_request) Successful in 2m45s
CI / web (pull_request) Failing after 38m42s
a6a2faedad
On kayg's iPhone (iOS 26, Home Screen app) the layout viewport itself is one status bar short:
innerHeight, the svh/dvh units, the visual viewport and position: fixed boxes all end ~62 pt
above the bottom, while the page still covers the screen. #405 measured the app with a fixed
box, so it measured the short value and also pulled --screen-h (the backdrop, 100lvh) down to
it; the strip below showed the page's background as a flat band.

- home-screen.ts: when the page runs under the status bar (a top safe area) or the phone is on
  its side, and the window is the screen's full width, the screen's own height counts too. The
  tallest of that and the fixed box sizes --vh and --screen-h. An opaque status bar (no top
  safe area) keeps the window's height, so the app never grows past it.
- The new-note button and the phone bar sit in the app's box on the Home Screen, not fixed.
- The bar rests on the app's bottom edge with the keyboard down, not the short visual viewport.
- e2e: a short-window model (window a status bar shorter than screen.height) for the list,
  the button, the bar, and the opaque-bar shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Landed in dev via train o.

Landed in dev via train o.
kayg closed this pull request 2026-10-15 22:39:23 +00:00
Some checks failed
CI / server (pull_request) Successful in 1m8s
CI / rust (pull_request) Successful in 2m45s
CI / web (pull_request) Failing after 38m42s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!447
No description provided.