feat: stabilize startup sync and overlay/runtime paths

This commit is contained in:
2026-03-17 00:48:55 -07:00
parent de574c04bd
commit 11710f20db
69 changed files with 5323 additions and 495 deletions

View File

@@ -3,6 +3,7 @@ import test from 'node:test';
import {
buildStatsWindowLoadFileOptions,
buildStatsWindowOptions,
promoteStatsWindowLevel,
shouldHideStatsWindowForInput,
} from './stats-window-runtime';
@@ -149,3 +150,50 @@ test('buildStatsWindowLoadFileOptions includes provided stats API base URL', ()
},
});
});
test('promoteStatsWindowLevel raises stats above overlay level on macOS', () => {
const calls: string[] = [];
promoteStatsWindowLevel(
{
setAlwaysOnTop: (flag: boolean, level?: string, relativeLevel?: number) => {
calls.push(`always-on-top:${flag}:${level ?? 'none'}:${relativeLevel ?? 0}`);
},
setVisibleOnAllWorkspaces: (visible: boolean, options?: { visibleOnFullScreen?: boolean }) => {
calls.push(
`all-workspaces:${visible}:${options?.visibleOnFullScreen === true ? 'fullscreen' : 'plain'}`,
);
},
setFullScreenable: (fullscreenable: boolean) => {
calls.push(`fullscreenable:${fullscreenable}`);
},
moveTop: () => {
calls.push('move-top');
},
} as never,
'darwin',
);
assert.deepEqual(calls, [
'always-on-top:true:screen-saver:2',
'all-workspaces:true:fullscreen',
'fullscreenable:false',
'move-top',
]);
});
test('promoteStatsWindowLevel raises stats above overlay level on Windows', () => {
const calls: string[] = [];
promoteStatsWindowLevel(
{
setAlwaysOnTop: (flag: boolean, level?: string, relativeLevel?: number) => {
calls.push(`always-on-top:${flag}:${level ?? 'none'}:${relativeLevel ?? 0}`);
},
moveTop: () => {
calls.push('move-top');
},
} as never,
'win32',
);
assert.deepEqual(calls, ['always-on-top:true:screen-saver:2', 'move-top']);
});