Skip to content

Add iOS standalone (Home Screen PWA) freeze mitigations#10

Merged
CasJam merged 1 commit into
mainfrom
bc/ios-pwa-freeze-fix
May 31, 2026
Merged

Add iOS standalone (Home Screen PWA) freeze mitigations#10
CasJam merged 1 commit into
mainfrom
bc/ios-pwa-freeze-fix

Conversation

@CasJam

@CasJam CasJam commented May 31, 2026

Copy link
Copy Markdown
Contributor

Bakes iOS standalone PWA freeze mitigations into the template so apps forked from it inherit the fix. When run from the iPhone Home Screen, a discarded/long-suspended WebKit process previously left a frozen, dead JS context with no browser chrome to reload from.

Changes: disable Inertia encrypt_history (less memory + Web Crypto per navigation); add a client-only standalone-recovery guard that reloads on bfcache restore and on resume after >30 min hidden (only when standalone); add a ref-counted blockAutoReload registry + useBlockAutoReload hook so unsaved edits suppress the reload, wired into the RichTextField primitive; add a top-level ErrorBoundary with a Reload button around the Inertia <App>; and add iOS standalone meta tags. The recovery reload is intentionally suppressed while an editor is dirty — never destroy unsaved work. The recovery module installs only from the client entrypoint (never SSR); npm run check and the SSR smoke test both pass.

🤖 Generated with Claude Code

When the app is saved to the iPhone Home Screen and run in standalone mode,
it runs under a tighter WebKit memory ceiling with no browser chrome to
silently reload from, so a discarded/long-suspended WebKit process leaves a
frozen, dead JS context. Bake the mitigations into the template:

- Disable Inertia encrypt_history (less memory + Web Crypto per navigation).
- standalone-recovery.ts: client-only guard that reloads on bfcache restore
  and on resume after >30 min hidden, only when running standalone.
- Ref-counted blockAutoReload registry + useBlockAutoReload hook so unsaved
  edits suppress the reload; wired into the RichTextField primitive.
- Top-level ErrorBoundary with a Reload button around the Inertia <App>.
- iOS standalone meta tags (viewport-fit=cover, status-bar-style, web-app-title).

Recovery module is installed only from the client entrypoint, never SSR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@CasJam CasJam merged commit 03cd235 into main May 31, 2026
5 checks passed
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