mirror of
https://github.com/block/buzz.git
synced 2026-12-01 13:42:45 +00:00
Polish Huddle voice controls (#4694)
## Summary - add a visible Stop control for interrupting agent speech - make push-to-talk available by default while preserving manual mute controls - refine agent management, muted audio states, drawer layering, and return navigation - suppress duplicate notification sounds for Huddle messages ## Why Huddles could trap users behind long agent speech, hide useful agent controls, and leave temporary Huddle state visible after the call. The drawer also regressed when the terminal substrate began painting behind the rounded app surface. ## Validation - `just desktop-ci` - focused Huddle Playwright coverage for the drawer, speech interruption, agent picker, and leave navigation --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -266,6 +266,8 @@ type E2eConfig = {
|
||||
parent_added: boolean;
|
||||
parent_error: string | null;
|
||||
};
|
||||
/** When set, the mocked `add_agent_to_huddle` command throws. */
|
||||
addAgentToHuddleError?: string;
|
||||
/** Delay an invocation-time huddle snapshot to exercise hydration ordering. */
|
||||
huddleStateReadDelayMs?: number;
|
||||
/** Delay companion creation to expose the newly-started huddle handoff state. */
|
||||
@@ -3043,7 +3045,7 @@ type MockHuddleState = {
|
||||
tts_enabled: boolean;
|
||||
transcription_enabled: boolean;
|
||||
is_creator: boolean;
|
||||
voice_input_mode: "voice_activity";
|
||||
voice_input_mode: "push_to_talk" | "voice_activity";
|
||||
};
|
||||
|
||||
type PersistedMockHuddle = {
|
||||
@@ -3158,7 +3160,7 @@ function initializeMockHuddle(
|
||||
tts_enabled: seed.ttsEnabled ?? false,
|
||||
transcription_enabled: seed.transcriptionEnabled ?? false,
|
||||
is_creator: seed.isCreator ?? true,
|
||||
voice_input_mode: "voice_activity",
|
||||
voice_input_mode: "push_to_talk",
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -10208,6 +10210,21 @@ export function maybeInstallE2eTauriMocks() {
|
||||
}
|
||||
return snapshot;
|
||||
}
|
||||
case "get_voice_input_mode":
|
||||
return mockHuddle?.state.voice_input_mode ?? "push_to_talk";
|
||||
case "set_voice_input_mode": {
|
||||
if (!mockHuddle) throw new Error("No active mock huddle.");
|
||||
const mode = (payload as { mode?: unknown }).mode;
|
||||
if (mode !== "push_to_talk" && mode !== "voice_activity") {
|
||||
throw new Error("Missing voice input mode.");
|
||||
}
|
||||
mockHuddle.state.voice_input_mode = mode;
|
||||
persistMockHuddle();
|
||||
await emitMockHuddleState();
|
||||
return null;
|
||||
}
|
||||
case "set_huddle_manual_mic_unmuted":
|
||||
return null;
|
||||
case "get_huddle_agent_pubkeys":
|
||||
if (!mockHuddle) return [];
|
||||
return [...mockHuddle.state.agent_pubkeys];
|
||||
@@ -10239,7 +10256,7 @@ export function maybeInstallE2eTauriMocks() {
|
||||
tts_enabled: false,
|
||||
transcription_enabled: false,
|
||||
is_creator: true,
|
||||
voice_input_mode: "voice_activity",
|
||||
voice_input_mode: "push_to_talk",
|
||||
},
|
||||
};
|
||||
refreshMockHuddleMembership(activeConfig);
|
||||
@@ -10333,7 +10350,7 @@ export function maybeInstallE2eTauriMocks() {
|
||||
tts_enabled: false,
|
||||
transcription_enabled: false,
|
||||
is_creator: false,
|
||||
voice_input_mode: "voice_activity",
|
||||
voice_input_mode: "push_to_talk",
|
||||
});
|
||||
return null;
|
||||
case "set_huddle_transcription_enabled":
|
||||
@@ -10414,12 +10431,33 @@ export function maybeInstallE2eTauriMocks() {
|
||||
return { matched_active_huddle: true, added };
|
||||
}
|
||||
case "add_agent_to_huddle": {
|
||||
const error = activeConfig?.mock?.addAgentToHuddleError;
|
||||
if (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
const result = activeConfig?.mock?.addAgentToHuddleResult;
|
||||
if (!result) {
|
||||
throw new Error("No mock add-agent result configured.");
|
||||
}
|
||||
return structuredClone(result);
|
||||
}
|
||||
case "remove_agent_from_huddle": {
|
||||
const agentPubkey = (payload as { agentPubkey?: string })?.agentPubkey;
|
||||
if (!mockHuddle || !agentPubkey) {
|
||||
throw new Error("No active huddle agent to remove.");
|
||||
}
|
||||
const initialCount = mockHuddle.members.length;
|
||||
mockHuddle.members = mockHuddle.members.filter(
|
||||
(member) => member.role !== "bot" || member.pubkey !== agentPubkey,
|
||||
);
|
||||
if (mockHuddle.members.length === initialCount) {
|
||||
throw new Error("Agent is not in this huddle.");
|
||||
}
|
||||
refreshMockHuddleMembership(activeConfig);
|
||||
persistMockHuddle();
|
||||
await emitMockHuddleState();
|
||||
return;
|
||||
}
|
||||
case "get_model_status":
|
||||
return { stt: "ready", tts: "ready" };
|
||||
case "get_tts_settings":
|
||||
@@ -10552,6 +10590,8 @@ export function maybeInstallE2eTauriMocks() {
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
case "interrupt_huddle_speech":
|
||||
return;
|
||||
case "set_pocket_voice": {
|
||||
const voiceKey = (payload as { voiceKey?: string })?.voiceKey;
|
||||
if (!voiceKey) throw new Error("Missing Pocket voice key");
|
||||
|
||||
Reference in New Issue
Block a user