Repository navigation
fix: reopen the last text, widen the column, strengthen the highlight - #23
Conversation
Three defects the side-by-side against the prototype turned up. **The library recorded which text was open and never read it back.** Every launch asked the reader to choose a text with one text in the list. `lastOpenedAt` has been written since M2 and nothing consumed it. Only a text that has actually been opened counts: falling back to the newest import would open a document the reader has never seen, which is a guess rather than a restore. Restored once per launch, not on every reload, because a reload follows every import and delete and would fight whatever the reader had just chosen. **The reading column was capped in points, which is the wrong unit.** 720 points gave 32 characters a line at 22pt and **15 characters at 48pt** — a column two words wide for exactly the reader who enlarged the text in order to read it more easily. The cap is now 40 characters, the top of the comfortable range for CJK, converted to points through the font size, which works because a Han glyph is one em wide. Measured on the running app: at 22pt the column goes from 713 to 876 points, and at 48pt from 713 to 1067, where it is now limited by the window rather than by the constant. **The revealed-word fill was too faint to read as a marker.** At 0.08 it composites to a 1.11:1 contrast ratio against white and 1.08:1 against the macOS dark background. Revealed is now 0.14 and selected 0.30, giving 1.20:1 and 1.49:1. I had reported that one as a dark-mode defect, and the measurement says otherwise: the two backgrounds differ by about 0.03, so one pair of values serves both and a `colorScheme` parameter would be ceremony around a rounding error. Revealed stays deliberately quiet — the reading printed above the word is the primary signal, and a page with two hundred revealed words should not become a wall of colour — while selection, which also carries a border, is the state that has to be unmistakable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PR Summary by QodoRestore the last-read text and improve reader layout and highlights
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you |
Three defects the side-by-side against the prototype turned up.
The library recorded which text was open and never read it back
Every launch asked the reader to choose a text with one text in the list.
lastOpenedAthas been written since M2 and nothing consumed it.Only a text that has actually been opened counts. Falling back to the newest import would open a document the reader has never seen, which is a guess rather than a restore. Restored once per launch rather than on every reload — a reload follows every import and delete, and re-selecting there would fight whatever the reader had just chosen.
The column was capped in points, which is the wrong unit
720 points gave 32 characters a line at 22pt and 15 characters at 48pt — a column two words wide for exactly the reader who enlarged the text in order to read it more easily.
The cap is now 40 characters, the top of the comfortable range for CJK, converted to points through the font size. That conversion works because a Han glyph is one em wide, which is the point of the square em.
Measured on the running app:
The revealed-word fill was too faint to read as a marker
At 0.08 it composites to 1.11:1 against white and 1.08:1 against the macOS dark background. Revealed is now 0.14 and selected 0.30 — 1.20:1 and 1.49:1.
I reported this one as a dark-mode defect and the measurement says otherwise: the two backgrounds differ by about 0.03, so one pair of values serves both, and a
colorSchemeparameter would be ceremony around a rounding error. The fill was simply too light everywhere.Revealed stays deliberately quiet. The reading printed above the word is the primary signal that it is revealed; the fill only has to make the set scannable, and a page where a reader has revealed two hundred words should not turn into a wall of colour. Selection, which also carries a border, is the state that has to be unmistakable.
Testing
Six new tests, each pinning the thing that went wrong rather than the fix:
All three verified on the running app, not only in tests: it now reopens 孔乙己 with no row clicked, and the column measurements above come from capturing the real window.
Local: 399 tests pass, lint clean, no warnings under
-warnings-as-errors, both app bundles build.🤖 Generated with Claude Code