feat(notifications): add overlay notifications with position config (#110)

This commit is contained in:
2026-06-10 22:46:52 -07:00
committed by GitHub
parent c09d009a3e
commit 7be1843c41
177 changed files with 7524 additions and 440 deletions
@@ -265,6 +265,23 @@ test('createConfigHotReloadMessageHandler mirrors message to OSD and desktop not
assert.deepEqual(calls, ['osd:Config reload failed', 'notify:SubMiner:Config reload failed']);
});
test('createConfigHotReloadMessageHandler routes message through configured notification surfaces', () => {
const calls: string[] = [];
const handleMessage = createConfigHotReloadMessageHandler({
getNotificationType: () => 'both',
showMpvOsd: (message) => calls.push(`osd:${message}`),
showOverlayNotification: (payload) =>
calls.push(`overlay:${payload.title}:${payload.body}:${payload.variant}`),
showDesktopNotification: (title, options) => calls.push(`notify:${title}:${options.body}`),
});
handleMessage('Config reload failed');
assert.deepEqual(calls, [
'overlay:SubMiner:Config reload failed:warning',
'notify:SubMiner:Config reload failed',
]);
});
test('buildRestartRequiredConfigMessage formats changed fields', () => {
assert.equal(
buildRestartRequiredConfigMessage(['websocket', 'subtitleStyle']),