feat: add mark-as-watched keybinding and Yomitan lookup tracking

Add configurable keybinding to mark the current video as watched with
IPC plumbing between renderer and main process. Add event listener
infrastructure for tracking Yomitan dictionary lookups per session.
This commit is contained in:
2026-03-17 19:52:43 -07:00
parent 75f2c212c7
commit a5a6426fe1
12 changed files with 222 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { YOMITAN_LOOKUP_EVENT, registerYomitanLookupListener } from './yomitan-popup.js';
test('registerYomitanLookupListener forwards the SubMiner Yomitan lookup event', () => {
const target = new EventTarget();
const calls: string[] = [];
const dispose = registerYomitanLookupListener(target, () => {
calls.push('lookup');
});
target.dispatchEvent(new CustomEvent(YOMITAN_LOOKUP_EVENT));
dispose();
target.dispatchEvent(new CustomEvent(YOMITAN_LOOKUP_EVENT));
assert.deepEqual(calls, ['lookup']);
});