Skip to content

Fix CJK thumbnail glyphs and long library filenames - #47

Merged
nkanf-dev merged 2 commits into
mainfrom
fix/cjk-library-incident
Oct 4, 2026
Merged

nkanf-dev merged 2 commits into
mainfrom
fix/cjk-library-incident

Conversation

@nkanf-dev

Copy link
Copy Markdown
Owner

Incident scope

  • Constrain both desktop library grid tracks and the recent-books column so a long, unbroken mixed-language filename cannot expand the page or crush the introduction. Preserve the full accessible filename and saved reading position.
  • Render embedded thumbnail fonts as PDF.js glyph paths in the dedicated worker. A dedicated worker has no document.fonts; swallowed font registration failures could otherwise return successful tofu images.
  • Check resolved worker font dependencies, including nested pattern/Type3 dependencies, and use the existing DOM fallback when a font needs system-font support. Leave main-thread cancellation and document retirement unchanged.
  • Bundle the installed PDF.js version's CMaps and standard fonts under the mounted application origin for the reader, thumbnail worker, and DOM fallback. Keep all license notices.
  • Keep full pull-request and main-push checks; remove dev/** push duplication. This fix branch is outside that old trigger too.

Regression evidence

  • Local lint, TypeScript, production build, deployment dry-run, 179 unit tests, and 266 UI tests pass.
  • The long-filename unit regression failed on the original layout and passes with bounded tracks.
  • Independently authored CJK fixtures and Poppler goldens compare 16 individual glyph shapes, rather than merely accepting loaded/nonwhite images. Local safe synthetic calibration separates working glyph paths (mean normalized error about 0.067) from the broken unregistered-font route (about 0.768).
  • 30 CJK browser cases are discovered across six existing browser/device projects: reader, genuine custom worker, forced DOM fallback, missing-font routing, and served asset byte identity. Worker success and zero DOM encodes prevent fallback from concealing a worker failure.
  • Realistic synthetic long-title browser coverage checks desktop and 320px geometry, nested overflow, truncation, and keyboard reopening of the saved page.
  • Independent source/test reviews found no remaining blocking issues.

Validation boundaries

Browser execution is pending this normal PR gate; local browser access was unavailable. Node rendering is not claimed as browser or physical-device validation. The nonembedded-CJK test verifies resource/fallback routing, not system-font quality on an unpinned OS.
No user PDF, filename, screenshot, extracted text, or derived page image is included. All committed fixtures and images are independent synthetic controls. Thumbnail images are memory-only and are recreated when a document is reopened.

This PR contains only the reported layout/font incident and CI deduplication. The separate PDF-link draft remains unmerged.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
leafspace 90ad3bd Commit Preview URL

Branch Preview URL
Oct 04 2026, 02:49 AM

Preserve shape error limits, handle small-font hinting placement, and reject blank, tofu, displaced, and substituted glyph controls.

Co-authored-by: Codex <noreply@openai.com>
@nkanf-dev
nkanf-dev marked this pull request as ready for review October 4, 2026 03:07
Copilot AI balanced review requested due to automatic review settings October 4, 2026 03:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@nkanf-dev
nkanf-dev merged commit 85d30a3 into main Oct 4, 2026
6 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.

2 participants