fix(webui): nudge model setup on blocked submit

This commit is contained in:
Xubin Ren
2026-09-02 16:25:07 +08:00
parent 6b07c91aa2
commit 94d62f86a0
4 changed files with 52 additions and 3 deletions
@@ -1036,6 +1036,7 @@ export function ThreadComposer({
} | null>(null);
const [inlineError, setInlineError] = useState<string | null>(null);
const [sendPending, setSendPending] = useState(false);
const [modelSetupAttentionRequest, setModelSetupAttentionRequest] = useState(0);
const interactionDisabled = !!disabled || sendPending;
const [voiceErrorFading, setVoiceErrorFading] = useState(false);
const [slashMenuDismissed, setSlashMenuDismissed] = useState(false);
@@ -2008,7 +2009,9 @@ export function ThreadComposer({
const submit = useCallback(() => {
if (modelNeedsSetup) {
onModelBadgeClick?.();
if (hasComposerContent) {
setModelSetupAttentionRequest((request) => request + 1);
}
return;
}
if (!canSend) return;
@@ -2112,11 +2115,11 @@ export function ThreadComposer({
clear,
clearComposerText,
hasTouchPrimaryPointer,
hasComposerContent,
handleStop,
isStreaming,
maxTextBytes,
modelNeedsSetup,
onModelBadgeClick,
onSend,
onStop,
onQuotedContextChange,
@@ -2546,6 +2549,7 @@ export function ThreadComposer({
provider={modelProvider}
providerLabel={modelProviderLabel}
needsSetup={modelNeedsSetup}
attentionRequest={modelSetupAttentionRequest}
fallbackModelName={fallbackModelName}
isHero={isHero}
onClick={modelNeedsSetup ? onModelBadgeClick : undefined}