Tap a word in a Cue, see its Entry #9
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mobrule/kurageyomi#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#1
What to build
The first end-to-end Lookup. Tapping a character in a Cue on the phone resolves the tap to a character offset, sends the text from that point as a single Candidate, and shows the Entry the plugin returns in a sheet at the bottom of the screen. Dismissing the sheet closes it.
Exact match only — no deinflection in this slice. Tapping 学校 finds 学校; tapping 食べさせられなかった finds nothing. That is deliberate: it proves tap resolution, the request, and the sheet all work while the Deinflector is still untouched, so a broken tap offset is diagnosed before any Japanese is involved.
Tap resolution uses
document.caretPositionFromPoint. The Cue stays a single text node — no per-character spans. Chrome on Android is the only target, so no fallback is needed.The sheet shows the Headword, its reading, and its senses, with the JMdict / EDRDG attribution line at its foot. Attribution is a licence obligation and ships with the first Entry ever displayed, not later (ADR 0004).
Acceptance criteria
Blocked by
Merged to
mainin168b131.Tapping a character in a Cue resolves to its offset via
caretPositionFromPoint, scans forward for an exact match, and opens the sheet with the Entry. The Cue stays a single text node — no per-character spans.Exact match only, as specified: 学校 resolves, 食べさせられなかった does not. That boundary is pinned by a test so #11 could not silently blur it.
The seam is
tappedCharacter(caret)taking a structuralCaretPositionLike, so tap resolution is tested with plain objects and no browser gesture. 18 tests.Two fixes beyond the criteria, both real: the EDRDG attribution could scroll out of a long sheet — a licence problem, not a cosmetic one — so it is now
position: sticky; and two quick taps could land out of order, now guarded by a sequence number."Dismissing the sheet returns to the transcript" is not tested. vitest runs
environment: nodeand adding jsdom for one assertion was not worth a dependency nothing else here uses.