feat(overlay): run session help commands with Enter or double-click (#275)

This commit is contained in:
2026-09-29 18:48:56 -07:00
committed by GitHub
parent 4e43c5c6e1
commit 0bbd8617f4
16 changed files with 701 additions and 49 deletions
@@ -0,0 +1,27 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { IPC_CHANNELS } from '../../shared/ipc/contracts';
import { openSessionHelpModal } from './session-help-open';
test('session help open tells the renderer whether commands can run', async () => {
for (const playing of [true, false]) {
const sent: Array<{ channel: string; payload: unknown }> = [];
const opened = await openSessionHelpModal({
ensureOverlayStartupPrereqs: () => {},
ensureOverlayWindowsReadyForVisibilityActions: () => {},
sendToActiveOverlayWindow: (channel, payload) => {
sent.push({ channel, payload });
return true;
},
waitForModalOpen: async () => true,
logWarn: () => {},
isMediaPlaybackActive: () => playing,
});
assert.equal(opened, true);
assert.deepEqual(sent, [
{ channel: IPC_CHANNELS.event.sessionHelpOpen, payload: { commandsEnabled: playing } },
]);
}
});