mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-30 12:15:26 -07:00
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:
@@ -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 } }]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user