From bede2309997d9300b9dc07cb98dfe2b904c317e6 Mon Sep 17 00:00:00 2001 From: danielhanchen Date: Tue, 19 May 2026 14:21:25 +0000 Subject: [PATCH] studio/frontend: scope shared-composer changes to aria-label only Previous force-push checked out the original PR 5550 version of shared-composer.tsx, which was based on a commit before PR 5574 landed. That re-introduced the buggy compare-mode guard (model1 || model2 instead of model1 && model2) and removed PR 5574's toast that blocks half- configured compare sends. Fix: reset shared-composer.tsx to current main and re-apply only the three aria-label additions (Think / Search / Code pills get correct labels when their backing capability is unavailable). PR 5574's compare guard stays intact. Probe diff now: +19/-5 (was +20/-18 with the regression). --- .../frontend/src/features/chat/shared-composer.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/studio/frontend/src/features/chat/shared-composer.tsx b/studio/frontend/src/features/chat/shared-composer.tsx index 91e3561248..11a471c3b5 100644 --- a/studio/frontend/src/features/chat/shared-composer.tsx +++ b/studio/frontend/src/features/chat/shared-composer.tsx @@ -523,7 +523,19 @@ export function SharedComposer({ handlesRef.current["model1"] || handlesRef.current["model2"], ); const isGeneralizedCompare = - hasCompareHandles && Boolean(model1?.id || model2?.id); + hasCompareHandles && Boolean(model1?.id && model2?.id); + + // Generalized compare requires both panes to have a model. A + // half-selected send either races to an empty bubble with bogus + // tok/s (#5569) or leaves the empty pane with a dangling prompt. + // hasCompareHandles is true only in GeneralCompareContent, so + // LoraCompare and single-pane chats are unaffected. + if (hasCompareHandles && !isGeneralizedCompare) { + toast.error("Pick a model in each pane to compare", { + description: "Use the model dropdown above each pane, then send your prompt.", + }); + return; + } if (pendingImages.length > 0 && !isGeneralizedCompare && imageUnavailableReason) { // Single mode: the loaded model's runtime capability is known