mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-25 00:11:26 -07:00
- Add default `f` fullscreen overlay binding and switch default AniSkip skip key to `Tab` - Make character-dictionary auto-sync non-blocking at startup with tokenization gating for Yomitan mutations - Add ordered startup OSD progress (checking/generating/updating/importing), refresh current subtitle on sync completion, and extend regression tests
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import type { CharacterDictionaryAutoSyncStatusEvent } from './character-dictionary-auto-sync';
|
|
import type { StartupOsdSequencerCharacterDictionaryEvent } from './startup-osd-sequencer';
|
|
|
|
export type CharacterDictionaryAutoSyncNotificationEvent = CharacterDictionaryAutoSyncStatusEvent;
|
|
|
|
export interface CharacterDictionaryAutoSyncNotificationDeps {
|
|
getNotificationType: () => 'osd' | 'system' | 'both' | 'none' | undefined;
|
|
showOsd: (message: string) => void;
|
|
showDesktopNotification: (title: string, options: { body?: string }) => void;
|
|
startupOsdSequencer?: {
|
|
notifyCharacterDictionaryStatus: (event: StartupOsdSequencerCharacterDictionaryEvent) => void;
|
|
};
|
|
}
|
|
|
|
function shouldShowOsd(type: 'osd' | 'system' | 'both' | 'none' | undefined): boolean {
|
|
return type !== 'none';
|
|
}
|
|
|
|
export function notifyCharacterDictionaryAutoSyncStatus(
|
|
event: CharacterDictionaryAutoSyncNotificationEvent,
|
|
deps: CharacterDictionaryAutoSyncNotificationDeps,
|
|
): void {
|
|
const type = deps.getNotificationType();
|
|
if (shouldShowOsd(type)) {
|
|
if (deps.startupOsdSequencer) {
|
|
deps.startupOsdSequencer.notifyCharacterDictionaryStatus({
|
|
phase: event.phase,
|
|
message: event.message,
|
|
});
|
|
return;
|
|
}
|
|
deps.showOsd(event.message);
|
|
}
|
|
}
|