Skip to content

feat(web): /pwa-test/4–7 — isolate the manifest as the status-bar fade trigger - #1011

Merged
mbryantms merged 1 commit into
mainfrom
feat/pwa-statusbar-tests-2
Oct 4, 2026
Merged

mbryantms merged 1 commit into
mainfrom
feat/pwa-statusbar-tests-2

Conversation

@mbryantms

Copy link
Copy Markdown
Owner

Round 1 (#1009) on the iPad: Tests 1–3 were all clean (opaque strip in
the sticky header's colour, no fade while scrolling), including Test 3
with Folio's exact apple-mobile-web-app-* + theme-color tags. So those
tags aren't the cause. The difference left is that Folio links a web app
manifest with display: standalone: the test pages reported
display-mode: standalone false, Folio's lab pages true. Each new
variant is Test 3 plus one change:

4 + manifest, display: standalone (Folio's; expected to fade)
5 + (the other difference)
6 + manifest, display: minimal-ui
7 + manifest, display: fullscreen (does iPadOS hide the status bar?)

Manifests come from /pwa-test/manifest/{4,6,7}, each with its own id,
start_url and scope so every test installs as a separate Home Screen
app that opens on its own page.

Round 1 also showed no fullscreen API (standard or webkit-prefixed) in
an installed iPad web app, so the reader can't hide the status bar via
the Fullscreen API.

…e trigger

Round 1 (#1009) on the iPad: Tests 1–3 were all clean (opaque strip in
the sticky header's colour, no fade while scrolling), including Test 3
with Folio's exact apple-mobile-web-app-* + theme-color tags. So those
tags aren't the cause. The difference left is that Folio links a web app
manifest with `display: standalone`: the test pages reported
`display-mode: standalone` false, Folio's lab pages true. Each new
variant is Test 3 plus one change:

4  + manifest, display: standalone (Folio's; expected to fade)
5  + <meta name="color-scheme" content="dark"> (the other difference)
6  + manifest, display: minimal-ui
7  + manifest, display: fullscreen (does iPadOS hide the status bar?)

Manifests come from /pwa-test/manifest/{4,6,7}, each with its own id,
start_url and scope so every test installs as a separate Home Screen
app that opens on its own page.

Round 1 also showed no fullscreen API (standard or webkit-prefixed) in
an installed iPad web app, so the reader can't hide the status bar via
the Fullscreen API.
@mbryantms
mbryantms merged commit 810e03a into main Oct 4, 2026
15 checks passed
@mbryantms
mbryantms deleted the feat/pwa-statusbar-tests-2 branch October 4, 2026 20:30
mbryantms added a commit that referenced this pull request Oct 4, 2026
… navigation (#1014)

The installed iPadOS app latches the first runtime change to the
theme-color / color-scheme metas: the status-bar strip switches from the
top bar's solid colour to a blur of the scrolled page content and stays
that way on every route until the app is force-quit. Folio hit this on
iPadOS 26.1 and fixed it for the explicit dark theme only (reader
viewport byte-identical to the root); light, amber and system themes kept
a reader-specific black viewport. With theme = system and the OS in light
mode on iPadOS 27.0.1, every visit to the reader flipped the strip, which
also explains why the lab pages (#1004, #1008, #1013) faded inside Folio
while the standalone test apps (#1009, #1011) never did.

The reader route now has no generateViewport at all and inherits the
root's. On iPadOS the strip takes its colour from the sticky header /
reader chrome, not theme-color (verified: a #000 theme-color test page
still showed the header colour), so nothing is lost there; on Android a
light-theme reader shows the theme's status-bar colour instead of black.

Follow-up, not in this change: standalone web apps freeze
prefers-color-scheme at launch, so with theme = system the app can stay
dark after the OS switches to light until a page re-resolves it.
mbryantms added a commit that referenced this pull request Oct 4, 2026
…gation never rewrites them (#1016)

Observed with a MutationObserver on <head>: on EVERY client-side
navigation Next re-renders its metadata tree, removing and re-inserting
theme-color, color-scheme, apple-mobile-web-app-capable, -title and
-status-bar-style (plus viewport/description/robots), even when nothing
changed. An installed iPadOS app latches such a runtime change into a
permanently blurred status-bar strip (force-quit resets it). #1014 only
stopped the reader's own value change, so it could not help: the root
tags still churned on each route change. The standalone test apps
(#1009, #1011) never navigate, which is why they were always clean.

- The apple-mobile-web-app-* / mobile-web-app-capable / color-scheme /
  theme-color tags are now static <head> children of RootLayout, which
  persists across navigations. Verified locally: across two in-app
  navigations they are the same DOM nodes with zero mutations; only
  Next's own viewport/description/robots tags still churn (no API to
  stop that), with identical values.
- `generateViewport` becomes the static `baseViewport`; `themeHeadMeta`
  (lib/viewport.ts) replaces themedViewport/readerViewport.
- tests/pwa/viewport.test.ts pins: tags present in the root layout, no
  route declaring them via the metadata/viewport API.
- /pwa-lab variant P, a latch probe: sticky grey header (strip state at
  a glance), a document-wide logger that survives in-app navigation
  (every <meta> change in <head> with old/new values, every change of
  the element iOS samples at the top edge, per route), one button per
  candidate trigger — including "churn: remove + re-add all app metas",
  i.e. exactly the old Next behaviour — a real Reload, and clean/faded
  note buttons. Delete with the rest of the lab.

iOS snapshots the apple-* tags at Add-to-Home-Screen time; the values
are unchanged, so no reinstall is needed.
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