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): chat, agent and code tidy-ups from the 30.09. UX pass

purple46e41ff1727f
diff --git a/e2e/code-composer-narrow-keeps-stop.spec.ts b/e2e/code-composer-narrow-keeps-stop.spec.ts
new file mode 100644
index 00000000..953f9e0d
--- /dev/null
+++ b/e2e/code-composer-narrow-keeps-stop.spec.ts
@@ -0,0 +1,76 @@
+import { test, expect, type Page } from '@playwright/test'
+import { tauriMockInit, DEFAULT_ASSISTANT_REPLY, DEFAULT_MODEL_NAME } from './support/tauri-mock'
+import { seedOnboardingDone, routeCloud, signInViaGate, cloudSwitch } from './support/cloud-mock'
+
+/**
+ * UX pass 30.09.2026: Code tab, 900 px window, explorer open, cloud model, a
+ * run in flight. The composer's action row is one fixed line, and it was
+ * wider than the composer: Stop sat outside the frame, next to the panel
+ * border. The fix lets the model name ellipsize and turns the Think and
+ * Sampling words into icons below 30rem (ChatInput.tsx, @container).
+ *
+ * Measured on the running tree: the row does not overflow, and Stop sits
+ * inside the composer.
+ */
+
+const cors = { 'access-control-allow-origin': '*', 'access-control-allow-headers': 'authorization, content-type' }
+
+async function bootCodeOnCloud(page: Page): Promise<void> {
+ await page.setViewportSize({ width: 1280, height: 800 })
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME })
+ await seedOnboardingDone(page)
+ await routeCloud(page, { license: 'active', access: true, mediaLive: true, paidPlan: true })
+ await page.route('**/api/inference/v1/models', (route) => route.fulfill({
+ status: 200, headers: cors, contentType: 'application/json',
+ body: JSON.stringify({ object: 'list', data: [
+ { id: 'moonshotai/Kimi-K2.6', name: 'Kimi K2.6', context_length: 262144, supports_tools: true, think: 'never' },
+ ] }),
+ }))
+ // The step never answers inside the test, so the run stays in flight.
+ await page.route('**/api/inference/v1/chat/completions', async (route) => {
+ if (route.request().method() === 'OPTIONS') return route.fulfill({ status: 204, headers: cors })
+ await new Promise((res) => setTimeout(res, 60_000))
+ return route.fulfill({ status: 200, headers: cors, contentType: 'text/event-stream', body: 'data: [DONE]\n\n' }).catch(() => {})
+ })
+ await page.goto('/')
+ await signInViaGate(page)
+ await expect(cloudSwitch(page)).toBeChecked()
+ // Model first, in a plain chat, then the Code tab (same order as a user
+ // who arrives from the chat).
+ await page.getByRole('button', { name: /New Chat/i }).first().click()
+ await page.getByRole('button', { name: 'Select chat model', exact: true }).click()
+ await page.getByRole('button', { name: /Kimi K2\.6/ }).first().click()
+ await page.getByRole('button', { name: 'Code', exact: true }).click()
+ await expect(async () => {
+ await page.getByRole('button', { name: /New Chat/i }).first().click()
+ await expect(page.locator('textarea').first()).toBeVisible({ timeout: 2_000 })
+ }).toPass({ timeout: 30_000 })
+}
+
+test('Code tab at 900 px with the explorer open: Stop stays inside the composer', async ({ page }) => {
+ await bootCodeOnCloud(page)
+ const box = page.locator('textarea').first()
+ await box.fill('build the page')
+ await box.press('Enter')
+ await page.setViewportSize({ width: 900, height: 700 })
+
+ const slot = page.getByTestId('composer-send-slot')
+ await expect(slot.getByRole('button')).toBeVisible()
+
+ await expect(async () => {
+ const m = await slot.evaluate((el) => {
+ const row = el.parentElement as HTMLElement
+ // The composer frame: the nearest ancestor with a visible border.
+ let frame: HTMLElement | null = row.parentElement
+ while (frame && getComputedStyle(frame).borderTopWidth === '0px') frame = frame.parentElement
+ const s = el.getBoundingClientRect()
+ const f = (frame ?? row).getBoundingClientRect()
+ return { overflow: row.scrollWidth - row.clientWidth, stopRight: s.right, frameRight: f.right }
+ })
+ expect(m.overflow).toBeLessThanOrEqual(0)
+ expect(m.stopRight).toBeLessThanOrEqual(m.frameRight)
+ }).toPass({ timeout: 10_000 })
+
+ // The model is still named, only shorter.
+ await expect(page.getByRole('button', { name: 'Select chat model', exact: true })).toBeVisible()
+})
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx
index cf1014b8..c17922dd 100644
--- a/src/components/chat/ChatInput.tsx
+++ b/src/components/chat/ChatInput.tsx
@@ -610,7 +610,7 @@ export function ChatInput({ onSend, onStop, isGenerating, waitingForLocalLane, p
only the middle spacer giving way, das `flex: 0 0 auto` steckt
seit der Composer-Grammatik im Rezept `.lu-control` (index.css),
nicht mehr als `shrink-0` an jedem einzelnen Knopf. */}
- <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]">
+ <div className="@container 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()}
@@ -664,7 +664,8 @@ export function ChatInput({ onSend, onStop, isGenerating, waitingForLocalLane, p
}
>
<Brain size={11} />
- <span>Think</span>
+ {/* In a narrow composer the icon and the tooltip carry it. */}
+ <span className="@max-[30rem]:hidden">Think</span>
</button>
{/* Reasoning effort. Same shape and size as the Think button beside
@@ -723,8 +724,11 @@ export function ChatInput({ onSend, onStop, isGenerating, waitingForLocalLane, p
{/* Sampling controls sit next to the picker: same row, collapsed. */}
<div className="shrink-0"><SamplingControls /></div>
- {/* Model picker, opens upward from the composer */}
- <div className="shrink-0">{composerModel}</div>
+ {/* Model picker, opens upward from the composer. The one control
+ that may give way when the row runs out of width (Code tab with
+ the explorer open): its name ellipsizes in the middle instead of
+ pushing Stop out of the frame. */}
+ <div className="min-w-[4rem] shrink">{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
diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx
index 510341e2..6657b650 100644
--- a/src/components/chat/ChatView.tsx
+++ b/src/components/chat/ChatView.tsx
@@ -47,7 +47,7 @@ import { useGenerationStore } from '../../stores/generationStore'
import { composerBusy } from '../../lib/composer-busy'
import { useIsQueuedForLocalLane, useLocalLaneQueuePosition, useLocalLaneHolderWaitsForApproval, useLocalLaneHolderId } from '../../lib/run-idle'
import { useRemoteStore } from '../../stores/remoteStore'
-import { displayModelName } from '../../api/providers'
+import { modelDisplayLabel } from '../../lib/model-label'
import { MONOGRAM, MONOGRAM_INVERT } from '../layout/brand'
/** Was die Eingangsseite sagt und anbietet, je nach Lage. */
@@ -274,7 +274,7 @@ export function ChatView() {
// Der Modellname steht auf einer EIGENEN Zeile und wird gekuerzt: er ist
// haeufig 50+ Zeichen lang (`hf.co/DevQuasar/huihui-ai_Qwen3-4B-abliterated-GGUF`),
// und im Fliesstext liess er die Zeile dreimal umbrechen.
- : { subline: 'Type below to start.', note: displayModelName(activeModel), cta: null }
+ : { subline: 'Type below to start.', note: modelDisplayLabel(models, activeModel), cta: null }
return (
<div className="h-full flex flex-col min-w-0">
diff --git a/src/components/chat/CodeBlock.tsx b/src/components/chat/CodeBlock.tsx
index 8fdf7efe..37f0a79e 100644
--- a/src/components/chat/CodeBlock.tsx
+++ b/src/components/chat/CodeBlock.tsx
@@ -205,6 +205,9 @@ export function CodeBlock({ code, language }: Props) {
background: 'rgba(0, 0, 0, 0.3)',
fontSize: '0.75rem',
}}
+ // The theme gives the inner <code> its own background. It is an
+ // inline element, so that colour showed as a band behind every line.
+ codeTagProps={{ style: { background: 'transparent' } }}
>
{displayCode}
</SyntaxHighlighter>
diff --git a/src/components/chat/CodexView.tsx b/src/components/chat/CodexView.tsx
index 773a1036..7499337c 100644
--- a/src/components/chat/CodexView.tsx
+++ b/src/components/chat/CodexView.tsx
@@ -28,6 +28,7 @@ import { LoopBar } from './LoopBar'
import { useSettingsStore } from '../../stores/settingsStore'
import { useModelStore } from '../../stores/modelStore'
import { useAnyAgentLoopActive } from '../../stores/agentLoopStore'
+import { useUIStore } from '../../stores/uiStore'
import { useAgentModeStore } from '../../stores/agentModeStore'
import {
CODEX_WORKDIR_LOCK_TITLE,
@@ -153,6 +154,8 @@ export function CodexView() {
// active one's.
const loop = useAnyAgentLoopActive()
const lockReason = codexBusyReason({ sendsInFlight, threads, generating: generatingMap, loop })
+ // The open explorer already says why the folder is held (explorer-workdir-lock).
+ const explorerCollapsed = useUIStore((s) => s.explorerCollapsed)
// Where the agent goes while no folder is picked: a per-chat workspace or
// settings.defaultWorkspace both beat an empty picker, so the header and the
@@ -225,7 +228,7 @@ export function CodexView() {
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>
+ <span className="text-[0.55rem] text-gray-600 dark:text-gray-400 font-medium whitespace-nowrap shrink-0">Coding Agent</span>
{/* Code-Review Mode badge (B13), makes it impossible to miss
that the agent is read-only. The toggle itself lives in
Settings → Codex Agent; clicking the badge jumps you there
@@ -250,7 +253,7 @@ export function CodexView() {
er ist eigentlich in Dokumenten"). Empty = per-chat sandbox under
~/agent-workspace, which is also where shell output now lands. */}
<span
- className="flex items-center gap-1 text-[0.5rem] text-gray-500 dark:text-gray-500 font-mono truncate max-w-[200px]"
+ className="flex items-center gap-1 text-[0.5rem] text-gray-500 dark:text-gray-500 font-mono truncate min-w-0 max-w-[200px]"
title={codexWorkingDir || `No folder picked, the agent works in ${fallbackLabel}`}
>
<Folder size={9} className="shrink-0 opacity-70" />
@@ -279,7 +282,7 @@ export function CodexView() {
<button
onClick={startNewSession}
title="New coding session (clears the current run, keeps the folder)"
- className="flex items-center gap-1 px-1.5 py-0.5 rounded text-[0.55rem] text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors"
+ className="flex items-center gap-1 px-1.5 py-0.5 rounded text-[0.55rem] text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors whitespace-nowrap shrink-0"
>
<RotateCcw size={10} />
<span>New</span>
@@ -305,8 +308,11 @@ export function CodexView() {
und ein `disabled` Knopf nimmt keine Mauszeiger-Ereignisse an, also
ist der Hinweis nie erschienen (derselbe Fehler wie im ExplorerPanel,
dort mit `explorer-workdir-lock` behoben). Ruhiger Ton, keine
- Warnfarbe: gesperrt ist ein Zustand, der von selbst endet. */}
- {lockReason && (
+ Warnfarbe: gesperrt ist ein Zustand, der von selbst endet.
+ Nur wenn es den Entfernen-Knopf gibt und der offene Explorer
+ denselben Satz nicht schon zeigt: sonst stand er zweimal
+ nebeneinander, einmal ueber nichts. */}
+ {lockReason && codexWorkingDir && explorerCollapsed && (
<p
data-testid="codex-workdir-lock"
className={`px-3 py-1 ${QUIET_HINT_TEXT} border-b border-gray-200 dark:border-white/[0.04]`}
diff --git a/src/components/chat/DiffView.tsx b/src/components/chat/DiffView.tsx
index 52ae1c9a..336d0841 100644
--- a/src/components/chat/DiffView.tsx
+++ b/src/components/chat/DiffView.tsx
@@ -1,4 +1,4 @@
-import { parseUnifiedDiff } from '../../lib/diff'
+import { parseUnifiedDiff, displayPath } from '../../lib/diff'
interface Props {
/** Raw unified-diff string as produced by `computeUnifiedDiff`. */
@@ -9,6 +9,9 @@ interface Props {
* collapse into a "+N more" line.
*/
maxLines?: number
+ /** False where the surrounding card already names the file and shows the
+ * counts (StagedChangesPanel); the path row is then left out. */
+ showPath?: boolean
}
/**
@@ -16,18 +19,20 @@ interface Props {
* not a full code editor — we colour add/remove/context lines and
* surface the per-hunk header so the user can see where edits landed.
*/
-export function DiffView({ diff, maxLines = 200 }: Props) {
+export function DiffView({ diff, maxLines = 200, showPath = true }: Props) {
if (!diff) return null
+ // The ---/+++ lines only repeat the path the row above already shows.
const parsed = parseUnifiedDiff(diff)
+ parsed.lines = parsed.lines.filter((l) => l.kind !== 'header')
const truncated = parsed.lines.length > maxLines
const lines = truncated ? parsed.lines.slice(0, maxLines) : parsed.lines
const hiddenCount = parsed.lines.length - lines.length
return (
<div className="rounded border border-white/10 bg-black/30 overflow-hidden">
- {(parsed.added > 0 || parsed.removed > 0) && (
+ {showPath && (parsed.added > 0 || parsed.removed > 0) && (
<div className="flex items-center justify-between px-2 py-1 border-b border-white/5 text-[0.55rem] font-mono">
- <span className="text-gray-500 truncate">{parsed.path || 'diff'}</span>
+ <span className="text-gray-500 truncate">{displayPath(parsed.path) || 'diff'}</span>
<span className="flex gap-2 shrink-0">
{parsed.added > 0 && (
<span className="text-emerald-400">+{parsed.added}</span>
@@ -40,13 +45,6 @@ export function DiffView({ diff, maxLines = 200 }: Props) {
)}
<pre className="t-micro leading-relaxed font-mono overflow-auto scrollbar-thin max-h-[300px]">
{lines.map((l, i) => {
- if (l.kind === 'header') {
- return (
- <div key={i} className="px-2 text-gray-600">
- {l.text}
- </div>
- )
- }
if (l.kind === 'hunk') {
return (
<div
diff --git a/src/components/chat/MessageBubble.tsx b/src/components/chat/MessageBubble.tsx
index c7a90314..b4f26afb 100644
--- a/src/components/chat/MessageBubble.tsx
+++ b/src/components/chat/MessageBubble.tsx
@@ -11,6 +11,7 @@ import { VramSwitchCard } from './VramSwitchCard'
import { SpeakerButton } from './SpeakerButton'
import { ChatArtifactCard } from './ChatArtifactCard'
import { displayModelName } from '../../api/providers/model-name'
+import { modelDisplayLabel } from '../../lib/model-label'
import type { Message } from '../../types/chat'
import { stripModelNoise } from '../../lib/strip-model-noise'
import { truncationNotice } from '../../lib/answer-notes'
@@ -69,6 +70,11 @@ function MessageBubbleImpl({ message, onRegenerate, onEdit, pendingApprovalId, o
activeConversationId ? s.agentModeActive[activeConversationId] ?? false : false
)
const activeModel = useModelStore((s) => s.activeModel)
+ // The catalogue's name for the model that wrote this turn ("Kimi K2.6"), the
+ // same one the picker shows. A string, so the selector stays stable.
+ const answeredByName = useModelStore((s) =>
+ message.modelId ? modelDisplayLabel(s.models, message.modelId) : '',
+ )
const toggleAgentMode = useAgentModeStore((s) => s.toggleAgentMode)
const userAvatarDataUrl = useSettingsStore((s) => s.settings.userAvatarDataUrl)
// Chat Tools (v2.5.3) gives plain chat web/file/image/video WITHOUT Agent Mode.
@@ -306,7 +312,7 @@ function MessageBubbleImpl({ message, onRegenerate, onEdit, pendingApprovalId, o
// Kennung davor ist unsere Adresse. Wer den Zeiger auf der Zeile
// ruhen liess, bekam sie zu sehen, obwohl sie ihm nichts sagt.
<div title={displayModelName(message.modelId)} className="t-mono text-gray-500 dark:text-gray-400 pl-1">
- {displayModelName(message.modelId)}
+ {answeredByName}
</div>
)}
{/* Thinking block — auto-expands while this (last) turn is still
diff --git a/src/components/chat/SamplingControls.tsx b/src/components/chat/SamplingControls.tsx
index f4b0ef9a..aa072182 100644
--- a/src/components/chat/SamplingControls.tsx
+++ b/src/components/chat/SamplingControls.tsx
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useId, useRef, useState } from 'react'
-import { X } from 'lucide-react'
+import { X, SlidersHorizontal } from 'lucide-react'
import { useSettingsStore } from '../../stores/settingsStore'
import { useChatStore } from '../../stores/chatStore'
import { HINWEIS_TEXT } from '../../lib/hinweis'
@@ -189,7 +189,9 @@ export function SamplingControls() {
<div className="relative text-xs" ref={wrapRef} data-testid="sampling-controls">
<button
type="button"
- className="text-gray-500 hover:text-gray-300"
+ // The composer row's own recipe, like Think and Docs beside it. It
+ // was plain text-xs (12px) in a row of 9.6px controls.
+ className="lu-control"
aria-expanded={open}
aria-controls={panelId}
data-testid="sampling-trigger"
@@ -202,7 +204,11 @@ export function SamplingControls() {
// disappear under the pointer on the second click.
onClick={() => setOpen(true)}
>
- Sampling: {value.temperature.toFixed(2)}
+ {/* In a narrow composer (the row is the @container, ChatInput.tsx)
+ an icon stands in for the word; title and aria-label keep it. */}
+ <SlidersHorizontal size={10} className="hidden @max-[30rem]:inline-block mr-1 -mt-px" />
+ <span className="@max-[30rem]:hidden">Sampling: </span>
+ {value.temperature.toFixed(2)}
{/* Ein geaenderter Regler ist kein Zwischenfall, also traegt der
Stern den ruhigen Ton und keine eigene Warnfarbe. */}
{changed && <span className={`ml-1 ${HINWEIS_TEXT.ruhig}`} title="Changed from the defaults">*</span>}
diff --git a/src/components/chat/SmallModelModeToggle.tsx b/src/components/chat/SmallModelModeToggle.tsx
index 55aeeb62..2f42f9ae 100644
--- a/src/components/chat/SmallModelModeToggle.tsx
+++ b/src/components/chat/SmallModelModeToggle.tsx
@@ -25,7 +25,7 @@ export function SmallModelModeToggle() {
: 'Small-Model Mode: a lean profile that helps small local models (3B-8B) emit valid tool calls and remember earlier steps. Click to turn on.'
}
className={
- 'flex items-center gap-1 px-1.5 py-0.5 rounded border transition-colors text-[0.55rem] ' +
+ 'flex items-center gap-1 px-1.5 py-0.5 rounded border transition-colors text-[0.55rem] whitespace-nowrap shrink-0 ' +
(on
? 'border-violet-500/40 bg-violet-500/[0.08] text-violet-600 dark:text-violet-300'
: 'border-gray-200 dark:border-white/[0.06] text-gray-500 hover:border-gray-400 dark:hover:border-white/15')
diff --git a/src/components/chat/StagedChangesPanel.tsx b/src/components/chat/StagedChangesPanel.tsx
index 18771ca8..13801611 100644
--- a/src/components/chat/StagedChangesPanel.tsx
+++ b/src/components/chat/StagedChangesPanel.tsx
@@ -3,6 +3,7 @@ import { Check, X, ChevronDown, ChevronRight, FileText } from 'lucide-react'
import { useStagedChangesStore, type StagedChange } from '../../stores/stagedChangesStore'
import { applyStagedChange } from '../../lib/staged-apply'
import { DiffView } from './DiffView'
+import { displayPath, parseUnifiedDiff } from '../../lib/diff'
import { log } from '../../lib/logger'
import { HINWEIS_TEXT, HINWEIS_ZEILE } from '../../lib/hinweis'
@@ -128,20 +129,27 @@ export function StagedChangesPanel({ chatId }: Props) {
<div className="px-1.5 pb-2 space-y-1.5 max-h-[40vh] overflow-y-auto scrollbar-thin" data-testid="staged-changes-list">
{changes.map((change) => {
const isApplying = applying.has(change.id)
+ const counts = change.diff ? parseUnifiedDiff(change.diff) : null
return (
<div
key={change.id}
className="rounded border border-gray-200 dark:border-white/[0.08] bg-white dark:bg-black/20"
data-testid="staged-change"
>
- <div className="flex items-center justify-between gap-1 px-1.5 py-1 border-b border-gray-100 dark:border-white/[0.04]">
+ <div className="flex items-center justify-between gap-1 px-1.5 py-1 border-b border-gray-100 dark:border-white/[0.04] text-[0.55rem]">
<span
- className="text-[0.55rem] font-mono truncate text-gray-700 dark:text-gray-300"
+ className="font-mono truncate text-gray-700 dark:text-gray-300"
title={change.path}
>
- {change.path}
+ {displayPath(change.path)}
</span>
<span className="flex items-center gap-0.5 shrink-0">
+ {counts && counts.added > 0 && (
+ <span className="font-mono text-emerald-500 pr-0.5">+{counts.added}</span>
+ )}
+ {counts && counts.removed > 0 && (
+ <span className="font-mono text-red-400 pr-0.5">-{counts.removed}</span>
+ )}
<button
onClick={() => applyOne(change)}
disabled={isApplying}
@@ -177,7 +185,7 @@ export function StagedChangesPanel({ chatId }: Props) {
)}
{change.diff && (
<div className="text-[0.5rem]">
- <DiffView diff={change.diff} maxLines={40} />
+ <DiffView diff={change.diff} maxLines={40} showPath={false} />
</div>
)}
</div>
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
index fd3d1233..8b308c86 100644
--- 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
@@ -162,11 +162,16 @@ describe('the action bar is one quiet row', () => {
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', () => {
+ it('gives way in the middle, then only at the model name, so Stop stays in the frame', () => {
+ // UX pass 30.09.2026: in the Code tab with the explorer open (900 px
+ // window) the fixed row was wider than the composer and pushed Stop out
+ // of the frame. The spacer still gives way first; after it only the model
+ // slot shrinks, down to a floor, and its name ellipsizes.
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>/)
+ expect(row).toMatch(/<div className="min-w-\[4rem\] shrink">\{composerModel\}<\/div>/)
+ expect(row).toMatch(/<div className="shrink-0"><SamplingControls \/><\/div>/)
})
it('the Code mode trigger grows sideways when a run starts, never downwards', () => {
diff --git a/src/components/chat/__tests__/the-header-can-let-the-folder-go.test.ts b/src/components/chat/__tests__/the-header-can-let-the-folder-go.test.ts
index 4b904bc6..964c3445 100644
--- a/src/components/chat/__tests__/the-header-can-let-the-folder-go.test.ts
+++ b/src/components/chat/__tests__/the-header-can-let-the-folder-go.test.ts
@@ -150,12 +150,24 @@ describe('the header shows the folder, so it also gives it back', () => {
act(() => {
useCodexStore.getState().setWorkingDirectory(WINDOWS_PATH)
useCodexStore.getState().beginSend()
+ useUIStore.getState().setExplorerCollapsed(true)
})
await show()
const lock = screen.getByTestId('codex-workdir-lock')
expect(lock.textContent).toContain('Wait for it to finish or press Stop')
})
+ it('says it once: with the explorer open, only the explorer does', async () => {
+ // Both lines stood next to each other in the UX pass 30.09.2026. The
+ // explorer's own line is covered by its tests (explorer-workdir-lock).
+ act(() => {
+ useCodexStore.getState().setWorkingDirectory(WINDOWS_PATH)
+ useCodexStore.getState().beginSend()
+ })
+ await show()
+ expect(screen.queryByTestId('codex-workdir-lock')).toBeNull()
+ })
+
it('and shows no lock line while nothing holds the folder (negative control)', async () => {
act(() => useCodexStore.getState().setWorkingDirectory(WINDOWS_PATH))
await show()
diff --git a/src/components/models/ModelSelector.tsx b/src/components/models/ModelSelector.tsx
index c1a9c67d..acc7c857 100644
--- a/src/components/models/ModelSelector.tsx
+++ b/src/components/models/ModelSelector.tsx
@@ -9,7 +9,7 @@ import { useSettingsStore } from '../../stores/settingsStore'
import { useUIStore } from '../../stores/uiStore'
import { unloadAllModels, loadModel, unloadModel, listRunningModels } from '../../api/ollama'
import { displayModelName, getProviderIdFromModel } from '../../api/providers'
-import { splitForMiddleEllipsis, shortModelLabel } from '../../lib/model-label'
+import { splitForMiddleEllipsis, modelDisplayLabel } from '../../lib/model-label'
import { formatContextWindow } from '../../lib/formatters'
import { activateBuiltinModel, isManagedBuiltinActive } from '../../api/engine'
import { diagnoseBuiltinEngine } from '../../api/builtin-ensure'
@@ -1231,17 +1231,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy
const wechselLaeuft = isModelLoading || imWechselZu !== null
|| (swapLaeuft && getProviderIdFromModel(gezeigtesModell ?? '') === 'openai')
const gezeigtesObj = models.find((m) => m.name === gezeigtesModell)
- const activeDisplayName = gezeigtesModell
- ? (gezeigtesObj && 'displayName' in gezeigtesObj && gezeigtesObj.displayName) ||
- // F3 (3.0.1): `.split(':')[0]` here truncated at the FIRST colon in the
- // model id, not just the `provider::model` prefix `displayModelName`
- // already stripped. An Ollama tag ("llama3.1:8b-instruct-q4_K_M") uses
- // a single colon as its OWN separator, so the header showed only
- // "llama3.1" while the dropdown row below it, which never split on
- // ':', showed the real, full name. Dropped the split entirely so the
- // header matches the row (both go through shortModelLabel only).
- shortModelLabel(displayModelName(gezeigtesModell))
- : 'Select Model'
+ const activeDisplayName = gezeigtesModell ? modelDisplayLabel(models, gezeigtesModell) : 'Select Model'
// Der Punkt folgt demselben Modell wie der Name daneben, sonst haette der
// Knopf waehrend eines Wechsels zwei Aussagen in sich.
const activeType = gezeigtesObj?.type || 'text'
@@ -1311,7 +1301,9 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy
// Akzent, die Aussage steht damit im selben Vokabular wie der Rest
// der Leiste, und im Accessibility-Baum, wo sie hingehoert.
aria-busy={wechselLaeuft}
- className="lu-control"
+ // max-w-full + min-w-0 below: in a tight composer row the name
+ // ellipsizes inside the slot ChatInput lets shrink.
+ className="lu-control max-w-full"
>
{/* Type indicator dot */}
<span className={`w-1.5 h-1.5 rounded-full ${
@@ -1320,7 +1312,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy
{/* Model name. Keine eigene Textfarbe mehr, sie wird vom Control
geerbt, sonst haette der Knopf zwei Graustufen in sich. */}
- <span className="max-w-[140px] truncate leading-none">
+ <span className="min-w-0 max-w-[140px] truncate leading-none">
{activeDisplayName}
</span>
diff --git a/src/components/models/__tests__/der-knopf-nennt-immer-das-angeklickte.test.ts b/src/components/models/__tests__/der-knopf-nennt-immer-das-angeklickte.test.ts
index 19755efa..b367d95e 100644
--- a/src/components/models/__tests__/der-knopf-nennt-immer-das-angeklickte.test.ts
+++ b/src/components/models/__tests__/der-knopf-nennt-immer-das-angeklickte.test.ts
@@ -43,7 +43,7 @@ function knopf(): string {
describe('der Name im Knopf', () => {
it('ist das angeklickte Modell, solange der Wechsel laeuft', () => {
expect(SRC).toContain('const gezeigtesModell = imWechselZu ?? activeModel')
- expect(SRC).toContain('displayModelName(gezeigtesModell)')
+ expect(SRC).toContain('modelDisplayLabel(models, gezeigtesModell)')
})
it('der Waehler merkt sich den Klick, bevor er zu warten anfaengt', () => {
diff --git a/src/hooks/useAutoScroll.ts b/src/hooks/useAutoScroll.ts
index 3412f2ad..2fd4d804 100644
--- a/src/hooks/useAutoScroll.ts
+++ b/src/hooks/useAutoScroll.ts
@@ -38,16 +38,24 @@ export function useAutoScroll(dependency: unknown, resumeKey?: unknown) {
// Follow every content-height change, not just the ones a trigger string
// anticipated. Pinning inside the observer cannot loop: setting scrollTop
// does not resize the content.
+ // Re-attached on every new user message: the content element only mounts
+ // once a transcript exists (the Code tab shows its empty state before), and
+ // a one-time attach at mount never saw it. The scroll area itself is
+ // watched too: a panel opening above it (pending writes in the Code tab)
+ // shrinks it, and the bottom, with an approval card on it, slipped out of
+ // view while nothing had scrolled (UX pass 30.09.2026).
useEffect(() => {
const content = contentRef.current
- if (!content || typeof ResizeObserver === 'undefined') return
+ const box = ref.current
+ if (!content || !box || typeof ResizeObserver === 'undefined') return
const ro = new ResizeObserver(() => {
const el = ref.current
if (shouldScroll.current && el) el.scrollTop = el.scrollHeight
})
ro.observe(content)
+ ro.observe(box)
return () => ro.disconnect()
- }, [])
+ }, [resumeKey])
useEffect(() => {
if (resumeKey === undefined) return
diff --git a/src/hooks/useChat.ts b/src/hooks/useChat.ts
index c0b437cf..cca10b86 100644
--- a/src/hooks/useChat.ts
+++ b/src/hooks/useChat.ts
@@ -1053,8 +1053,13 @@ export function useChat() {
// only shows in the chat whose turn is in flight — not in every other chat
// the user switches to (David 2026-06-12). Cleared in finally.
useGenerationStore.getState().setGenerating(convId, true)
- setIsLoadingModel(true)
- useModelStore.getState().setIsModelLoading(true)
+ // Only a local model is loaded before it answers. A cloud model read
+ // "Loading model" under every reply and spun the picker as if it were
+ // switching models, until the first token arrived.
+ if (isLocalModelByName(activeModel)) {
+ setIsLoadingModel(true)
+ useModelStore.getState().setIsModelLoading(true)
+ }
// Owns this turn's streamed text end to end, see the ChatRun doc comment
// above. `convId` is fixed at this point: the `if (!convId)` branch above
// already resolved it to a real string.
diff --git a/src/lib/__tests__/diff.test.ts b/src/lib/__tests__/diff.test.ts
index 7b389cbd..9d15835e 100644
--- a/src/lib/__tests__/diff.test.ts
+++ b/src/lib/__tests__/diff.test.ts
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest'
-import { computeUnifiedDiff, parseUnifiedDiff } from '../diff'
+import { computeUnifiedDiff, parseUnifiedDiff, displayPath } from '../diff'
describe('computeUnifiedDiff', () => {
it('returns empty string when texts are identical', () => {
@@ -143,3 +143,23 @@ describe('hunks are split, and large files do not build a giant LCS table', () =
expect(parsed.added).toBe(3000)
})
})
+
+describe('what the staged card shows (UX pass 30.09.2026)', () => {
+ it('a new three-line file is three added lines, not four', () => {
+ const parsed = parseUnifiedDiff(computeUnifiedDiff('src/Hero.tsx', '', 'a\nb\nc\n'))
+ expect(parsed.added).toBe(3)
+ expect(parsed.lines.filter((l) => l.kind === 'add').map((l) => l.text)).toEqual(['a', 'b', 'c'])
+ })
+
+ it('an edit near the end does not report a phantom last line', () => {
+ const parsed = parseUnifiedDiff(computeUnifiedDiff('a.ts', 'x\ny\n', 'x\nz\n'))
+ expect(parsed.added).toBe(1)
+ expect(parsed.removed).toBe(1)
+ })
+
+ it('shows the path the way people write it', () => {
+ expect(displayPath('./src/components/Hero.tsx')).toBe('src/components/Hero.tsx')
+ expect(displayPath('src/a.ts')).toBe('src/a.ts')
+ expect(displayPath('../up.ts')).toBe('../up.ts')
+ })
+})
diff --git a/src/lib/__tests__/model-label-colon.test.ts b/src/lib/__tests__/model-label-colon.test.ts
index 2f9ed18c..a80cc03d 100644
--- a/src/lib/__tests__/model-label-colon.test.ts
+++ b/src/lib/__tests__/model-label-colon.test.ts
@@ -15,7 +15,7 @@
import { describe, it, expect } from 'vitest'
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
-import { shortModelLabel } from '../model-label'
+import { shortModelLabel, modelDisplayLabel } from '../model-label'
import { displayModelName } from '../../api/providers/model-name'
describe('F3: the model header keeps everything after a colon', () => {
@@ -36,6 +36,16 @@ describe('F3: the model header keeps everything after a colon', () => {
it('ModelSelector.tsx no longer truncates the header at the first colon', () => {
const src = readFileSync(resolve(__dirname, '../../components/models/ModelSelector.tsx'), 'utf8')
expect(src).not.toContain("displayModelName(gezeigtesModell).split(':')[0]")
- expect(src).toContain('shortModelLabel(displayModelName(gezeigtesModell))')
+ expect(src).toContain('modelDisplayLabel(models, gezeigtesModell)')
+ })
+
+ it('the shared label keeps the full Ollama tag and prefers the catalogue name', () => {
+ expect(modelDisplayLabel([], 'ollama::llama3.1:8b-instruct-q4_K_M')).toBe(
+ shortModelLabel(displayModelName('ollama::llama3.1:8b-instruct-q4_K_M')),
+ )
+ expect(modelDisplayLabel([], 'ollama::llama3.1:8b-instruct-q4_K_M')).toContain('8b-instruct')
+ expect(modelDisplayLabel([{ name: 'lu-cloud::moonshotai/Kimi-K2.6', displayName: 'Kimi K2.6' }], 'lu-cloud::moonshotai/Kimi-K2.6')).toBe('Kimi K2.6')
+ // The answer bubble keeps the bare id; it still gets the catalogue name.
+ expect(modelDisplayLabel([{ name: 'lu-cloud::moonshotai/Kimi-K2.6', displayName: 'Kimi K2.6' }], 'moonshotai/Kimi-K2.6')).toBe('Kimi K2.6')
})
})
diff --git a/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts b/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts
index 56b8d3d1..a53233a6 100644
--- a/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts
+++ b/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts
@@ -104,6 +104,6 @@ describe('verdrahtet', () => {
it('und der Knopf im Eingabefeld traegt keinen Pfad mehr', () => {
expect(lies('components/models/ModelSelector.tsx'))
- .toContain('shortModelLabel(displayModelName(gezeigtesModell)')
+ .toContain('modelDisplayLabel(models, gezeigtesModell)')
})
})
diff --git a/src/lib/diff.ts b/src/lib/diff.ts
index 444fb03c..8a32f023 100644
--- a/src/lib/diff.ts
+++ b/src/lib/diff.ts
@@ -43,8 +43,8 @@ export function computeUnifiedDiff(
newText: string,
context = 3,
): string {
- const a = oldText === '' ? [] : oldText.split('\n')
- const b = newText === '' ? [] : newText.split('\n')
+ const a = toLines(oldText)
+ const b = toLines(newText)
const ops = diffLines(a, b)
if (ops.every((o) => o.kind === 'equal')) {
return ''
@@ -145,6 +145,23 @@ export function computeUnifiedDiff(
return out.join('\n')
}
+/**
+ * A file's lines. The newline that ends the last line does not open another
+ * one: "a\nb\n" is two lines, not three. Split plainly, every new file showed
+ * an empty added line at the end and counted it (+4 for three lines).
+ */
+function toLines(text: string): string[] {
+ if (text === '') return []
+ const lines = text.split('\n')
+ if (lines[lines.length - 1] === '') lines.pop()
+ return lines
+}
+
+/** A path as people read it: "./src/a.ts" is "src/a.ts". */
+export function displayPath(path: string): string {
+ return path.replace(/^(?:\.\/)+/, '')
+}
+
export function parseUnifiedDiff(diff: string): ParsedDiff {
const lines = diff.split('\n')
const out: DiffLine[] = []
diff --git a/src/lib/model-label.ts b/src/lib/model-label.ts
index cbce0a1a..1a9e6695 100644
--- a/src/lib/model-label.ts
+++ b/src/lib/model-label.ts
@@ -1,3 +1,6 @@
+import { displayModelName } from '../api/providers/model-name'
+
+
/**
* Wie ein Modellname in einer schmalen Zeile aussieht, ohne dass zwei
* verschiedene Modelle gleich aussehen.
@@ -47,6 +50,24 @@ export function shortModelLabel(name: string): string {
return letzter.replace(/\.gguf$/i, '')
}
+/**
+ * The name the app shows for a model: the catalogue's display name when the
+ * model list carries one ("Kimi K2.6"), else the short form of its id. The
+ * picker and the empty chat both read it here, so the landing line no longer
+ * shows `moonshotai/Kimi-K2.6` while the picker right below says "Kimi K2.6".
+ */
+export function modelDisplayLabel(
+ models: ReadonlyArray<{ name: string; displayName?: string }>,
+ modelName: string,
+): string {
+ // A message keeps the bare id ("moonshotai/Kimi-K2.6") while the list
+ // carries the routed one ("lu-cloud::moonshotai/Kimi-K2.6"): same model.
+ const bare = displayModelName(modelName)
+ const found =
+ models.find((m) => m.name === modelName) ?? models.find((m) => displayModelName(m.name) === bare)
+ return found?.displayName || shortModelLabel(bare)
+}
+
/**
* Derselbe Name, aufgeteilt in einen Kopf, der gekuerzt werden darf, und ein
* Ende, das stehen bleiben muss.
diff --git a/src/types/react-syntax-highlighter.d.ts b/src/types/react-syntax-highlighter.d.ts
index 92ff972b..89e3dfa9 100644
--- a/src/types/react-syntax-highlighter.d.ts
+++ b/src/types/react-syntax-highlighter.d.ts
@@ -37,6 +37,8 @@ declare module 'react-syntax-highlighter/dist/esm/prism-light' {
style?: Record<string, CSSProperties>
/** Merged onto the generated `<pre>`. */
customStyle?: CSSProperties
+ /** Props for the inner <code> element. */
+ codeTagProps?: { style?: CSSProperties; className?: string }
/** The source to highlight. */
children: string | string[]
}