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(chat): das Promptfenster ist so breit wie im Create-Tab

purpleaef5a1f6f794
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx
index d01f91a8..1311a54d 100644
--- a/src/components/chat/ChatInput.tsx
+++ b/src/components/chat/ChatInput.tsx
@@ -11,6 +11,7 @@ import { isThinkingCompatible, isVisionCompatible, declaredVision } from '../../
import { clampEffort, effortChoices, effortLabel, nextEffort, DEFAULT_EFFORT } from '../../lib/effort'
import type { AgentToolCall } from '../../types/agent-mode'
import type { ImageAttachment } from '../../types/chat'
+import { COMPOSER_MAX_W } from './composer-width'
interface Props {
onSend: (content: string, images?: ImageAttachment[]) => void
@@ -261,7 +262,7 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
}, [addFiles])
return (
- <div className="px-3 pb-2 pt-1 w-full max-w-[70%] mx-auto">
+ <div className={`px-3 pb-2 pt-1 w-full ${COMPOSER_MAX_W} mx-auto`}>
{/* Approval used to live here as a popup over the chat input.
Per user feedback ("eventuell in den chat einarbeiten") it now
renders INSIDE the pending tool-call block in MessageList, so
diff --git a/src/components/chat/GoalBar.tsx b/src/components/chat/GoalBar.tsx
index 58805f2a..39af4e1b 100644
--- a/src/components/chat/GoalBar.tsx
+++ b/src/components/chat/GoalBar.tsx
@@ -8,6 +8,7 @@
import { X, Target } from 'lucide-react'
import { useAgentGoalStore } from '../../stores/agentGoalStore'
import { useChatStore } from '../../stores/chatStore'
+import { COMPOSER_MAX_W } from './composer-width'
export function GoalBar() {
const activeConversationId = useChatStore((s) => s.activeConversationId)
@@ -17,7 +18,7 @@ export function GoalBar() {
if (!activeConversationId || !goal?.text) return null
return (
- <div className="w-full max-w-[70%] mx-auto px-3 pb-1 flex justify-center">
+ <div className={`w-full ${COMPOSER_MAX_W} mx-auto px-3 pb-1 flex justify-center`}>
<div className="w-full flex items-center gap-1.5 px-2 py-1 rounded-md border border-purple-500/20 bg-purple-500/[0.04]">
<Target size={9} className="text-purple-400 shrink-0" />
<span className="text-[0.55rem] uppercase tracking-wider text-gray-500 shrink-0">goal</span>
diff --git a/src/components/chat/GroupCostHint.tsx b/src/components/chat/GroupCostHint.tsx
index cc17fb03..277c89f3 100644
--- a/src/components/chat/GroupCostHint.tsx
+++ b/src/components/chat/GroupCostHint.tsx
@@ -14,6 +14,7 @@ import { Users } from 'lucide-react'
import { useChatStore } from '../../stores/chatStore'
import { useProviderStore } from '../../stores/providerStore'
import { isGroupChat } from '../../lib/group-chat'
+import { COMPOSER_MAX_W } from './composer-width'
/** The line itself. Kept pure so the wording is testable without a renderer.
*
@@ -51,7 +52,7 @@ export function GroupCostHint() {
: 0
return (
- <div className="w-full max-w-[70%] mx-auto px-3 pb-1 flex justify-center">
+ <div className={`w-full ${COMPOSER_MAX_W} mx-auto px-3 pb-1 flex justify-center`}>
<div className="w-full flex items-center gap-1.5 px-2 py-1 rounded-md border border-amber-500/20 bg-amber-500/[0.04]">
<Users size={9} className="text-amber-400 shrink-0" />
<span className="text-[0.55rem] uppercase tracking-wider text-gray-500 shrink-0">group</span>
diff --git a/src/components/chat/LoopBar.tsx b/src/components/chat/LoopBar.tsx
index 4326569a..c9563c1e 100644
--- a/src/components/chat/LoopBar.tsx
+++ b/src/components/chat/LoopBar.tsx
@@ -8,6 +8,7 @@ import { useEffect, useState } from 'react'
import { RefreshCw, Square } from 'lucide-react'
import { useAgentLoopStore } from '../../stores/agentLoopStore'
import { useChatStore } from '../../stores/chatStore'
+import { COMPOSER_MAX_W } from './composer-width'
interface Props {
/** Stops the run AND the pending pass. */
@@ -31,7 +32,7 @@ export function LoopBar({ onStop }: Props) {
const passLabel = loop.cap > 0 ? `pass ${loop.pass} of ${loop.cap}` : `pass ${loop.pass}`
return (
- <div className="w-full max-w-[70%] mx-auto px-3 pb-1 flex justify-center">
+ <div className={`w-full ${COMPOSER_MAX_W} mx-auto px-3 pb-1 flex justify-center`}>
<div className="w-full flex items-center gap-1.5 px-2 py-1 rounded-md border border-blue-500/25 bg-blue-500/[0.05]">
<RefreshCw size={9} className="text-blue-400 shrink-0 animate-spin" style={{ animationDuration: '3s' }} />
<span className="text-[0.55rem] uppercase tracking-wider text-gray-500 shrink-0">loop</span>
diff --git a/src/components/chat/__tests__/das-promptfenster-ist-so-breit-wie-create.test.ts b/src/components/chat/__tests__/das-promptfenster-ist-so-breit-wie-create.test.ts
new file mode 100644
index 00000000..447d7beb
--- /dev/null
+++ b/src/components/chat/__tests__/das-promptfenster-ist-so-breit-wie-create.test.ts
@@ -0,0 +1,70 @@
+/**
+ * Das Promptfenster und die drei Leisten darueber sind GENAU gleich breit.
+ *
+ * David, 03.09.2026, am echten Windows-Build: das Fenster im Chat und im
+ * Coding-Bereich war ihm zu gross und soll so breit sein wie im Create-Tab,
+ * eventuell minimal groesser, "so dass jedes UI Button platz dafuer hat".
+ *
+ * Gemessen waren es 1258 px gegen 760 px in Create, weil hier `max-w-[70%]`
+ * stand. Die Zahl liegt jetzt in `composer-width.ts`, und dieser Test haelt
+ * sie dort: LoopBar, GoalBar und GroupCostHint kleben direkt UEBER dem
+ * Fenster. Wer eine der vier Stellen wieder mit einer eigenen Zahl versieht,
+ * bekommt Leisten, die breiter sind als das Fenster darunter.
+ *
+ * Run: npx vitest run src/components/chat/__tests__/das-promptfenster-ist-so-breit-wie-create.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'fs'
+import { resolve } from 'path'
+import { COMPOSER_MAX_W } from '../composer-width'
+
+const CHAT = resolve(__dirname, '..')
+const CREATE_COMPOSER = resolve(__dirname, '../../create/experimental/Composer.tsx')
+
+/** Die vier Stellen, die zusammen das Promptfenster und seine Leisten sind. */
+const STELLEN = ['ChatInput.tsx', 'LoopBar.tsx', 'GoalBar.tsx', 'GroupCostHint.tsx']
+
+describe('das Promptfenster ist so breit wie im Create-Tab', () => {
+ it('keine der vier Stellen traegt eine eigene Breite', () => {
+ for (const datei of STELLEN) {
+ const src = readFileSync(resolve(CHAT, datei), 'utf8')
+ // NEGATIVKONTROLLE des alten Zustands: genau dieser Ausdruck stand in
+ // allen vier Dateien und ist der Grund fuer 1258 px.
+ expect(src, `${datei} ist wieder auf einen Prozentwert zurueckgefallen`)
+ .not.toMatch(/max-w-\[70%\]/)
+ // Und auch keine andere eigene Zahl, egal welche.
+ expect(src, `${datei} setzt seine Breite selbst statt COMPOSER_MAX_W zu nehmen`)
+ .not.toMatch(/max-w-\[[^\]]+\]/)
+ expect(src, `${datei} liest die Breite nicht aus composer-width`)
+ .toMatch(/COMPOSER_MAX_W/)
+ }
+ })
+
+ it('die Breite ist Creates Breite plus etwas, und nicht weniger', () => {
+ const create = readFileSync(CREATE_COMPOSER, 'utf8')
+ const treffer = create.match(/max-w-\[(\d+)px\]/)
+ expect(treffer, 'im Create-Composer steht keine Breite mehr, an der man sich messen kann').not.toBeNull()
+ const createBreite = Number(treffer![1])
+
+ const eigene = COMPOSER_MAX_W.match(/^max-w-\[(\d+)px\]$/)
+ expect(eigene, `COMPOSER_MAX_W ist keine feste Pixelzahl: ${COMPOSER_MAX_W}`).not.toBeNull()
+ const breite = Number(eigene![1])
+
+ // "so gross wie im create tab, eventuell minimal groesser": nicht
+ // schmaler, und nicht mehr als 120 px darueber, sonst ist es nicht mehr
+ // minimal und der Wunsch ist wieder verfehlt.
+ expect(breite).toBeGreaterThanOrEqual(createBreite)
+ expect(breite).toBeLessThanOrEqual(createBreite + 120)
+ })
+
+ it('die Leiste bricht nicht um: die Breite deckt die gemessene Mindestbreite mit Luft', () => {
+ // Am laufenden Release-Build gemessen, 03.09.2026: die Aktionsleiste im
+ // Chat brauchte im Ruhezustand 532 px (feste Teile 486, Abstaende 28,
+ // Innenrand 18). Waehrend eines Laufs kommen der Effort-Regler und der
+ // Stop-Knopf dazu, und ein langer Modellname wiegt schwerer als der
+ // gemessene. Deshalb ist hier Luft eingefordert und nicht nur Deckung.
+ const GEMESSENE_MINDESTBREITE = 532
+ const breite = Number(COMPOSER_MAX_W.match(/(\d+)/)![1])
+ expect(breite).toBeGreaterThan(GEMESSENE_MINDESTBREITE + 200)
+ })
+})
diff --git a/src/components/chat/composer-width.ts b/src/components/chat/composer-width.ts
new file mode 100644
index 00000000..cdd9cc7e
--- /dev/null
+++ b/src/components/chat/composer-width.ts
@@ -0,0 +1,29 @@
+/**
+ * Wie breit das Promptfenster ist, an EINER Stelle.
+ *
+ * David, 03.09.2026, am echten Windows-Build: "prompt fenster auf windows im
+ * chat bzw coding bereich ist mir etwas zu gross, lieber so gross wie im
+ * create tab, eventuell minimal groesser, so dass jedes UI Button platz
+ * dafuer hat."
+ *
+ * Nachgemessen im laufenden Release-Build (1920x1040): das Fenster war
+ * 1258 px breit, weil hier `max-w-[70%]` stand. Der Create-Tab hat eine feste
+ * Zahl, `max-w-[760px]`, und genau deshalb sieht er ruhiger aus.
+ *
+ * Die Zahl unten ist Creates 760 plus 60, also minimal groesser, wie erbeten.
+ * Der Grund fuer das Plus steht in derselben Messung: die Aktionsleiste hier
+ * traegt mehr Bedienelemente als die in Create und braucht im Ruhezustand
+ * mindestens 532 px (Klammer, Mikrofon, Think, Werkzeuge, Modellwaehler,
+ * Senden, plus Abstaende und Innenrand). In die restlichen 288 px passen der
+ * Effort-Regler und der Stop-Knopf, die erst waehrend eines Laufs dazukommen,
+ * und ein langer Modellname. Die Leiste bricht deshalb nicht um, und genau das
+ * war Davids Bedingung.
+ *
+ * Warum als Konstante und nicht viermal im JSX: direkt UEBER dem Fenster
+ * sitzen drei weitere Leisten (LoopBar, GoalBar, GroupCostHint), die genau so
+ * breit sein muessen. Vier Zahlen an vier Stellen heisst, dass eine geaendert
+ * wird und drei driften, und dann stehen die Leisten breiter als das Fenster,
+ * unter dem sie kleben. Das ist das teuerste Muster im Haus, zwei Pfade und
+ * einer gepflegt, hier viermal.
+ */
+export const COMPOSER_MAX_W = 'max-w-[820px]'