Skip to content

Kanbun reader: recover when its frame loads badly - #60

Merged
HanpuLi merged 1 commit into
mainfrom
fix/kanbun-handshake-20261015
Oct 15, 2026
Merged

HanpuLi merged 1 commit into
mainfrom
fix/kanbun-handshake-20261015

Conversation

@HanpuLi

@HanpuLi HanpuLi commented Oct 15, 2026

Copy link
Copy Markdown
Owner

On the iOS home-screen web app the Japanese pages sometimes showed plain vertical text with the kanbun layer missing, and switching layout did not bring it back.

Cause. The visual reader is shown only after the sandboxed frame reports ready. If the frame loaded without its typesetter (it reports error), or never answered, nothing retried. The viewer also stayed silent when asked again, if its size had not changed.

Change

  • Host: if the frame is not ready, ask again (3 times, 1.5 s apart), then reload the frame (2 times at most). An error report reloads the frame at once. Choosing a layout restarts the attempts.
  • Viewer: every preferences message gets a measurement back.
  • poetry-kunten-host.js and poetry-kunten-host.css now carry ?v= fingerprints, so an installed app does not pair new frames with an old controller.

Test. New qa:poetry-kunten-recovery runs in Chromium and WebKit at 390 px:

  • the typesetter fails on first load;
  • the viewer fails on first load;
  • the first ready message is lost;
  • the frame is blocked until retries run out, then the layout choice recovers it.

All 8 scenarios pass. Against current main the first scenario fails, with the reader never ready. Full npm run qa passes; one qa:author-shop page-load timeout passed when rerun on its own.

🤖 Generated with Claude Code

https://claude.ai/code/session_014ECg6ksCbqKTUJNKX4Qt6C

On the iOS home-screen app a frame occasionally loaded without its
typesetter or never answered, leaving the plain vertical source with no
way back short of a reload. The host now asks again, reloads the frame
(twice at most) on an error or silence, and a layout choice restarts the
attempts. The viewer answers every explicit request. Host script and
stylesheet are fingerprinted like the frames.
@HanpuLi
HanpuLi merged commit cffadaf into main Oct 15, 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.

1 participant