Route OSD notifications through overlay with mpv fallback

- Add main/renderer overlay notification pipeline with loading-state support
- Preserve notificationType semantics across osd/system/both/none routing
- Update plugin fallback behavior, docs/config examples, and regression tests
This commit is contained in:
2026-03-16 00:52:13 -07:00
parent e35aac6ee0
commit fbfd688109
30 changed files with 882 additions and 81 deletions

View File

@@ -60,7 +60,7 @@ test('auto sync notifications send osd updates for progress phases', () => {
]);
});
test('auto sync notifications never send desktop notifications', () => {
test('auto sync notifications send desktop notifications when the type includes system', () => {
const calls: string[] = [];
notifyCharacterDictionaryAutoSyncStatus(makeEvent('syncing', 'syncing'), {
@@ -88,5 +88,27 @@ test('auto sync notifications never send desktop notifications', () => {
calls.push(`desktop:${title}:${options.body ?? ''}`),
});
assert.deepEqual(calls, ['osd:syncing', 'osd:importing', 'osd:ready', 'osd:failed']);
assert.deepEqual(calls, [
'osd:syncing',
'desktop:SubMiner:syncing',
'osd:importing',
'desktop:SubMiner:importing',
'osd:ready',
'desktop:SubMiner:ready',
'osd:failed',
'desktop:SubMiner:failed',
]);
});
test('auto sync notifications respect system-only mode', () => {
const calls: string[] = [];
notifyCharacterDictionaryAutoSyncStatus(makeEvent('syncing', 'syncing'), {
getNotificationType: () => 'system',
showOsd: (message) => calls.push(`osd:${message}`),
showDesktopNotification: (title, options) =>
calls.push(`desktop:${title}:${options.body ?? ''}`),
});
assert.deepEqual(calls, ['desktop:SubMiner:syncing']);
});