fix(tui): address follow-up review nits
This commit is contained in:
@@ -21,7 +21,7 @@ const GLOBAL_MODEL_FLAG_RE = /(?:^|\s)--global(?:\s|$)/
|
||||
const persistedModelArg = (arg: string) => {
|
||||
const trimmed = arg.trim()
|
||||
|
||||
return GLOBAL_MODEL_FLAG_RE.test(trimmed) ? trimmed : `${trimmed} --global`
|
||||
return !trimmed || GLOBAL_MODEL_FLAG_RE.test(trimmed) ? trimmed : `${trimmed} --global`
|
||||
}
|
||||
|
||||
export const sessionCommands: SlashCommand[] = [
|
||||
@@ -73,7 +73,7 @@ export const sessionCommands: SlashCommand[] = [
|
||||
return
|
||||
}
|
||||
|
||||
if (!arg) {
|
||||
if (!arg.trim()) {
|
||||
return patchOverlayState({ modelPicker: true })
|
||||
}
|
||||
|
||||
|
||||
@@ -51,24 +51,29 @@ export function useSubmission(opts: UseSubmissionOptions) {
|
||||
const typingIdleTimer = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (composerState.input || composerState.inputBuf.length) {
|
||||
if (getUiState().busy) {
|
||||
turnController.boostStreamingForTyping()
|
||||
}
|
||||
|
||||
if (typingIdleTimer.current) {
|
||||
clearTimeout(typingIdleTimer.current)
|
||||
}
|
||||
|
||||
typingIdleTimer.current = setTimeout(() => {
|
||||
typingIdleTimer.current = null
|
||||
turnController.relaxStreaming()
|
||||
}, TYPING_IDLE_MS)
|
||||
if (typingIdleTimer.current) {
|
||||
clearTimeout(typingIdleTimer.current)
|
||||
typingIdleTimer.current = null
|
||||
}
|
||||
|
||||
if (!composerState.input && !composerState.inputBuf.length) {
|
||||
turnController.relaxStreaming()
|
||||
return
|
||||
}
|
||||
|
||||
if (getUiState().busy) {
|
||||
turnController.boostStreamingForTyping()
|
||||
}
|
||||
|
||||
typingIdleTimer.current = setTimeout(() => {
|
||||
typingIdleTimer.current = null
|
||||
turnController.relaxStreaming()
|
||||
}, TYPING_IDLE_MS)
|
||||
|
||||
return () => {
|
||||
if (typingIdleTimer.current) {
|
||||
clearTimeout(typingIdleTimer.current)
|
||||
typingIdleTimer.current = null
|
||||
}
|
||||
}
|
||||
}, [composerState.input, composerState.inputBuf])
|
||||
|
||||
Reference in New Issue
Block a user