Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(ui): the code composer is one quiet row, in both states

Daviddf66ba525f32
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx
index a649495a..a7d18a86 100644
--- a/src/components/chat/ChatInput.tsx
+++ b/src/components/chat/ChatInput.tsx
@@ -374,8 +374,18 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
{/* Action bar, attach · voice · think · view actions · model · send.
Same in Chat, Code and Remote; each surface passes its own
- composerActions + composerModel (David 2026-07-11, web parity). */}
- <div className="flex items-center gap-1 px-2 py-1.5 border-t border-gray-200 dark:border-white/[0.05] flex-wrap">
+ composerActions + composerModel (David 2026-07-11, web parity).
+
+ ONE row, always. It used to be `flex-wrap`, and a run starting was
+ enough to break it: the Code mode trigger grows by a dot or a
+ "then bypass" label the moment a loop is in flight, the row ran out
+ of width and the tail (model picker and the Stop button) dropped
+ onto a second line. So the composer was a different height standing
+ still than it was working, which is what David saw as "der Stop
+ Knopf oeffnet eine weitere Zeile, alles sieht asymmetrisch aus".
+ No wrapping, a fixed-height row, and every control shrink-0 with
+ only the middle spacer giving way. */}
+ <div className="flex flex-nowrap items-center gap-1 px-2 py-1.5 min-h-[38px] border-t border-gray-200 dark:border-white/[0.05]">
{/* Clip button */}
<button
onClick={() => fileInputRef.current?.click()}
@@ -432,33 +442,40 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
</button>
{/* View-specific actions (Docs · Plugins · Tools) */}
- {composerActions}
+ <div className="flex flex-nowrap items-center gap-1 shrink-0">{composerActions}</div>
- <div className="flex-1" />
+ <div className="flex-1 min-w-0" />
{/* Model picker, opens upward from the composer */}
- {composerModel}
-
- {isGenerating ? (
- <motion.button
- onClick={onStop}
- className="p-1.5 rounded-md bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-all shrink-0"
- whileTap={{ scale: 0.9 }}
- aria-label="Stop generation"
- >
- <Square size={13} />
- </motion.button>
- ) : (
- <motion.button
- onClick={handleSend}
- disabled={(!input.trim() && images.length === 0) || isTranscribing}
- className="p-1.5 rounded-md bg-white/8 text-gray-300 hover:bg-white/12 disabled:opacity-20 disabled:cursor-not-allowed transition-all shrink-0"
- whileTap={{ scale: 0.9 }}
- aria-label="Send message"
- >
- <Send size={13} />
- </motion.button>
- )}
+ <div className="shrink-0">{composerModel}</div>
+
+ {/* Send and Stop are the SAME slot: one fixed 26x26 box at the end of
+ the row, never two, never one below the other. Stop replaces Send
+ in place while a run is in flight, exactly as the Chat surface has
+ always done, and because the box is sized rather than padded the
+ row height cannot move between the two states. */}
+ <div className="shrink-0 w-[26px] h-[26px]" data-testid="composer-send-slot">
+ {isGenerating ? (
+ <motion.button
+ onClick={onStop}
+ className="w-full h-full flex items-center justify-center rounded-md bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-all"
+ whileTap={{ scale: 0.9 }}
+ aria-label="Stop generation"
+ >
+ <Square size={13} />
+ </motion.button>
+ ) : (
+ <motion.button
+ onClick={handleSend}
+ disabled={(!input.trim() && images.length === 0) || isTranscribing}
+ className="w-full h-full flex items-center justify-center rounded-md bg-white/8 text-gray-300 hover:bg-white/12 disabled:opacity-20 disabled:cursor-not-allowed transition-all"
+ whileTap={{ scale: 0.9 }}
+ aria-label="Send message"
+ >
+ <Send size={13} />
+ </motion.button>
+ )}
+ </div>
</div>
</div>
</div>
diff --git a/src/components/chat/CodexModeDropdown.tsx b/src/components/chat/CodexModeDropdown.tsx
index b4e4a70a..0735dd2e 100644
--- a/src/components/chat/CodexModeDropdown.tsx
+++ b/src/components/chat/CodexModeDropdown.tsx
@@ -69,7 +69,7 @@ export function CodexModeDropdown({ openUpward = false }: { openUpward?: boolean
}
return (
- <div className="relative">
+ <div className="relative shrink-0">
<button
onClick={() => setOpen(!open)}
title={
@@ -77,9 +77,13 @@ export function CodexModeDropdown({ openUpward = false }: { openUpward?: boolean
? 'A run is in flight. A change here applies to the next message.'
: CODEX_MODE_DESCRIPTIONS[current]
}
- className="flex items-center gap-1 px-2 py-0.5 rounded border border-gray-200 dark:border-white/[0.06] hover:border-gray-400 dark:hover:border-white/15 text-gray-500 transition-colors text-[0.55rem]"
+ // whitespace-nowrap: this trigger grows when a run starts (the dot, or
+ // a parked "then bypass"), and it sits in the composer row. Letting its
+ // label break would put a second line inside the prompt window, which
+ // is the thing the row was fixed for.
+ className="flex items-center gap-1 whitespace-nowrap px-2 py-0.5 rounded border border-gray-200 dark:border-white/[0.06] hover:border-gray-400 dark:hover:border-white/15 text-gray-500 transition-colors text-[0.55rem]"
>
- <CurrentIcon size={10} className={MODE_ACCENT[current]} />
+ <CurrentIcon size={10} className={`shrink-0 ${MODE_ACCENT[current]}`} />
<span className={MODE_ACCENT[current]}>{CODEX_MODE_SHORT[current]}</span>
{pending ? (
<span className="text-[0.5rem] text-amber-500">
@@ -89,9 +93,9 @@ export function CodexModeDropdown({ openUpward = false }: { openUpward?: boolean
// A run is in flight and nothing is parked yet. Say it on the
// trigger, not only in the panel, so "applies to the next message" is
// visible before the user clicks.
- <span className="w-1 h-1 rounded-full bg-amber-400" />
+ <span className="w-1 h-1 shrink-0 rounded-full bg-amber-400" />
) : null}
- <ChevronDown size={8} className={`transition-transform ${open ? 'rotate-180' : ''}`} />
+ <ChevronDown size={8} className={`shrink-0 transition-transform ${open ? 'rotate-180' : ''}`} />
</button>
{open && (
diff --git a/src/components/chat/CodexView.tsx b/src/components/chat/CodexView.tsx
index c5c201f3..3c7e2cde 100644
--- a/src/components/chat/CodexView.tsx
+++ b/src/components/chat/CodexView.tsx
@@ -112,7 +112,10 @@ export function CodexView() {
{/* Main panel */}
<div className="flex-1 flex flex-col min-w-0 relative">
{/* Codex header */}
- <div className="flex items-center gap-1.5 px-2 py-0.5 border-b border-gray-200 dark:border-white/[0.04]">
+ <div
+ data-testid="codex-header"
+ className="flex items-center gap-1.5 px-2 py-0.5 border-b border-gray-200 dark:border-white/[0.04]"
+ >
<Code size={9} className="text-gray-500" />
<span className="text-[0.55rem] text-gray-600 dark:text-gray-400 font-medium">Coding Agent</span>
{/* Code-Review Mode badge (B13) — makes it impossible to miss
@@ -151,6 +154,13 @@ export function CodexView() {
<RotateCcw size={10} />
<span>New</span>
</button>
+ {/* Plugins (Chat Tools · Caveman · Persona · Group) lives HERE, next
+ to New, as a bare icon with the name in the tooltip. It used to
+ sit in the composer action bar and was one of the four things
+ crowding the prompt row (David, 2026-08-22: "das promptfenster ist
+ ueberfuellt"). The dropdown itself is untouched, only the place
+ and the trigger changed. */}
+ <PluginsDropdown iconOnly />
<TokenCounter />
<ContextDropdown />
<SmallModelModeToggle />
@@ -515,8 +525,10 @@ export function CodexView() {
composerAbove={<><LoopBar onStop={stopCodex} /><GoalBar /></>}
// Ask / Bypass / Plan sits here, in the CODE composer only (plan
// C1). ChatInput stays surface-neutral, so the Chat tab inherits
- // nothing from it.
- composerActions={<><CodexModeDropdown openUpward /><PluginsDropdown openUpward /></>}
+ // nothing from it. Plugins used to ride along here and now lives in
+ // the header next to New, so this row carries ONE view-specific
+ // control and stays a single quiet line in both states.
+ composerActions={<CodexModeDropdown openUpward />}
/>
</div>
diff --git a/src/components/chat/PluginsDropdown.tsx b/src/components/chat/PluginsDropdown.tsx
index cc83c8d9..09b641bd 100644
--- a/src/components/chat/PluginsDropdown.tsx
+++ b/src/components/chat/PluginsDropdown.tsx
@@ -16,7 +16,17 @@ const CAVEMAN_MODES: { value: CavemanMode; label: string; desc: string }[] = [
// `openUpward` opens the panel above the trigger — used when Plugins sits in
// the composer action bar (bottom of the screen) instead of the top toolbar.
-export function PluginsDropdown({ openUpward = false }: { openUpward?: boolean } = {}) {
+//
+// `iconOnly` is the Code header form (David, 2026-08-22: "das promptfenster ist
+// ueberfuellt"). Same dropdown, same behaviour, but the trigger is a bare icon
+// with the name in the tooltip, so it costs one constant-width slot in the
+// toolbar and nothing in the composer. The active-plugin signal moves from the
+// dot row onto the icon colour, because a row of dots that appears and
+// disappears is exactly the kind of width jump the composer was cured of.
+export function PluginsDropdown({
+ openUpward = false,
+ iconOnly = false,
+}: { openUpward?: boolean; iconOnly?: boolean } = {}) {
const [open, setOpen] = useState(false)
const [cavemanOpen, setCavemanOpen] = useState(false)
const [personaOpen, setPersonaOpen] = useState(false)
@@ -62,24 +72,40 @@ export function PluginsDropdown({ openUpward = false }: { openUpward?: boolean }
const isPersonaActive = activePersona && activePersona.id !== 'unrestricted' && personaEnabledOnChat
const currentCaveman = CAVEMAN_MODES.find((m) => m.value === (cavemanMode || 'off'))
+ const anyPluginActive = !!(isCavemanActive || isPersonaActive || chatToolsEnabled || isGroupActive)
+
return (
<div className="relative">
- <button
- onClick={() => setOpen(!open)}
- className="flex items-center gap-1 px-2 py-0.5 rounded border border-gray-200 dark:border-white/[0.06] hover:border-gray-400 dark:hover:border-white/15 text-gray-500 transition-colors text-[0.55rem]"
- >
- <Plug size={10} />
- <span>Plugins</span>
- {(isCavemanActive || isPersonaActive || chatToolsEnabled || isGroupActive) && (
- <div className="flex gap-0.5">
- {chatToolsEnabled && <div className="w-1 h-1 rounded-full bg-blue-400" />}
- {isCavemanActive && <div className="w-1 h-1 rounded-full bg-amber-400" />}
- {isPersonaActive && <div className="w-1 h-1 rounded-full bg-green-400" />}
- {isGroupActive && <div className="w-1 h-1 rounded-full bg-purple-400" />}
- </div>
- )}
- <ChevronDown size={8} className={`transition-transform ${open ? 'rotate-180' : ''}`} />
- </button>
+ {iconOnly ? (
+ <button
+ onClick={() => setOpen(!open)}
+ title={anyPluginActive ? 'Plugins (active)' : 'Plugins'}
+ aria-label="Plugins"
+ data-testid="plugins-trigger-icon"
+ className={`shrink-0 w-[22px] h-[22px] flex items-center justify-center rounded transition-colors hover:bg-gray-100 dark:hover:bg-white/5 ${
+ anyPluginActive ? 'text-blue-400' : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'
+ }`}
+ >
+ <Plug size={11} />
+ </button>
+ ) : (
+ <button
+ onClick={() => setOpen(!open)}
+ className="flex items-center gap-1 px-2 py-0.5 rounded border border-gray-200 dark:border-white/[0.06] hover:border-gray-400 dark:hover:border-white/15 text-gray-500 transition-colors text-[0.55rem]"
+ >
+ <Plug size={10} />
+ <span>Plugins</span>
+ {anyPluginActive && (
+ <div className="flex gap-0.5">
+ {chatToolsEnabled && <div className="w-1 h-1 rounded-full bg-blue-400" />}
+ {isCavemanActive && <div className="w-1 h-1 rounded-full bg-amber-400" />}
+ {isPersonaActive && <div className="w-1 h-1 rounded-full bg-green-400" />}
+ {isGroupActive && <div className="w-1 h-1 rounded-full bg-purple-400" />}
+ </div>
+ )}
+ <ChevronDown size={8} className={`transition-transform ${open ? 'rotate-180' : ''}`} />
+ </button>
+ )}
{open && (
<>
diff --git a/src/components/chat/VoiceButton.tsx b/src/components/chat/VoiceButton.tsx
index d25284b2..70891eec 100644
--- a/src/components/chat/VoiceButton.tsx
+++ b/src/components/chat/VoiceButton.tsx
@@ -87,7 +87,7 @@ export function VoiceButton({ onTranscript, onInterim, onRecordingChange, disabl
if (!sttSupported) {
return (
- <div className="relative group/mic">
+ <div className="relative group/mic shrink-0">
<button
disabled
className="p-1.5 rounded-lg text-gray-300 dark:text-gray-600 cursor-not-allowed shrink-0"
diff --git a/src/components/chat/__tests__/the-code-composer-is-one-quiet-row.test.ts b/src/components/chat/__tests__/the-code-composer-is-one-quiet-row.test.ts
new file mode 100644
index 00000000..4f6d93b0
--- /dev/null
+++ b/src/components/chat/__tests__/the-code-composer-is-one-quiet-row.test.ts
@@ -0,0 +1,169 @@
+/**
+ * The Code composer is ONE row, in both states.
+ *
+ * David, live test of the Code surface, 2026-08-22:
+ *
+ * "das promptfenster ist ueberfuellt, der stop knopf oeffnet eine weitere
+ * zeile, alles sieht asymmetrisch aus"
+ *
+ * Three things were true at once and each one made the other worse:
+ *
+ * 1. Plugins sat in the composer action bar as a bordered button with a
+ * label, next to Ask/Bypass/Plan, next to Think, next to the model
+ * picker. Four controls plus attach and voice in a box that is 70% of a
+ * split pane wide.
+ * 2. The bar was `flex-wrap`, so the moment it ran out of width the tail
+ * (model picker, Send) dropped onto a second line.
+ * 3. Starting a run WIDENS that bar: the mode trigger gains a run dot, or a
+ * parked "then bypass" label. That was the trigger David actually hit, so
+ * the composer looked one height standing still and another one working,
+ * and Stop appeared to open a line of its own.
+ *
+ * What this file pins, so none of the three can come back quietly:
+ * - Plugins is in the Code HEADER next to New, icon only, name in the
+ * tooltip. Not in composerActions, composerAbove or composerModel.
+ * - Send and Stop are ONE fixed-size slot at the end of the row. Stop
+ * replaces Send in place, exactly as Chat has always done.
+ * - The bar never wraps, and everything in it is shrink-0 except the one
+ * spacer that is supposed to give way.
+ *
+ * Run: npx vitest run src/components/chat/__tests__/the-code-composer-is-one-quiet-row.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { fileURLToPath } from 'node:url'
+import { dirname, resolve } from 'node:path'
+
+const here = dirname(fileURLToPath(import.meta.url))
+const CHAT = resolve(here, '..')
+const read = (f: string) => readFileSync(resolve(CHAT, f), 'utf8')
+
+const CODEX = read('CodexView.tsx')
+const INPUT = read('ChatInput.tsx')
+const PLUGINS = read('PluginsDropdown.tsx')
+
+/** The JSX/expression a prop is given, brace balanced from `prop={`. */
+function propValue(src: string, prop: string): string {
+ const start = src.indexOf(`${prop}={`)
+ if (start < 0) return ''
+ let i = start + prop.length + 1
+ let depth = 0
+ for (; i < src.length; i++) {
+ if (src[i] === '{') depth++
+ else if (src[i] === '}') {
+ depth--
+ if (depth === 0) return src.slice(start, i + 1)
+ }
+ }
+ return src.slice(start)
+}
+
+const COMPOSER_PROPS = ['composerAbove', 'composerActions', 'composerModel']
+
+describe('Plugins moved out of the Code composer and into the header', () => {
+ it('is rendered in the header band, between New and the token counter', () => {
+ const header = CODEX.indexOf('data-testid="codex-header"')
+ const newSession = CODEX.indexOf('<span>New</span>')
+ const plugins = CODEX.indexOf('<PluginsDropdown')
+ const tokens = CODEX.indexOf('<TokenCounter')
+ expect(header).toBeGreaterThan(-1)
+ expect(plugins).toBeGreaterThan(newSession)
+ // TokenCounter is inside the header, so staying in front of it is proof
+ // that Plugins did not merely move up the file into some other band.
+ expect(tokens).toBeGreaterThan(plugins)
+ })
+
+ it('is the icon form there, with the name in the tooltip', () => {
+ expect(CODEX).toMatch(/<PluginsDropdown iconOnly \/>/)
+ expect(PLUGINS).toMatch(/iconOnly = false/)
+ // The icon branch carries a tooltip and an accessible name and no label.
+ const iconBranch = PLUGINS.slice(
+ PLUGINS.indexOf('{iconOnly ? ('),
+ PLUGINS.indexOf(') : ('),
+ )
+ expect(iconBranch).toMatch(/title=\{anyPluginActive \? 'Plugins \(active\)' : 'Plugins'\}/)
+ expect(iconBranch).toMatch(/aria-label="Plugins"/)
+ expect(iconBranch).not.toMatch(/<span>Plugins<\/span>/)
+ })
+
+ it('the dropdown itself is unchanged, only the trigger and the place', () => {
+ // Same panel, same four sections. If a rewrite ever guts this, the move
+ // stops being a move.
+ for (const section of ['Chat Tools', 'Caveman Mode', 'Persona', 'Group chat']) {
+ expect(PLUGINS).toContain(section)
+ }
+ })
+
+ it('nothing handed to the Code prompt box mentions Plugins any more', () => {
+ // THE NEGATIVE CONTROL. Putting <PluginsDropdown openUpward /> back into
+ // composerActions turns this red, which is the only thing stopping the
+ // next round from quietly refilling the prompt window.
+ for (const prop of COMPOSER_PROPS) {
+ expect(propValue(CODEX, prop), `${prop} must not carry Plugins`).not.toMatch(/PluginsDropdown/)
+ }
+ })
+
+ it('leaves exactly one view-specific control in the Code composer', () => {
+ const actions = propValue(CODEX, 'composerActions')
+ expect(actions).toMatch(/<CodexModeDropdown openUpward \/>/)
+ expect(actions.match(/<[A-Z][A-Za-z0-9_]*/g)).toEqual(['<CodexModeDropdown'])
+ })
+})
+
+describe('Stop never opens a second line', () => {
+ const slot = INPUT.indexOf('data-testid="composer-send-slot"')
+ const stop = INPUT.indexOf('aria-label="Stop generation"')
+ const send = INPUT.indexOf('aria-label="Send message"')
+
+ it('Send and Stop are the same single slot, not two places in the row', () => {
+ expect(INPUT.match(/data-testid="composer-send-slot"/g)).toHaveLength(1)
+ expect(INPUT.match(/aria-label="Stop generation"/g)).toHaveLength(1)
+ expect(INPUT.match(/aria-label="Send message"/g)).toHaveLength(1)
+ expect(slot).toBeGreaterThan(-1)
+ expect(stop).toBeGreaterThan(slot)
+ expect(send).toBeGreaterThan(stop)
+ })
+
+ it('the slot has a fixed footprint, so the two states cannot differ in size', () => {
+ expect(INPUT).toMatch(/className="shrink-0 w-\[26px\] h-\[26px\]" data-testid="composer-send-slot"/)
+ // Both buttons fill the slot instead of sizing themselves by padding.
+ const both = INPUT.slice(slot)
+ expect(both.slice(0, both.indexOf('</div>')).match(/w-full h-full/g)).toHaveLength(2)
+ })
+
+ it('Stop is the running state of the send button, one ternary, one handler', () => {
+ expect(INPUT).toMatch(/\{isGenerating \? \(/)
+ expect(INPUT.match(/onClick=\{onStop\}/g)).toHaveLength(1)
+ })
+})
+
+describe('the action bar is one quiet row', () => {
+ const bar = INPUT.indexOf('flex flex-nowrap items-center gap-1 px-2 py-1.5')
+
+ it('does not wrap, at any width, in any state', () => {
+ expect(bar).toBeGreaterThan(-1)
+ // Only the image-preview strip above the textarea is still allowed to
+ // wrap; the action row itself never is.
+ const wrappers = [...INPUT.matchAll(/className="([^"]*\bflex-wrap\b[^"]*)"/g)].map((m) => m[1])
+ expect(wrappers).toEqual(['flex gap-1.5 mb-1.5 flex-wrap'])
+ })
+
+ it('keeps a fixed row height whether a run is in flight or not', () => {
+ expect(INPUT).toMatch(/flex flex-nowrap items-center gap-1 px-2 py-1\.5 min-h-\[38px\]/)
+ })
+
+ it('gives way in the middle only, so nothing on either end jumps', () => {
+ const row = INPUT.slice(bar)
+ expect(row).toMatch(/<div className="flex flex-nowrap items-center gap-1 shrink-0">\{composerActions\}<\/div>/)
+ expect(row).toMatch(/<div className="flex-1 min-w-0" \/>/)
+ expect(row).toMatch(/<div className="shrink-0">\{composerModel\}<\/div>/)
+ })
+
+ it('the Code mode trigger grows sideways when a run starts, never downwards', () => {
+ // It gains a dot or a parked "then bypass" mid-run. Inside a no-wrap row
+ // that is harmless; a breaking label would still be a second line.
+ const mode = read('CodexModeDropdown.tsx')
+ expect(mode).toMatch(/flex items-center gap-1 whitespace-nowrap px-2 py-0\.5/)
+ expect(mode).toMatch(/<div className="relative shrink-0">/)
+ })
+})