@@ -69,7 +69,6 @@ export function VoiceInputSetup(props: {
6969 : "System default" ;
7070 const status = props . status ?. supported ? props . status : null ;
7171 const model = props . model ;
72- const size = model ?. size ?? status ?. size ;
7372 const progress =
7473 model ?. downloaded === undefined ? null : Math . round ( ( model . downloaded / model . size ) * 100 ) ;
7574 const openSettings = ( hash : string ) => {
@@ -89,51 +88,51 @@ export function VoiceInputSetup(props: {
8988 < WizardPanel >
9089 { props . step === 0 ? (
9190 < section className = "space-y-3 text-sm" >
92- < div className = "rounded-lg border border-border/70 bg-card/60 p-4" >
93- < div className = "flex items-center justify-between gap-2" >
94- < h3 className = "font-medium" >
95- { model ?. name ?? status ?. model ?? "Transcription model" }
96- </ h3 >
97- { model ?. recommended && props . language ? (
98- < span className = "text-xs font-medium text-primary" >
99- Recommended for { languageLabel ( props . language ) }
100- </ span >
101- ) : null }
102- </ div >
103- < p className = "mt-2 text-muted-foreground" >
104- Download the { size === undefined ? 697 : Math . round ( size / 1024 / 1024 ) } MB model
105- to { environment ?. label ?? "your transcription environment" } . Microphone audio is
106- sent there for transcription, as chosen in Voice settings.
107- </ p >
108- < p className = "mt-2 text-muted-foreground" >
109- Silero (1.2 MB), used for silence filtering and pause detection, downloads
110- alongside the speech model. An installed copy is reused.
111- </ p >
112- { props . downloading ? (
113- < div role = "status" className = "mt-4 space-y-1 text-muted-foreground" >
114- < div
115- role = "progressbar"
116- aria-label = "Speech model download progress"
117- aria-valuemin = { 0 }
118- aria-valuemax = { 100 }
119- aria-valuenow = { progress ?? undefined }
120- className = "h-1 overflow-hidden rounded-full bg-muted"
121- >
91+ { model ? (
92+ < div className = "rounded-lg border border-border/70 bg-card/60 p-4" >
93+ < div className = "flex items-center justify-between gap-2" >
94+ < h3 className = "font-medium" > { model . name } </ h3 >
95+ { model ?. recommended && props . language ? (
96+ < span className = "text-xs font-medium text-primary" >
97+ Recommended for { languageLabel ( props . language ) }
98+ </ span >
99+ ) : null }
100+ </ div >
101+ < p className = "mt-2 text-muted-foreground" >
102+ Download the { Math . round ( model . size / 1024 / 1024 ) } MB model to{ " " }
103+ { environment ?. label ?? "your transcription environment" } . Microphone audio is
104+ sent there for transcription, as chosen in Voice settings.
105+ </ p >
106+ < p className = "mt-2 text-muted-foreground" >
107+ Silero (1.2 MB), used for silence filtering and pause detection, downloads
108+ alongside the speech model. An installed copy is reused.
109+ </ p >
110+ { props . downloading ? (
111+ < div role = "status" className = "mt-4 space-y-1 text-muted-foreground" >
122112 < div
123- className = "h-full bg-primary transition-[width] duration-200"
124- style = { { width : `${ progress ?? 0 } %` } }
125- />
113+ role = "progressbar"
114+ aria-label = "Speech model download progress"
115+ aria-valuemin = { 0 }
116+ aria-valuemax = { 100 }
117+ aria-valuenow = { progress ?? undefined }
118+ className = "h-1 overflow-hidden rounded-full bg-muted"
119+ >
120+ < div
121+ className = "h-full bg-primary transition-[width] duration-200"
122+ style = { { width : `${ progress ?? 0 } %` } }
123+ />
124+ </ div >
125+ < p className = "text-xs" >
126+ { model ?. state === "verifying"
127+ ? "Verifying download…"
128+ : progress === null
129+ ? "Starting download…"
130+ : `${ progress } % downloaded` }
131+ </ p >
126132 </ div >
127- < p className = "text-xs" >
128- { model ?. state === "verifying"
129- ? "Verifying download…"
130- : progress === null
131- ? "Starting download…"
132- : `${ progress } % downloaded` }
133- </ p >
134- </ div >
135- ) : null }
136- </ div >
133+ ) : null }
134+ </ div >
135+ ) : null }
137136 { props . error ? (
138137 < p role = "alert" className = "text-destructive" >
139138 { props . error }
@@ -214,25 +213,27 @@ export function VoiceInputSetup(props: {
214213 { props . step === 0 ? (
215214 < >
216215 < Button variant = "outline" onClick = { ( ) => openSettings ( "speech-models" ) } >
217- Choose another model or language
216+ { model ? " Choose another model or language" : "Choose a model or language" }
218217 </ Button >
219218 { props . downloading ? (
220219 < Button variant = "outline" disabled = { ! canManage } onClick = { props . onCancelDownload } >
221220 Cancel download
222221 </ Button >
223222 ) : null }
224- < Button
225- disabled = { ! canManage || props . downloading || ! status }
226- onClick = { props . onDownload }
227- >
228- { props . downloading
229- ? "Downloading…"
230- : props . error
231- ? "Retry download"
232- : canManage
233- ? "Download model"
234- : "Ask an environment admin to download" }
235- </ Button >
223+ { model ? (
224+ < Button
225+ disabled = { ! canManage || props . downloading || ! status }
226+ onClick = { props . onDownload }
227+ >
228+ { props . downloading
229+ ? "Downloading…"
230+ : props . error
231+ ? "Try again"
232+ : canManage
233+ ? "Download model"
234+ : "Ask an environment admin to download" }
235+ </ Button >
236+ ) : null }
236237 </ >
237238 ) : (
238239 < >
0 commit comments