feat(overlay): add loading OSD spinner and queue notifications until ren

- Show mpv OSD spinner from start-file until subminer-overlay-loading-ready; force-shown for visible-overlay startup regardless of osd_messages setting
- Gate non-macOS overlay visibility on content-ready so first subtitle line is immediately hoverable and clickable
- Queue startup notifications in main process until overlay window finishes loading; upsert progress cards by id to avoid cold-start floods
- Defer background warmups until after overlay runtime init so queued notifications can deliver promptly
- Preserve character dictionary checking/building/importing/ready phases as distinct history entries; route building and importing to system notifications when notificationType is both
This commit is contained in:
2026-06-07 23:13:51 -07:00
parent d033884b09
commit 9d77907877
49 changed files with 1613 additions and 132 deletions
@@ -146,6 +146,29 @@ function measuredRectsForInput(measurement: OverlayContentMeasurementLike): Poin
: [];
}
function hasMeasuredInputRects(measurement: OverlayContentMeasurementLike): boolean {
return measuredRectsForInput(measurement).some((rect) => rect.width > 0 && rect.height > 0);
}
export function shouldPrimeLinuxOverlayInteractionFromMeasurement(deps: {
getVisibleOverlayVisible: () => boolean;
getMainWindow: () => PointerInteractionWindow | null;
getSubtitleMeasurement: () => OverlayContentMeasurementLike;
shouldSuspend: () => boolean;
shouldSuppressInteraction?: () => boolean;
}): boolean {
if (!deps.getVisibleOverlayVisible()) return false;
if (deps.shouldSuspend()) return false;
const mainWindow = deps.getMainWindow();
if (!mainWindow || mainWindow.isDestroyed() || !mainWindow.isVisible()) {
return false;
}
if (deps.shouldSuppressInteraction?.()) return false;
return hasMeasuredInputRects(deps.getSubtitleMeasurement());
}
function clampRectToWindow(rect: PointerRect, bounds: PointerRect): PointerRect | null {
const left = Math.max(0, Math.floor(rect.x));
const top = Math.max(0, Math.floor(rect.y));