From 35889ac1bdffb9dc23a271bfffde6d997fbc48a3 Mon Sep 17 00:00:00 2001 From: danielhanchen Date: Wed, 22 Jul 2026 06:49:30 +0000 Subject: [PATCH] Studio: keep composer tool pills always accessible after merge The merge left the composer line marked always-expanded (data-expanded "true") while the inner pill row was still gated behind composerExpanded, so the Search and Code toggles disappeared once the permission mode was "off" with no other toggle set. Render the primary tool pills unconditionally, matching the always-expanded layout, and drop the now unused composerExpanded and permissionMode locals. Fixes the Chat UI Playwright check that asserts the Search and Code pills stay visible. --- .../src/components/assistant-ui/thread.tsx | 38 +++++-------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx index 240ebb709c..a7f1a50536 100644 --- a/studio/frontend/src/components/assistant-ui/thread.tsx +++ b/studio/frontend/src/components/assistant-ui/thread.tsx @@ -1460,7 +1460,6 @@ const Composer: FC<{ const artifactsEnabled = useChatRuntimeStore((s) => s.artifactsEnabled); const mcpEnabledForChat = useChatRuntimeStore((s) => s.mcpEnabledForChat); const ragEnabled = useChatRuntimeStore((s) => s.ragEnabled); - const permissionMode = useChatRuntimeStore((s) => s.permissionMode); const deepResearchEnabled = useChatRuntimeStore( (s) => s.deepResearchEnabled, ); @@ -1624,21 +1623,6 @@ const Composer: FC<{ const t = setTimeout(() => writeComposerDraft(draftKey, composerText), 300); return () => clearTimeout(t); }, [composerText, draftKey]); - // Two-row layout shows once the input wraps or a tool is on. Tools can - // pre-select before a model loads, so an active toggle expands it either way. - // Keep the composer expanded whenever the permission pill is visible. - const composerExpanded = - isMultiline || - hasAttachments || - hasPendingAudio || - toolsEnabled || - codeToolsEnabled || - imageToolsEnabled || - ragEnabled || - artifactsEnabled || - mcpEnabledForChat || - effectiveDeepResearchEnabled || - permissionMode !== "off"; // react-textarea-autosize re-measures only on value change or window resize, // not on the width swap from expanding, so it keeps the taller height and // leaves a stray blank row. Nudge a resize whenever input width changes. @@ -1951,25 +1935,21 @@ const Composer: FC<{ side={effectiveMenuSide} researchAvailable={!researchUsed} /> - {/* Permission-level pill: always visible, even while the pill row - is collapsed; opens the permission level dropdown. */} + {/* Permission-level pill: always visible and opens the permission + level dropdown. */} {effectiveDeepResearchEnabled ? ( setResearchWebsiteAccessOpen(true)} /> ) : null} - {composerExpanded ? ( - <> - - - - - {artifactsEnabled ? : null} - {mcpEnabledForChat ? ( - - ) : null} - + + + + + {artifactsEnabled ? : null} + {mcpEnabledForChat ? ( + ) : null}