Skip to content

Fix white screen on display page by self-hosting Inter font#30

Merged
dadachi merged 1 commit intomainfrom
fix/async-font-loading
Mar 22, 2026
Merged

Fix white screen on display page by self-hosting Inter font#30
dadachi merged 1 commit intomainfrom
fix/async-font-loading

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented Mar 22, 2026

Summary

  • Display page (display/shops/show) would turn completely white when NormalDisplaySettingsController#update_text was called from the iOS client
  • Root cause: rel="stylesheet" for Google Fonts is render-blocking. When the after_update_commit callback triggers a full page reload via Turbo Stream, the browser blocks rendering until the font CSS loads. If the request is slow or hangs, the page stays white
  • Fix: self-host Inter font files with font-display: swap and serve via the asset pipeline, removing the external Google Fonts dependency entirely
  • Removed Google Fonts domains from CSP since fonts are now self-hosted

Test plan

  • Open display page for a shop in normal mode
  • From iOS client, call update_text on NormalDisplaySettings
  • Verify the display page reloads without turning white
  • Verify Inter font still loads correctly after page render
  • Test with slow network conditions (e.g., throttle in DevTools)

🤖 Generated with Claude Code

Replace external Google Fonts stylesheet with self-hosted Inter font
files to eliminate render-blocking requests that caused the display
page to turn white during Turbo Stream reloads.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dadachi dadachi merged commit c0a9b84 into main Mar 22, 2026
2 of 3 checks passed
@dadachi dadachi deleted the fix/async-font-loading branch March 22, 2026 08:53
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