feat(anki): add runtime toggle for media timing review

- Add session-only runtime option with live config hot-reload support
- Document the runtime palette toggle
This commit is contained in:
2026-08-30 01:56:16 -07:00
parent 475f81d96d
commit f36e7f6182
14 changed files with 57 additions and 6 deletions
+16
View File
@@ -82,3 +82,19 @@ test('RuntimeOptionsManager keeps known-word and n+1 annotation toggles separate
assert.equal(effective.nPlusOne?.enabled, true);
assert.deepEqual(patches, []);
});
test('RuntimeOptionsManager applies media timing review to the live Anki config', () => {
const baseConfig = structuredClone(DEFAULT_CONFIG.ankiConnect);
const patches: unknown[] = [];
const manager = new RuntimeOptionsManager(() => structuredClone(baseConfig), {
applyAnkiPatch: (patch) => {
patches.push(patch);
},
onOptionsChanged: () => undefined,
});
assert.equal(manager.getOptionValue('anki.mediaReviewTiming'), false);
assert.equal(manager.setOptionValue('anki.mediaReviewTiming', true).ok, true);
assert.equal(manager.getEffectiveAnkiConnectConfig().media?.reviewTiming, true);
assert.deepEqual(patches, [{ media: { reviewTiming: true } }]);
});