refactor(notifications): extract routing predicates and fix pre-overlay

- Extract shouldShowOsd/Overlay/Desktop into notification-routing.ts (was duplicated in 3 files)
- Add resolveOverlayReadinessNotificationType: preserves system channel when overlay not ready (both→osd-system, system→system, overlay→osd)
- Route overlay loading status through showConfiguredStatusNotification instead of raw OSD
This commit is contained in:
2026-06-04 22:24:56 -07:00
parent 9247248d48
commit a01fc57053
7 changed files with 94 additions and 48 deletions
+1 -12
View File
@@ -1,4 +1,5 @@
import type { NotificationType, OverlayNotificationPayload } from '../../types/notification';
import { shouldShowDesktop, shouldShowOverlay, shouldShowOsd } from './notification-routing';
export interface StartupOsdSequencerCharacterDictionaryEvent {
phase: 'checking' | 'generating' | 'syncing' | 'building' | 'importing' | 'ready' | 'failed';
@@ -21,18 +22,6 @@ interface StartupStatusNotificationOptions {
desktop?: boolean;
}
function shouldShowOsd(type: NotificationType): boolean {
return type === 'osd' || type === 'osd-system';
}
function shouldShowOverlay(type: NotificationType): boolean {
return type === 'overlay' || type === 'both';
}
function shouldShowDesktop(type: NotificationType): boolean {
return type === 'system' || type === 'both' || type === 'osd-system';
}
export function createStartupOsdSequencer(deps: StartupOsdSequencerDeps): {
reset: () => void;
showTokenizationLoading: (message: string) => void;