Tap a word in a Cue, see its Entry #9

Closed
opened 2026-08-10 09:26:17 +00:00 by aiko · 1 comment
Owner

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

  • Tapping a character in a Cue resolves to that character's offset in the Cue text
  • A tap that lands on a word JMdict holds opens the sheet showing its Entry
  • The sheet shows Headword, reading, and senses
  • JMdict / EDRDG attribution is visible whenever an Entry is on screen
  • Dismissing the sheet returns to the transcript
  • A tap that matches nothing does not open the sheet
  • Offset resolution is covered by tests that do not need a browser gesture

Blocked by

## 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 - [ ] Tapping a character in a Cue resolves to that character's offset in the Cue text - [ ] A tap that lands on a word JMdict holds opens the sheet showing its Entry - [ ] The sheet shows Headword, reading, and senses - [ ] JMdict / EDRDG attribution is visible whenever an Entry is on screen - [ ] Dismissing the sheet returns to the transcript - [ ] A tap that matches nothing does not open the sheet - [ ] Offset resolution is covered by tests that do not need a browser gesture ## Blocked by - #8
Author
Owner

This was generated by AI during triage.

Merged to main in 168b131.

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 structural CaretPositionLike, 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: node and adding jsdom for one assertion was not worth a dependency nothing else here uses.

> *This was generated by AI during triage.* Merged to `main` in 168b131. 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 structural `CaretPositionLike`, 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: node` and adding jsdom for one assertion was not worth a dependency nothing else here uses.
aiko closed this issue 2026-08-10 10:59:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mobrule/kurageyomi#9
No description provided.