Phone: the dim behind a sheet reaches Safari's bars and the home indicator (#293) #304

Closed
kayg wants to merge 0 commits from issue/293-safe-areas into dev
Owner

Closes #293 (once kayg confirms it on the phone).

The bug (dark, photo backdrop, Style sheet open): on a phone the dim behind a sheet was a position: fixed layer. Safari 26 tints its status bar from a fixed layer at the screen edge, which gave the dark slab at the top. It also never draws fixed layers under its floating toolbar, so the strip there kept the undimmed page colour: the band at the bottom. The research, with sources, is on #293.

The fix (app shell and backdrop only; the bar's offset is untouched, that's #290):

  • The sheet's dim (BottomBar .scrim) and the palette's dim are now in-page layers (position: absolute), so Safari never samples them. The bar itself and bar.css are unchanged.
  • use:dimsPage (new lib/page-dim.ts) sets data-dim on the root while a dim is up. The root's edge colour (--edge-shown in base.css) then mixes in the same dim (--scrim-ink / --scrim-amount tokens next to --scrim). That colour is the html and body background, which Safari fills both bars with, and theme-color.
  • The backdrop dims the strip below the app by the same amount (.shade, under .floor's area). That strip is what Safari shows under its toolbar.
  • theme-color is always written as plain rgb(), because a mixed colour computes to color(srgb …).
  • The sheet stays a floating sheet above the home indicator, as #257 decided. The dim behind it now runs edge to edge.

Tests: new e2e/phone-edges.spec.ts, 144 cases per engine: 320, 375, 390 and 430 wide; browser (toolbar faked) and installed app; light and dark; sky, photo and plain; nothing open, a sheet, and the palette. It reads the real top and bottom pixel rows against the root colour (ΔE < 2) and checks for bands under the status bar and above the toolbar strip. It also checks that no fixed layer with its own colour spans a screen edge. Locally: Chromium 144/144, WebKit 144/144. Existing phone-bars (240 cases) and safe-areas specs still pass.

🤖 Generated with Claude Code

Closes #293 (once kayg confirms it on the phone). **The bug** (dark, photo backdrop, Style sheet open): on a phone the dim behind a sheet was a `position: fixed` layer. Safari 26 tints its status bar from a fixed layer at the screen edge, which gave the dark slab at the top. It also never draws fixed layers under its floating toolbar, so the strip there kept the undimmed page colour: the band at the bottom. The research, with sources, is on #293. **The fix** (app shell and backdrop only; the bar's offset is untouched, that's #290): - The sheet's dim (BottomBar `.scrim`) and the palette's dim are now in-page layers (`position: absolute`), so Safari never samples them. The bar itself and `bar.css` are unchanged. - `use:dimsPage` (new `lib/page-dim.ts`) sets `data-dim` on the root while a dim is up. The root's edge colour (`--edge-shown` in base.css) then mixes in the same dim (`--scrim-ink` / `--scrim-amount` tokens next to `--scrim`). That colour is the html and body background, which Safari fills both bars with, and `theme-color`. - The backdrop dims the strip below the app by the same amount (`.shade`, under `.floor`'s area). That strip is what Safari shows under its toolbar. - `theme-color` is always written as plain `rgb()`, because a mixed colour computes to `color(srgb …)`. - The sheet stays a floating sheet above the home indicator, as #257 decided. The dim behind it now runs edge to edge. **Tests:** new `e2e/phone-edges.spec.ts`, 144 cases per engine: 320, 375, 390 and 430 wide; browser (toolbar faked) and installed app; light and dark; sky, photo and plain; nothing open, a sheet, and the palette. It reads the real top and bottom pixel rows against the root colour (ΔE < 2) and checks for bands under the status bar and above the toolbar strip. It also checks that no fixed layer with its own colour spans a screen edge. Locally: Chromium 144/144, WebKit 144/144. Existing phone-bars (240 cases) and safe-areas specs still pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Phone: the dim behind a sheet reaches Safari's bars and the home indicator (#293)
Some checks failed
CI / server (pull_request) Successful in 23s
CI / web (pull_request) Failing after 23s
CI / rust (pull_request) Successful in 1m50s
1b297e0c7f
On a phone the dim behind a sheet (and the palette) was a `position: fixed`
layer. Safari 26 tints its status bar from a fixed layer at the screen edge
(the dark slab at the top), and it never draws fixed layers under its
floating toolbar, so the strip there stayed the undimmed page colour (the
band at the bottom).

- The dim is now an ordinary layer in the page (`position: absolute`), so
  Safari never samples it. `use:dimsPage` (lib/page-dim.ts) marks the root
  with `data-dim` while it is up.
- With `data-dim`, the page's edge colour (`--edge-shown`: html/body
  background, which Safari fills its bars with, and `theme-color`) is the
  edge colour with the same dim mixed in (`--scrim-ink`, `--scrim-amount`).
- The backdrop dims the strip below the app (what shows under Safari's
  toolbar) by the same amount.
- `theme-color` is always written as plain rgb(), since a mixed colour
  computes to color(srgb ...).

New e2e/phone-edges.spec.ts: 320/375/390/430, browser (toolbar faked) and
installed app, light and dark, sky/photo/plain, with nothing open, a sheet and
the palette. It reads the real top and bottom pixel rows against the root
colour, checks for bands, and checks that no fixed layer with a colour spans
an edge.

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

Landed in merge train #329.

Landed in merge train #329.
kayg closed this pull request 2026-10-14 17:39:14 +00:00
Some checks failed
CI / server (pull_request) Successful in 23s
CI / web (pull_request) Failing after 23s
CI / rust (pull_request) Successful in 1m50s

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!304
No description provided.