Skip to content

Preload fonts and hide unused ADT UI features#71

Merged
nicpottier merged 3 commits intomainfrom
nicpottier/fix-font-flash
Feb 18, 2026
Merged

Preload fonts and hide unused ADT UI features#71
nicpottier merged 3 commits intomainfrom
nicpottier/fix-font-flash

Conversation

@nicpottier
Copy link
Contributor

Summary

  • Add <link rel="preload"> for Merriweather font files in renderPageHtml so font downloads start during HTML parsing, reducing font flash in the ADT preview
  • Hide TTS speaker button and sidebar toggle when readAloud is disabled (no TTS data built)
  • Hide Easy Read, Sign Language, ELI5, and Glossary sidebar sections when their respective features are disabled
  • Hide the entire Assistant tab and default to Settings when no assistant features are enabled

Test plan

  • Open v2 preview for a book without TTS — verify no speaker icon or TTS toggle appears
  • Open v2 preview for a book without glossary/eli5/easyRead — verify Assistant tab is hidden and sidebar defaults to Settings
  • Open v2 preview for a book with TTS/glossary — verify those features still appear correctly
  • Verify font flash is reduced on initial preview load

- Add font preload links to renderPageHtml so Merriweather downloads
  start during HTML parsing rather than after CSS processing
- Hide TTS quick-toggle button and sidebar toggle when readAloud is
  disabled in config
- Hide Easy Read, Sign Language sections when their features are off
- Hide the Assistant tab entirely when no assistant features are enabled,
  defaulting the sidebar to the Settings tab
- Revert pendingPages two-pass to direct file writes
- Remove inline interface/config/pages/toc options from renderPageHtml
- Add immutable Cache-Control for v2 ADT static files (cache-busted URLs)
- Remove no-store from v1 preview routes
- Add opacity-0 to #content div to prevent translation text flash
- Add failsafe timeout for #content opacity in error_utils.js
@nicpottier nicpottier merged commit d0629d5 into main Feb 18, 2026
1 check 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