Skip to content

fix(pwa): permanent top-edge bar so iPadOS never sees "no bar" and latches into content blur - #1022

Merged
mbryantms merged 1 commit into
mainfrom
fix/pwa-top-edge-backstop
Oct 5, 2026
Merged

mbryantms merged 1 commit into
mainfrom
fix/pwa-top-edge-backstop

Conversation

@mbryantms

Copy link
Copy Markdown
Owner

Measured on iPadOS 27.0.1 with the /pwa-lab probe, each run from a
fresh document (Reload):

  • a real Next navigation with the sticky header on screen throughout:
    strip stays clean;
  • removing + re-adding the viewport meta: clean;
  • hiding the sticky header for 2 s: FADED, and it stays faded for the
    life of the document (a reload clears it; the iPhone recovers on its
    own, the iPad does not).

So the rule is: the first time iOS samples the top edge and finds no
fixed/sticky bar, it switches the status-bar strip from the bar's colour
to a blur of the page content and never switches back. The real app has
such moments on every route change — the [locale] loading skeleton
(bg-background grid min-h-screen) has no header, which the device
logs caught right after each navigation — which is why every in-app
navigation flipped it while the standalone test apps (never navigating)
never did, and why #1014/#1016 (head-tag changes) could not help.

Fix: a 12px fixed, full-width, app-background bar as the first child of

in the root layout. It is under every real header (z-0 vs their z-20/z-30) so it is invisible in normal use, and it is what the sample point hits whenever a header is absent. Verified locally: headerless page → backstop; page with sticky header, at rest and scrolled → header; header hidden → backstop. WebKit ignores edge bars ≤ 10px, hence 12.

Probe: two new triggers hide the header with a 12px / 32px fixed bar
behind it, to confirm on-device that 12px is enough.

…tches into content blur

Measured on iPadOS 27.0.1 with the /pwa-lab probe, each run from a
fresh document (Reload):
- a real Next navigation with the sticky header on screen throughout:
  strip stays clean;
- removing + re-adding the viewport meta: clean;
- hiding the sticky header for 2 s: FADED, and it stays faded for the
  life of the document (a reload clears it; the iPhone recovers on its
  own, the iPad does not).

So the rule is: the first time iOS samples the top edge and finds no
fixed/sticky bar, it switches the status-bar strip from the bar's colour
to a blur of the page content and never switches back. The real app has
such moments on every route change — the [locale] loading skeleton
(`bg-background grid min-h-screen`) has no header, which the device
logs caught right after each navigation — which is why every in-app
navigation flipped it while the standalone test apps (never navigating)
never did, and why #1014/#1016 (head-tag changes) could not help.

Fix: a 12px fixed, full-width, app-background bar as the first child of
<body> in the root layout. It is under every real header (z-0 vs their
z-20/z-30) so it is invisible in normal use, and it is what the sample
point hits whenever a header is absent. Verified locally: headerless
page → backstop; page with sticky header, at rest and scrolled → header;
header hidden → backstop. WebKit ignores edge bars ≤ 10px, hence 12.

Probe: two new triggers hide the header with a 12px / 32px fixed bar
behind it, to confirm on-device that 12px is enough.
@mbryantms
mbryantms merged commit 338a1be into main Oct 5, 2026
15 checks passed
@mbryantms
mbryantms deleted the fix/pwa-top-edge-backstop branch October 5, 2026 00:44
mbryantms added a commit that referenced this pull request Oct 5, 2026
… the backstop (#1024)

Device runs (iPadOS 27.0.1): hiding the header with a 12px bar behind it
latched the strip into content blur, so 12px — what #1022's root
backstop and the reader's status-bar strip use — is not accepted there
(WebKit main says > 10px counts; the shipped build evidently differs).
The 32px run was invalid: the probe's bar was inserted before the root
backstop at the same z-index, so the 12px backstop painted on top and
was what the sample hit both times (the log's `edge:` line shows it).

The triggers now insert the bar at z-index 1, above the backstop, in a
ladder: 16, 20, 24, 32, 44px. Verified locally that the probe bar is the
sampled container at each height. The smallest height that stays clean
sets the backstop and the reader's strip.
mbryantms added a commit that referenced this pull request Oct 5, 2026
…a different bar (#1026)

Root cause, measured on iPadOS 27.0.1 with a parameterised probe served
from the dev box (no releases): the status-bar strip is painted in the
colour of the fixed/sticky element iOS finds at the top edge, and the
FIRST time that element changes — a header unmounting on a layout
switch, the reader chrome taking over, any other bar swapped in — it
switches to blurring the page content into the strip and never recovers
for the life of the document. Shrinking the same header to 12px kept
the strip clean; replacing it with any other bar (fixed or sticky,
12–56px, scrolling or not) latched it. This is why sidebar navigation
(header persists) was clean while About → admin and the reader (header
swapped) faded, why #1022's backstop could not help (it only became the
sampled element after the header had gone, itself a change), and why
head-tag work (#1014, #1016) was beside the point.

- Root layout: `#top-edge`, the first child of <body>: sticky, z-9999,
  12px (WebKit ignores bars ≤ 10px), negative margin so it costs no
  layout, in the page colour (`--top-edge-color`, default background).
  It is always what iOS samples: present from first paint, above every
  header and overlay. Replaces the fixed backstop.
- The reader marks its root `data-surface="reader"`; globals.css turns
  the bar black there (same element, colour change only — verified
  clean on-device).
- Verified on the iPad in one document: header hidden with a fixed 56px
  bar inserted, bar colour → black → back, header hidden with a sticky
  20px bar, three route changes through a headerless page, scrolling —
  all clean. Browser check: #top-edge is the sampled element at rest,
  scrolled, with headers hidden, during the colour change and under a
  dialog overlay.
- /pwa-lab: variant Q, a parameterised experiment console (position,
  height, colour, z-index, header kept/hidden, scroll lock, duration)
  plus a colour-change trigger; the sticky-vs-fixed ladder on P; the
  logger shared between them. manifest.ts: dev-only
  PWA_LAB_START_URL so a LAN dev server's installed app opens on a lab
  page instead of the API-backed home. Delete the lab once confirmed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant