Files
cinny/src/app/plugins/call/forkHotkeyReport.test.ts
T
Lotus CIandClaude Opus 5.5 502b9dfd83
CI / Build & Quality Checks (push) Successful in 3m5s
CI / Docker image build & smoke test (push) Skipped
CI / Secret scan (gitleaks) (push) Successful in 9s
CI / Trigger Desktop Build (push) Successful in 8s
CI / Playwright smoke (e2e) (push) Successful in 12m42s
feat(call): stop injecting CSS and key listeners into the call frame (#43)
Pins @lotusguild/element-call-embedded 0.25.0-lotus.19.

- Styles: the fork now hides its own footer (`lotusHostControls=1`) and
  sets its root color-scheme from the theme, so the host no longer
  injects `#lotus-ec-styles` or sets inline styles on EC's DOM. The two
  other injected rules matched nothing in EC 0.25 (dead). The
  transparent background was already the fork's (`lotusTransparent`).
- Hotkeys: PTT / deafen keys pressed with focus inside the call frame now
  arrive as `io.lotus.hotkey` (the host sends the codes via
  `io.lotus.set_hotkeys`), instead of listeners on the frame's window.
  The window binding stays only for a fork that doesn't report `hotkeys`.
- Fixes (with lotus.19): pressing the deafen key M with focus in the call
  also hit EC's own "M = toggle mic" shortcut, so the first press turned
  the mic ON instead of deafening — even in push-to-talk mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
2026-09-26 14:35:44 -04:00

41 lines
1.2 KiB
TypeScript

import { test } from 'node:test';
import assert from 'node:assert/strict';
import { parseForkHotkeyReport } from './CallControl';
test('parseForkHotkeyReport: key reports keep only known boolean flags', () => {
assert.deepEqual(
parseForkHotkeyReport({
type: 'keydown',
code: 'Space',
repeat: false,
ctrlKey: false,
altKey: 'yes',
metaKey: false,
shiftKey: true,
editable: false,
interactive: true,
extra: 1,
}),
{
type: 'keydown',
code: 'Space',
repeat: false,
ctrlKey: false,
altKey: false,
metaKey: false,
shiftKey: true,
editable: false,
interactive: true,
},
);
assert.equal(parseForkHotkeyReport({ type: 'keyup', code: 'KeyM' })?.type, 'keyup');
});
test('parseForkHotkeyReport: focus reports and junk', () => {
assert.deepEqual(parseForkHotkeyReport({ type: 'focus' }), { type: 'focus' });
assert.equal(parseForkHotkeyReport({ type: 'keydown' }), null);
assert.equal(parseForkHotkeyReport({ type: 'click', code: 'Space' }), null);
assert.equal(parseForkHotkeyReport(null), null);
assert.equal(parseForkHotkeyReport('keydown'), null);
});