Files
SubMiner/backlog/tasks/task-98 - Gate-subtitle-character-name-highlighting-on-character-dictionary-enablement.md
sudacode 4d60f64bea Gate subtitle name highlighting on character dictionary setting
- Disable `getNameMatchEnabled` when `anilist.characterDictionary.enabled` is false
- Wire character-dictionary enablement into main subtitle tokenization deps
- Add runtime deps test coverage and record task/plan docs
2026-03-06 17:13:56 -08:00

3.2 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, references, priority
id title status assignee created_date updated_date labels dependencies references priority
TASK-98 Gate subtitle character-name highlighting on character dictionary enablement Done
codex
2026-03-07 00:54 2026-03-07 00:56
subtitle
character-dictionary
/Users/sudacode/projects/japanese/SubMiner/src/main.ts
/Users/sudacode/projects/japanese/SubMiner/src/core/services/tokenizer.ts
/Users/sudacode/projects/japanese/SubMiner/src/config/definitions/defaults-subtitle.ts
medium

Description

Ensure subtitle tokenization and other annotations continue to work, but character-name lookup/highlighting is disabled whenever the AniList character dictionary feature is disabled. This avoids unnecessary name-match processing when the backing dictionary is unavailable.

Acceptance Criteria

  • #1 When anilist.characterDictionary.enabled is false, subtitle tokenization does not request character-name match metadata or highlight character names.
  • #2 When anilist.characterDictionary.enabled is true and subtitleStyle.nameMatchEnabled is true, existing character-name matching behavior remains enabled.
  • #3 Subtitle tokenization, JLPT, frequency, and other non-name annotation behavior remain unchanged when character dictionaries are disabled.
  • #4 Automated tests cover the runtime gating behavior.

Implementation Plan

  1. Add a failing test in src/main/runtime/subtitle-tokenization-main-deps.test.ts proving name-match enablement resolves to false when anilist.characterDictionary.enabled is false even if subtitleStyle.nameMatchEnabled is true.
  2. Update src/main/runtime/subtitle-tokenization-main-deps.ts and src/main.ts so subtitle tokenization only enables name matching when both the subtitle setting and the character dictionary setting are enabled.
  3. Run focused Bun tests for the updated runtime deps and subtitle processing seams.
  4. If verification stays green, check off acceptance criteria and record the result.

Implementation plan saved in docs/plans/2026-03-06-character-name-gating.md.

Implementation Notes

Created plan doc docs/plans/2026-03-06-character-name-gating.md after user approved the narrow runtime-gating approach. Proceeding with TDD from the subtitle tokenization main-deps seam.

Implemented the gate at the subtitle tokenization runtime-deps boundary so getNameMatchEnabled is false unless both subtitleStyle.nameMatchEnabled and anilist.characterDictionary.enabled are true.

Verification: bun test src/main/runtime/subtitle-tokenization-main-deps.test.ts, bun test src/core/services/subtitle-processing-controller.test.ts, bun run typecheck.

Final Summary

Character-name lookup/highlighting is now suppressed when the AniList character dictionary is disabled, while subtitle tokenization and other annotation paths remain active. Added focused runtime-deps coverage and wired the main runtime to pass the character-dictionary enabled flag into subtitle tokenization.