@@ -1079,6 +1079,12 @@ aiTab = component "AITab" \p -> React.do
10791079 transcript /\ setTranscript <- useState' ""
10801080 nlText /\ setNlText <- useState' "I love this amazing app! C'est magnifique."
10811081 nlResult /\ setNlResult <- useState' ""
1082+ useEffect listening do
1083+ if listening then do
1084+ timerId <- setInterval 500 do
1085+ macosGetTranscript \t -> setTranscript t
1086+ pure (clearInterval timerId)
1087+ else pure (pure unit)
10821088 pure do
10831089 nativeScrollView { style: tw "flex-1" <> Style.style { backgroundColor: "transparent" } }
10841090 ( view { style: tw "px-4 pb-4" }
@@ -1194,10 +1200,10 @@ aiTab = component "AITab" \p -> React.do
11941200 else view {} []
11951201 , sectionTitle p.fg "Speech Recognition"
11961202 , text { style: tw "text-xs mb-2" <> Style.style { color: p.dimFg } }
1197− "Live microphone transcription (SFSpeechRecognizer)"
1203+ "Live microphone-to-text (click Start, speak, click Stop)"
11981204 , view { style: tw "flex-row items-center mb-2" }
11991205 [ nativeButton
1200− { title: if listening then "Listening..." else "Start Listening"
1206+ { title: if listening then "Listening..." else "Start"
12011207 , sfSymbol: if listening then "mic.fill" else "mic"
12021208 , bezelStyle: T.push
12031209 , onPress: handler_ do
@@ -1206,7 +1212,7 @@ aiTab = component "AITab" \p -> React.do
12061212 setListening true
12071213 setTranscript ""
12081214 macosStartListening
1209− , style: Style.style { height: 24.0, width: 160.0 }
1215+ , style: Style.style { height: 24.0, width: 130.0 }
12101216 }
12111217 , nativeButton
12121218 { title: "Stop"
@@ -1218,14 +1224,6 @@ aiTab = component "AITab" \p -> React.do
12181224 setListening false
12191225 , style: Style.style { height: 24.0, width: 80.0, marginLeft: 8.0 }
12201226 }
1221− , nativeButton
1222− { title: "Poll"
1223− , sfSymbol: "arrow.clockwise"
1224− , bezelStyle: T.push
1225− , onPress: handler_ do
1226− macosGetTranscript \t -> setTranscript t
1227− , style: Style.style { height: 24.0, width: 80.0, marginLeft: 8.0 }
1228− }
12291227 ]
12301228 , if transcript /= "" then view { style: tw "p-2 rounded mb-4" <> Style.style { backgroundColor: p.cardBg } }
12311229 [ text { style: tw "text-xs font-mono" <> Style.style { color: p.fg } } transcript ]