Add iOS standalone (Home Screen PWA) freeze mitigations#10
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-onlystandalone-recoveryguard that reloads on bfcache restore and on resume after >30 min hidden (only when standalone); add a ref-countedblockAutoReloadregistry +useBlockAutoReloadhook so unsaved edits suppress the reload, wired into theRichTextFieldprimitive; add a top-levelErrorBoundarywith 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 checkand the SSR smoke test both pass.🤖 Generated with Claude Code