feat: integrate n+1 target highlighting

- Merge feature branch changes for n+1 target-only highlight flow

- Extend merged token model and token-merger to mark exactly-one unknown targets

- Thread n+1 candidate metadata through tokenizer and config systems

- Update subtitle renderer/state to route configured colors and new token class

- Resolve merge conflicts in core service tests, including subtitle and subsync behavior
This commit is contained in:
2026-02-15 02:36:48 -08:00
parent 88099e2ffa
commit 3a27c026b6
16 changed files with 494 additions and 66 deletions

View File

@@ -128,6 +128,8 @@ export const DEFAULT_CONFIG: ResolvedConfig = {
refreshMinutes: 1440,
matchMode: "headword",
decks: [],
nPlusOne: "#c6a0f6",
knownWord: "#a6da95",
},
metadata: {
pattern: "[SubMiner] %f (%t)",
@@ -179,6 +181,8 @@ export const DEFAULT_CONFIG: ResolvedConfig = {
fontWeight: "normal",
fontStyle: "normal",
backgroundColor: "rgba(54, 58, 79, 0.5)",
nPlusOneColor: "#c6a0f6",
knownWordColor: "#a6da95",
secondary: {
fontSize: 24,
fontColor: "#ffffff",
@@ -321,6 +325,18 @@ export const CONFIG_OPTION_REGISTRY: ConfigOptionRegistryEntry[] = [
description:
"Decks used for N+1 known-word cache scope. Supports one or more deck names.",
},
{
path: "ankiConnect.nPlusOne.nPlusOne",
kind: "string",
defaultValue: DEFAULT_CONFIG.ankiConnect.nPlusOne.nPlusOne,
description: "Color used for the single N+1 target token highlight.",
},
{
path: "ankiConnect.nPlusOne.knownWord",
kind: "string",
defaultValue: DEFAULT_CONFIG.ankiConnect.nPlusOne.knownWord,
description: "Color used for legacy known-word highlights.",
},
{
path: "ankiConnect.isKiku.fieldGrouping",
kind: "enum",