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

@@ -313,7 +313,7 @@ test("runSubsyncManualService resolves string sid values from mpv stream propert
writeExecutableScript(alassPath, "#!/bin/sh\nexit 0\n");
writeExecutableScript(
ffsubsyncPath,
`#!/bin/sh\n: > "${ffsubsyncLogPath}"\nfor arg in "$@"; do\n printf '%s\\n' "$arg" >> "${ffsubsyncLogPath}"\ndone\nprev=""\nfor arg in "$@"; do\n if [ "$prev" = "-o" ]; then\n : > "$arg"\n fi\n prev="$arg"\ndone`,
`#!/bin/sh\nmkdir -p "${tmpDir}"\n: > "${ffsubsyncLogPath}"\nfor arg in "$@"; do printf '%s\\n' "$arg" >> "${ffsubsyncLogPath}"; done\nprev=""\nout=""\nfor arg in "$@"; do\n if [ "$prev" = "--reference-stream" ]; then :; fi\n if [ "$prev" = "-o" ]; then out="$arg"; fi\n prev="$arg"\ndone\nif [ -n "$out" ]; then : > "$out"; fi`,
);
const deps = makeDeps({
@@ -354,9 +354,11 @@ test("runSubsyncManualService resolves string sid values from mpv stream propert
assert.equal(result.ok, true);
assert.equal(result.message, "Subtitle synchronized with ffsubsync");
const ffsubsyncArgs = fs.readFileSync(ffsubsyncLogPath, "utf8").trim().split("\n");
const outputIndex = ffsubsyncArgs.findIndex((value) => value === "-o");
assert.ok(outputIndex >= 0);
const outputPath = ffsubsyncArgs[outputIndex + 1];
const ffArgs = fs.readFileSync(ffsubsyncLogPath, "utf8").trim().split("\n");
const syncOutputIndex = ffArgs.indexOf("-o");
assert.equal(syncOutputIndex >= 0, true);
const outputPath = ffArgs[syncOutputIndex + 1];
assert.equal(typeof outputPath, "string");
assert.ok(outputPath.length > 0);
assert.equal(fs.readFileSync(outputPath, "utf8"), "");
});