mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(vscode): address speech-to-text review findings
This commit is contained in:
@@ -20,7 +20,7 @@ export async function routeInputToolMessage(message: Msg, ctx: Ctx): Promise<boo
|
||||
if (await routeAutocompleteMessage(message, ctx.post)) return true
|
||||
|
||||
if (message.type === "speechToTextPrewarm") {
|
||||
void prewarmSpeechCapture().catch((err) => console.warn("[Kilo New] Speech capture prewarm failed:", err))
|
||||
void prewarmSpeechCapture().catch((err: unknown) => console.warn("[Kilo New] Speech capture prewarm failed:", err))
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -235,10 +235,10 @@ function requireActive(requestId: string): Recording {
|
||||
}
|
||||
|
||||
async function resolveFFmpeg(): Promise<string> {
|
||||
if (ffmpeg) {
|
||||
const bin = await ffmpeg
|
||||
const cached = ffmpeg
|
||||
if (cached) {
|
||||
const bin = await cached
|
||||
if (!path.isAbsolute(bin) || existsSync(bin)) return bin
|
||||
ffmpeg = undefined
|
||||
}
|
||||
|
||||
const task = findFFmpeg()
|
||||
|
||||
+3
-2
@@ -13,6 +13,7 @@ type Props = {
|
||||
|
||||
export const SpeechToTextButton: Component<Props> = (props) => {
|
||||
const unavailable = () => !!props.disabled && props.speech.state() === "idle"
|
||||
const locked = () => unavailable() || props.speech.state() === "starting"
|
||||
const busy = () => props.speech.state() === "starting" || props.speech.state() === "transcribing"
|
||||
const label = () => {
|
||||
if (props.speech.state() === "starting") return props.label("speechToText.tooltip.starting")
|
||||
@@ -50,9 +51,9 @@ export const SpeechToTextButton: Component<Props> = (props) => {
|
||||
variant="ghost"
|
||||
size="small"
|
||||
onClick={click}
|
||||
disabled={unavailable()}
|
||||
disabled={locked()}
|
||||
aria-label={label()}
|
||||
aria-disabled={unavailable() || props.speech.state() === "starting"}
|
||||
aria-disabled={locked()}
|
||||
aria-busy={busy()}
|
||||
aria-pressed={props.speech.state() === "recording"}
|
||||
class={`prompt-speech-button prompt-speech-button--${props.speech.state()}`}
|
||||
|
||||
@@ -654,6 +654,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.prompt-speech-button--starting {
|
||||
cursor: progress;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.prompt-speech-button--recording::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
|
||||
Reference in New Issue
Block a user