2.7 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-318 | Keep JLPT underline color fixed after lookup selection | Done |
|
2026-05-03 03:17 | 2026-05-03 03:19 |
|
medium |
Description
Looking up a subtitle token can leave browser/Yomitan selection styling active. If that token has a JLPT class and another annotation class, the underline must remain the JLPT level color because underline color represents static JLPT classification, not the currently active annotation or lookup state.
Acceptance Criteria
- #1 JLPT subtitle underlines retain their configured N1-N5 color after lookup/selection styling is applied.
- #2 JLPT tokens that also have known, N+1, name, or frequency annotation classes keep their annotation text color behavior without changing the JLPT underline color.
- #3 Renderer regression coverage verifies the CSS contract for the combined JLPT plus annotation case.
Implementation Plan
- Add a focused CSS regression in
src/renderer/subtitle-render.test.tsfor JLPT tokens combined with higher-priority annotation classes and lookup/selection styling. - Run the focused renderer test and confirm it fails because selection rules do not lock
text-decoration-color. - Update
src/renderer/style.cssto explicitly preserve JLPT underline decoration color in lookup/selection state selectors without changing text color priority. - Re-run the focused renderer test, then run the smallest relevant verification gate.
Implementation Notes
Verified TDD red/green for renderer CSS contract: bun test src/renderer/subtitle-render.test.ts first failed because word-jlpt-n1::selection lock was missing, then passed after adding explicit JLPT text-decoration-color selection rules. Also ran bun run changelog:lint and bun run typecheck successfully.
Final Summary
Fixed JLPT subtitle underline color drift after dictionary lookup/selection by adding explicit ::selection decoration-color locks for N1-N5 token classes in src/renderer/style.css. This preserves the JLPT underline as static classification while leaving known/N+1/name/frequency text color priority intact.
Added renderer CSS regression coverage for the JLPT selection lock and a user-visible changelog fragment.
Checks: bun test src/renderer/subtitle-render.test.ts; bun run changelog:lint; bun run typecheck.