Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions apps/desktop/src/components/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import {
import { useComposerAttachments } from "../features/chat/composer/hooks/useComposerAttachments";
import { useComposerDraft } from "../features/chat/composer/hooks/useComposerDraft";
import { useComposerSubmit } from "../features/chat/composer/hooks/useComposerSubmit";
import { useComposerSpeech } from "../features/chat/composer/hooks/useComposerSpeech";
import { ComposerInput } from "../features/chat/composer/ComposerInput";
import { useComposerModelMenu } from "../features/chat/composer/hooks/useComposerModelMenu";
import { ComposerToolbar } from "../features/chat/composer/ComposerToolbar";
Expand Down Expand Up @@ -437,16 +436,6 @@ export function Composer({
submit,
} = submitController;

const speech = useComposerSpeech({
activeSessionId,
value,
enhancementDraft,
activeFileReferences,
applyEditorDraft,
t,
showToast,
controlsBlocked,
});
const composerAc = useComposerAutocomplete({
value,
cursor,
Expand Down Expand Up @@ -617,12 +606,6 @@ export function Composer({
clearEnhancementError={clearEnhancementError}
runActive={runActive}
hasDraftContent={hasDraftContent}
transcribeEnabled={speech.transcribeEnabled}
speakEnabled={speech.speakEnabled}
transcribing={speech.transcribing}
speaking={speech.speaking}
transcribe={speech.transcribe}
speak={speech.speak}
abort={abort}
submit={submit}
/>
Expand Down
36 changes: 0 additions & 36 deletions apps/desktop/src/features/chat/composer/ComposerToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {
IconSparkles,
IconStop,
IconUndo2,
IconMic,
IconAudio,
} from "../../../components/icons";
import { ModeIcon } from "./ComposerModeIcon";
import { ComposerModelPicker } from "./ComposerModelPicker";
Expand Down Expand Up @@ -64,12 +62,6 @@ export type ComposerToolbarProps = {
clearEnhancementError: () => void;
runActive: boolean;
hasDraftContent: boolean;
transcribeEnabled: boolean;
speakEnabled: boolean;
transcribing: boolean;
speaking: boolean;
transcribe: () => Promise<void>;
speak: () => Promise<void>;
abort: AppState["abort"];
submit: () => Promise<void>;
};
Expand Down Expand Up @@ -105,12 +97,6 @@ export function ComposerToolbar({
clearEnhancementError,
runActive,
hasDraftContent,
transcribeEnabled,
speakEnabled,
transcribing,
speaking,
transcribe,
speak,
abort,
submit,
}: ComposerToolbarProps) {
Expand Down Expand Up @@ -257,28 +243,6 @@ export function ComposerToolbar({
controlsBlocked={controlsBlocked}
onCloseOtherMenus={() => setPermissionOpen(false)}
/>
<TooltipButton
type="button"
className={`icon-btn icon-btn-square${transcribing ? " is-loading" : ""}`}
tooltip={t("chat.transcribe")}
ariaLabel={transcribing ? t("chat.transcribing") : t("chat.transcribe")}
aria-busy={transcribing}
disabled={!transcribeEnabled || transcribing || speaking}
onClick={() => void transcribe()}
>
{transcribing ? <span className="tool-spinner" aria-hidden="true" /> : <IconMic size={15} aria-hidden="true" />}
</TooltipButton>
<TooltipButton
type="button"
className={`icon-btn icon-btn-square${speaking ? " is-loading" : ""}`}
tooltip={t("chat.speak")}
ariaLabel={speaking ? t("chat.speaking") : t("chat.speak")}
aria-busy={speaking}
disabled={!speakEnabled || speaking || transcribing}
onClick={() => void speak()}
>
{speaking ? <span className="tool-spinner" aria-hidden="true" /> : <IconAudio size={15} aria-hidden="true" />}
</TooltipButton>
<TooltipButton
type="button"
className={`icon-btn icon-btn-square composer-enhance-btn${enhancingPrompt ? " is-loading" : ""}`}
Expand Down
115 changes: 0 additions & 115 deletions apps/desktop/src/features/chat/composer/hooks/useComposerSpeech.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/desktop/test/speech-capability.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { readComposerSource } from "./helpers/source-contracts.mjs";
import assert from "node:assert/strict";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { register } from "node:module";
Expand Down Expand Up @@ -28,15 +27,6 @@ test("speech IPC is on the typed whitelist and renderer API", async () => {
assert.match(registerSrc, /registerSpeechIpc/);
});

test("Composer disables voice actions until speech is configured", async () => {
const composer = await readComposerSource();
assert.match(composer, /status\?\.transcribe\.available/);
assert.match(composer, /status\?\.synthesize\.available/);
assert.match(composer, /disabled=\{!transcribeEnabled \|\| transcribing \|\| speaking\}/);
assert.match(composer, /disabled=\{!speakEnabled \|\| speaking \|\| transcribing\}/);
assert.match(composer, /api\.speechTranscribe/);
assert.match(composer, /api\.speechSynthesize/);
});

test("settings reject an illegal speech protocol id", async () => {
const { validateSpeechSettings } = await import("@pi-desktop/shared");
Expand Down