mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
createVoiceControl now returns a presenter instead of building the control with innerHTML: the session, cost, input, card and panel owners write its state by part and listen for interactions, and VoiceControl.vue renders it in the command dock, between the location bar and the visual presets as before. Focus moves wait for the render; the waveform's bars publish apart from the control and only when they change; the minutes field keeps a draft until its owner writes it. Owner tests use a real presenter on their own store, and view tests render the control.
17 lines
575 B
JavaScript
17 lines
575 B
JavaScript
import { createPinia } from 'pinia';
|
|
import { useVoiceStore } from '../ui/stores/voice.js';
|
|
import { createVoiceControl } from '../voice/control.js';
|
|
|
|
/**
|
|
* A real voice control presenter on its own store, for owner tests that run
|
|
* without a page. Read what it shows from `ui.state`; report interactions
|
|
* with `ui.emit(name, ...args)`.
|
|
* @param {{panel?: boolean, pinia?: import('pinia').Pinia}} [options]
|
|
*/
|
|
export function createTestVoiceUi({
|
|
panel = false,
|
|
pinia = createPinia(),
|
|
} = {}) {
|
|
return createVoiceControl({ panel, store: useVoiceStore(pinia) });
|
|
}
|