feat: Add UI optional UI locking when microphone is hot (#2484)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:12 -07:00
committed by dermotduffy
parent 9a763db1f3
commit be7e7d79dc
45 changed files with 922 additions and 53 deletions
@@ -386,7 +386,7 @@ describe('MediaGridController', () => {
).toBe('3');
});
it('should select cell when interacted with', () => {
it('should dispatch a selection request when interacted with', () => {
const children = createChildren();
const parent = createParent({ children: children, width: 2000 });
const controller = createController(parent);
@@ -396,11 +396,18 @@ describe('MediaGridController', () => {
const clickHandler = vi.fn();
parent.addEventListener('click', clickHandler);
const selectedHandler = vi.fn();
parent.addEventListener('advanced-camera-card:media-grid:selected', selectedHandler);
children[1].click();
// Click will not be allowed through.
// Click is consumed; the controller dispatches the selection request but
// does NOT mutate local state. The authoritative selection is applied by
// the parent via `selectCell` once it propagates back.
expect(clickHandler).not.toBeCalled();
expect(controller.getSelected()).toBe('1');
expect(selectedHandler).toBeCalledTimes(1);
expect(selectedHandler.mock.calls[0][0].detail).toEqual({ selected: '1' });
expect(controller.getSelected()).toBeNull();
});
it('should ignore interaction events on already selected cell', () => {