fix(anki): prevent media timing review hangs and invalid ranges

- Reject stale or invalid timing actions
- Fall back to original timing when the renderer stops responding
This commit is contained in:
2026-08-30 01:56:16 -07:00
parent ca27a4275f
commit ec6a106748
8 changed files with 185 additions and 29 deletions
+1
View File
@@ -494,6 +494,7 @@ function createKeyboardHandlerHarness() {
handleKikuKeydown: () => false,
handleJimakuKeydown: () => false,
handleTsukihimeKeydown: () => false,
handleMediaTimingReviewKeydown: () => false,
handleControllerSelectKeydown: () => {
controllerSelectKeydownCount += 1;
return true;
+2 -2
View File
@@ -18,7 +18,7 @@ export function createKeyboardHandlers(
handleJimakuKeydown: (e: KeyboardEvent) => boolean;
handleTsukihimeKeydown: (e: KeyboardEvent) => boolean;
handleYoutubePickerKeydown: (e: KeyboardEvent) => boolean;
handleMediaTimingReviewKeydown?: (e: KeyboardEvent) => boolean;
handleMediaTimingReviewKeydown: (e: KeyboardEvent) => boolean;
handlePlaylistBrowserKeydown: (e: KeyboardEvent) => boolean;
handleControllerSelectKeydown: (e: KeyboardEvent) => boolean;
handleControllerDebugKeydown: (e: KeyboardEvent) => boolean;
@@ -1080,7 +1080,7 @@ export function createKeyboardHandlers(
document.addEventListener('keydown', (e: KeyboardEvent) => {
if (ctx.state.mediaTimingReviewModalOpen) {
options.handleMediaTimingReviewKeydown?.(e);
options.handleMediaTimingReviewKeydown(e);
return;
}