diff --git a/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx b/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx index ece5040f..d0c6fa30 100644 --- a/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx +++ b/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx @@ -282,6 +282,18 @@ function ChatInputInner({ const [codeModeFeatureEnabled, setCodeModeFeatureEnabled] = useState(false) const [permissionMode, setPermissionMode] = useState('auto') const [recentWorkDirs, setRecentWorkDirs] = useState([]) + const toolbarRef = useRef(null) + const [isCompact, setIsCompact] = useState(false) + + useEffect(() => { + const el = toolbarRef.current + if (!el) return + const ro = new ResizeObserver(([entry]) => { + setIsCompact(entry.contentRect.width < 320) + }) + ro.observe(el) + return () => ro.disconnect() + }, []) // When a run exists, freeze the dropdown to the run's resolved model+provider. useEffect(() => { @@ -757,8 +769,8 @@ function ChatInputInner({ className="min-h-6 rounded-none border-0 py-0 shadow-none focus-visible:ring-0" /> -
-
+
+
@@ -866,6 +878,15 @@ function ChatInputInner({ {workDir && ( + {isCompact ? ( + + ) : (
+ )}
Work directory: {workDir} @@ -924,7 +946,8 @@ function ChatInputInner({ }} disabled={Boolean(runId)} className={cn( - "flex h-7 shrink-0 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors", + "flex h-7 shrink-0 items-center gap-1.5 rounded-full text-xs font-medium transition-colors", + isCompact ? "w-7 justify-center" : "px-2.5", permissionMode === 'auto' ? "bg-secondary text-foreground hover:bg-secondary/70" : "text-muted-foreground hover:bg-muted hover:text-foreground", @@ -932,8 +955,8 @@ function ChatInputInner({ )} aria-label="Permission mode" > - - {permissionMode === 'auto' ? 'Auto' : 'Manual'} + + {!isCompact && {permissionMode === 'auto' ? 'Auto' : 'Manual'}}
@@ -945,6 +968,20 @@ function ChatInputInner({
{codeModeFeatureEnabled && (codeModeEnabled ? ( + isCompact ? ( + + + + + Code mode on ({codingAgent === 'claude' ? 'Claude Code' : 'Codex'}) — click to disable + + ) : (
@@ -975,6 +1012,7 @@ function ChatInputInner({
+ ) ) : (