Skip to content

fix: stop readability blank page, flashing, and misapplicable toggle - #848

Merged
ankit merged 1 commit into
mainfrom
worktree-fix-readability-blank-page
Sep 5, 2026
Merged

fix: stop readability blank page, flashing, and misapplicable toggle#848
ankit merged 1 commit into
mainfrom
worktree-fix-readability-blank-page

Conversation

@ankit

@ankit ankit commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes a blank-page bug: toggling readability on left the localStorage-cached page state stale, so a refresh right after enabling it could apply readability before the reader actually mounted. Also hardened the reader-mount chain (unawaited promises, no fetch timeouts) so a stall there can't blank the page either.
  • Removes the loading flash: caches the last-used theme so the loading screen matches sepia/dark instead of flashing white, parses a clone of the live document instead of re-fetching the page over XHR, waits for the actual web font to load (Font Loading API) before revealing the reader, and resets the page's own body border/box-shadow behind the loader.
  • The popup's readability toggle is now disabled on pages the reader can't apply to (e.g. a site's homepage), using the same applicability check the reader runs before mounting.

Test plan

  • yarn lint
  • yarn jest (130 tests passing)
  • yarn build
  • Manually verified in dev Chrome: enable readability on an article, refresh (no longer blank), toggle sepia/dark theme (no white flash), popup toggle disabled on homepage / enabled on articles

🤖 Generated with Claude Code

Toggling readability on left the localStorage-cached page state stale,
so a refresh right after enabling it could apply readability before
the reader actually mounted, leaving the tab blank. Also hardened the
reader-mount chain (unawaited promises, no fetch timeouts) so a stall
there can't blank the page either.

Separately: cache the last-used theme so the loading screen no longer
flashes white before switching to sepia/dark; parse a clone of the live
document instead of re-fetching the page over XHR; wait for the actual
web font to load (via the Font Loading API) before revealing the reader
instead of flashing a fallback font; and reset the page's own body
border/box-shadow behind the loader.

The popup's readability toggle is now disabled on pages the reader
can't apply to (e.g. a site's homepage), using the same applicability
check the reader runs before mounting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019wgboauYExwrGNwKvDii92
@ankit
ankit merged commit 9c99a71 into main Sep 5, 2026
2 checks passed
@ankit
ankit deleted the worktree-fix-readability-blank-page branch September 5, 2026 18:23
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