feat(anki): add media timing review before card creation (#203)

This commit is contained in:
2026-09-04 01:40:56 -07:00
committed by GitHub
parent 99266294b8
commit 84f718043a
78 changed files with 7022 additions and 135 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 } }]);
});