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): leere aktive Unterhaltung zeigt jetzt den Leerzustand-Block

purple46f88100c1b5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 472bcb46..78809736 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -156,6 +156,12 @@ installs stop losing environment variables to it.
area allowed the browser to scroll it into view when a clicked control sat
partly off screen. That area no longer accepts a programmatic scroll, so it
stays put.
+- **A brand new chat no longer shows a blank screen.** Right after "+ New
+ Chat", with the side panel open, the main area could stay completely empty:
+ no greeting, no history, nothing, even after a full reload of the same
+ still-empty chat. Only switching to another tab and back brought it
+ around. The greeting now shows for that chat from the first frame, the
+ same as before the first message is sent.
## [3.0.0] - 2026-09-13
diff --git a/e2e/leerzustand-sitzt-mittig.spec.ts b/e2e/leerzustand-sitzt-mittig.spec.ts
index 4864c666..01460ad2 100644
--- a/e2e/leerzustand-sitzt-mittig.spec.ts
+++ b/e2e/leerzustand-sitzt-mittig.spec.ts
@@ -1,7 +1,7 @@
import { test, expect, type Page } from '@playwright/test'
import { tauriMockInit, DEFAULT_ASSISTANT_REPLY, DEFAULT_MODEL_NAME } from './support/tauri-mock'
import { seedOnboardingDone } from './support/cloud-mock'
-import { openNewChat } from './support/ui'
+import { openNewChat, oeffneSeitenleiste } from './support/ui'
/**
* David, 19.09.2026: "Ask LU anything" (der Leerzustand vor der ersten
@@ -116,22 +116,93 @@ test('New-Chat-Recents-Leerzustand sitzt mittig (Seitenleiste zu)', async ({ pag
// Past the AnimatePresence exit/enter transition, sonst liest man noch den
// alten "home"-Baum.
await expect(page.getByTestId('chat-session-strip')).toBeVisible()
- const m = await page.evaluate(() => {
- const recents = document.querySelector('[data-testid="home-recent-chats"]') as HTMLElement | null
- if (!recents) return null
- const area = recents.parentElement as HTMLElement
- const aRect = area.getBoundingClientRect()
- const children = Array.from(area.children) as HTMLElement[]
- const first = children[0].getBoundingClientRect()
- const last = children[children.length - 1].getBoundingClientRect()
- const blockCenterY = (first.top + last.bottom) / 2
- const areaCenterY = (aRect.top + aRect.bottom) / 2
- const areaHeight = aRect.height
- const deviationPct = ((blockCenterY - areaCenterY) / areaHeight) * 100
- return { blockCenterY, areaCenterY, areaHeight, deviationPct }
+ // F1-Fix (David, 19.09.2026, box-gruen/n2/BERICHT.md): der Block fuer eine
+ // aktive, leere Unterhaltung ist jetzt derselbe `chat-landing`-Block wie
+ // die Eingangsseite (Zeichen, "Ask LU anything", Modellname), nur MIT der
+ // Recents-Liste darunter statt ohne sie. Dieselbe `measureLanding`-Funktion
+ // wie fuer die anderen Faelle greift deshalb unveraendert.
+ await expect(page.getByTestId('home-recent-chats')).toBeVisible()
+ const m = await measureLanding(page)
+ expectMittig(m)
+})
+
+/**
+ * F2 (David, 19.09.2026, box-gruen/n2/BERICHT.md Teil A): der Remote-Reiter
+ * (Dispatch-Ansicht, noch keine dispatchte Unterhaltung) lief in der
+ * Windows-Feldsitzung 8,7 % von der Flaechenmitte weg statt der im
+ * Code-Reiter gemessenen 1,3 %. Quelltextlich ist es DERSELBE `!activeConversationId`-
+ * Zweig wie im Chat-Reiter (Sidebar.tsx setzt beim Klick auf "Remote"
+ * `setActiveConversation(dispatchedConversationId)`, und ohne vorherigen
+ * Dispatch ist das `undefined`/`null`), kein eigener Leerzustand-Code. Die
+ * Feldmessung stammt vermutlich von einem Bau vor dem `justify-center`-Fix
+ * dieser Datei. Live gemessen haelt dieser Test die Behauptung "denselben
+ * Codepfad, dieselbe Mitte" nach.
+ */
+for (const { label, width, height } of sizes) {
+ test(`Remote-Leerzustand (Dispatch) sitzt mittig bei ${label}`, async ({ page }) => {
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME })
+ await seedOnboardingDone(page)
+ await page.setViewportSize({ width, height })
+ await page.goto('/')
+ await expect(page.getByTestId('chat-landing')).toBeVisible()
+ await page.getByRole('button', { name: 'Remote', exact: true }).first().click()
+ await expect(page.getByTestId('chat-landing')).toBeVisible()
+ const m = await measureLanding(page)
+ expectMittig(m)
})
- expect(m, '[data-testid="home-recent-chats"] not found').not.toBeNull()
- expectMittig(m as Measurement)
+}
+
+/**
+ * F1 (David, 19.09.2026, box-gruen/n2/BERICHT.md Teil A, schwerer Nebenfund):
+ * "+ New Chat" legt sofort eine aktive, aber leere Unterhaltung an
+ * (`createConversation` setzt `activeConversationId` synchron, chatStore.ts).
+ * Die alte Bedingung fuer den Leerzustand-Block war `!activeConversationId`
+ * (traf auf diese Lage nie zu), plus ein zweiter Block NUR bei
+ * zugeklappter Seitenleiste. Bei AUFGEKLAPPTER Seitenleiste (die Windows-
+ * Feldsitzung stand so, siehe n2/shots/n9r-chat-blank1.png) rendert deshalb
+ * NICHTS: kein Leerzustand, kein Verlauf, auch nicht nach vollem
+ * `page.reload()`. Dieser Test stellt genau das nach und ist die Beweiskette
+ * fuer den Fix: der Block muss sofort da sein UND nach einem Neuladen
+ * WIEDER da sein, ohne einen Reiterwechsel als Umweg zu brauchen.
+ */
+test('F1: eine neue leere Unterhaltung bleibt sichtbar, auch aufgeklappt und nach Neuladen', async ({ page }) => {
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME })
+ await seedOnboardingDone(page)
+ await page.setViewportSize({ width: 1100, height: 900 })
+ await page.goto('/')
+ // Erst auf die hydrierte Oberflaeche warten, sonst sieht `oeffneSeitenleiste`
+ // den "Expand sidebar"-Knopf noch nicht und tut nichts (dieselbe Rennlage,
+ // die openNewChat's Kommentar oben fuer den New-Chat-Knopf beschreibt).
+ await expect(page.getByRole('button', { name: 'New Chat' }).first()).toBeVisible()
+ await oeffneSeitenleiste(page)
+ await openNewChat(page)
+ // Erst abwarten, dass wirklich eine AKTIVE Unterhaltung steht (die
+ // Sitzungsleiste rendert nur dann), sonst faengt die naechste Zeile den
+ // kurzen Zwischenzustand VOR dem Store-Update ab, in dem die alte,
+ // unbetroffene "keine Unterhaltung"-Landing noch im DOM haengt, und
+ // beweist gar nichts. Das war die Falle, die diesen Test beim ersten
+ // Versuch auch gegen den alten, kaputten Stand gruen liess.
+ await expect(page.getByTestId('chat-session-strip')).toBeVisible()
+ // Sofort da, nicht erst nach einem Reiterwechsel.
+ await expect(page.getByTestId('chat-landing')).toBeVisible()
+ await expect(page.getByText('Ask LU anything')).toBeVisible()
+ // Bei aufgeklappter Seitenleiste keine zweite Chat-Liste im Hauptbereich
+ // (die Liste lebt schon in der Seitenleiste, D-S06).
+ await expect(page.getByTestId('home-recent-chats')).toHaveCount(0)
+
+ // Der eigentliche Fund: volles Neuladen derselben, weiterhin leeren
+ // Unterhaltung durfte den Block vorher zum Verschwinden bringen.
+ await page.reload()
+ await expect(page.getByTestId('chat-landing')).toBeVisible()
+ await expect(page.getByText('Ask LU anything')).toBeVisible()
+
+ // NEGATIVKONTROLLE: sobald die erste Nachricht da ist, weicht der Block
+ // dem echten Transkript (kein doppelter Leerzustand ueber einer Antwort).
+ const composer = page.locator('textarea').first()
+ await composer.fill('Hallo')
+ await composer.press('Enter')
+ await expect(page.getByText('Hallo', { exact: false }).first()).toBeVisible()
+ await expect(page.getByTestId('chat-landing')).toHaveCount(0)
})
test('kein Layoutsprung: der Composer bewegt sich nicht, wenn die erste Nachricht ankommt', async ({ page }) => {
diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx
index e3df7a19..0a1c0cf3 100644
--- a/src/components/chat/ChatView.tsx
+++ b/src/components/chat/ChatView.tsx
@@ -175,9 +175,6 @@ export function ChatView() {
const connectedDevices = useRemoteStore((s) => s.connectedDevices)
const refreshDevices = useRemoteStore((s) => s.refreshDevices)
const isRemoteChat = activeConvMode === 'remote'
- // While the panel is collapsed and the open chat is still empty, the recent
- // list belongs above the composer instead of nowhere at all.
- const showRecentsAboveComposer = !sidebarOpen && activeConvIsEmpty
const isThisRemoteActive = isRemoteChat && remoteEnabled && dispatchedConversationId === activeConversationId
const isThisRemoteStopped = isRemoteChat && !isThisRemoteActive
const mobileConnectedCount = connectedDevices.length
@@ -419,7 +416,7 @@ export function ChatView() {
diese Reihenfolge festnagelt.) */}
<PlanBar />
- {!showRecentsAboveComposer && (
+ {!activeConvIsEmpty && (
<MessageList
isGenerating={isGenerating}
isThisChatGenerating={activeGenerating}
@@ -433,11 +430,36 @@ export function ChatView() {
)}
{/* Ein offener, aber noch leerer Chat bekommt an dieser
- Stelle die Liste der letzten Chats statt eines leeren
- Transkripts (David, 2026-09-02: nach „New Chat" stand der
- Hauptbereich blank da). Es ist DERSELBE Flex-Platz, den
- das Transkript sonst nimmt, also bleibt der Composer, wo
- er ist.
+ Stelle DENSELBEN Leerzustand wie die Eingangsseite
+ (Zeichen, Ueberschrift, Modellname), statt eines leeren
+ Transkripts. Es ist DERSELBE Flex-Platz, den das
+ Transkript sonst nimmt, also bleibt der Composer, wo er
+ ist.
+
+ FUND (David, 19.09.2026, N9-Nachtest Windows-Box,
+ box-gruen/n2/BERICHT.md Teil A): die Bedingung war
+ vorher NICHT `activeConvIsEmpty`, sondern
+ `!sidebarOpen && activeConvIsEmpty`
+ (`showRecentsAboveComposer`). Bei aufgeklappter
+ Seitenleiste (dem Normalzustand) rendert dieser
+ Zweig deshalb NIE, `!activeConvIsEmpty` oben aber sehr
+ wohl (activeConversationId ist nach `+ New Chat`
+ sofort gesetzt, `createConversation` in chatStore.ts
+ setzt es synchron). Ergebnis: `<MessageList>` MIT
+ null Nachrichten, die selbst keinen eigenen
+ Leerzustand zeichnet (kein Platzhalter im Baum),
+ ein vollstaendig leerer Hauptbereich, reproduzierbar
+ auch nach vollem Neuladen, bis ein Wechsel auf einen
+ anderen Reiter und zurueck `activeConversationId`
+ ueber `Sidebar.tsx` (Klick auf „Chat") auf `null`
+ zuruecksetzt und damit den ECHTEN Leerzustand weiter
+ oben (`key="home"`) zeigt. Zwei verschiedene Zustaende
+ sahen zufaellig gleich aus, was den Fehler wie ein
+ Flackern wirken liess. Fix: dieselbe Bedingung wie fuer
+ das Transkript, nur umgekehrt, kein `sidebarOpen`
+ mehr davor. Die Liste der letzten Chats bleibt darin
+ NUR bei zugeklappter Seitenleiste (Doppelung sonst,
+ D-S06-Grund unveraendert).
Warum zwei bewachte Bloecke statt eines Ternaers, obwohl
genau eines von beiden rendert: `zwei-baender-sind-eine-
@@ -455,16 +477,30 @@ export function ChatView() {
Blockmitte 35 bis 42 Prozent der sichtbaren Flaeche zu
tief, exakt der Fehler der Eingangsseite, nur an einem
zweiten Ort mit demselben Rezept. */}
- {showRecentsAboveComposer && (
- <div className="flex-1 min-h-0 flex flex-col items-center justify-center overflow-y-auto scrollbar-thin py-4">
+ {activeConvIsEmpty && (
+ <div
+ data-testid="chat-landing"
+ className="flex-1 min-h-0 flex flex-col items-center justify-center text-center gap-2 overflow-y-auto scrollbar-thin py-4 px-3"
+ >
<img
src={MONOGRAM}
alt=""
width={56}
height={56}
- className={`${MONOGRAM_INVERT} opacity-90 mb-5`}
+ className={`${MONOGRAM_INVERT} opacity-90`}
/>
- <RecentChats />
+ <h1 className="t-display text-gray-900 dark:text-gray-100">Ask LU anything</h1>
+ <p className="t-body text-gray-500 max-w-[40ch]">{landing.subline}</p>
+ {landing.note && (
+ <p className="t-mono w-full truncate px-4 text-gray-400 dark:text-gray-500" title={landing.note}>
+ {landing.note}
+ </p>
+ )}
+ {!sidebarOpen && (
+ <div className="w-full pt-3 flex flex-col items-center text-left">
+ <RecentChats />
+ </div>
+ )}
</div>
)}
diff --git a/src/components/chat/__tests__/leer-aktive-unterhaltung.test.ts b/src/components/chat/__tests__/leer-aktive-unterhaltung.test.ts
new file mode 100644
index 00000000..2a841758
--- /dev/null
+++ b/src/components/chat/__tests__/leer-aktive-unterhaltung.test.ts
@@ -0,0 +1,100 @@
+/**
+ * @vitest-environment jsdom
+ *
+ * F1, N9-Nachtest Windows-Box (David, 19.09.2026, box-gruen/n2/BERICHT.md
+ * Teil A): "+ New Chat" legt sofort eine aktive, aber leere Unterhaltung an
+ * (`createConversation` in chatStore.ts setzt `activeConversationId`
+ * synchron). Bei AUFGEKLAPPTER Seitenleiste (dem Normalzustand) griff die
+ * alte Bedingung `showRecentsAboveComposer = !sidebarOpen && activeConvIsEmpty`
+ * nie, und `<MessageList>` mit null Nachrichten zeichnet selbst keinen
+ * Platzhalter. Ergebnis: ein vollstaendig leerer Hauptbereich, reproduzierbar
+ * auch nach vollem Neuladen (auf der Windows-Box zweimal beobachtet), bis ein
+ * Wechsel auf einen anderen Reiter `activeConversationId` ueber
+ * `Sidebar.tsx` (Klick auf "Chat") auf `null` zurueckstellt und dabei den
+ * ECHTEN Leerzustand zeigt.
+ *
+ * Dieser Test haelt fest: eine aktive, leere Unterhaltung zeigt den
+ * Leerzustand-Block ("Ask LU anything") IMMER, unabhaengig vom
+ * Seitenleisten-Zustand, nicht nur wenn `activeConversationId === null`
+ * ist. Die Liste der letzten Chats bleibt darin weiterhin nur bei
+ * zugeklappter Seitenleiste (D-S06, siehe home-recent-chats.test.ts).
+ *
+ * Run: npx vitest run src/components/chat/__tests__/leer-aktive-unterhaltung.test.ts
+ */
+import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
+import { createElement } from 'react'
+import { render, screen, cleanup } from '@testing-library/react'
+import { ChatView } from '../ChatView'
+import { useUIStore } from '../../../stores/uiStore'
+import { useChatStore } from '../../../stores/chatStore'
+import { useCompareStore } from '../../../stores/compareStore'
+import { useModelStore } from '../../../stores/modelStore'
+import type { Conversation } from '../../../types/chat'
+
+vi.mock('../VoiceButton', () => ({ VoiceButton: () => null }))
+
+const NOW = Date.UTC(2026, 8, 19, 12, 0, 0)
+const conv = (id: string, title: string, updatedAt: number): Conversation => ({
+ id, title, messages: [], model: 'test-model', systemPrompt: '', mode: 'lu',
+ createdAt: updatedAt, updatedAt,
+})
+
+beforeEach(() => {
+ useCompareStore.setState({ isComparing: false })
+ useModelStore.setState({ activeModel: 'test-model', models: [{ name: 'test-model' } as never] })
+ useChatStore.setState({
+ conversations: [conv('fresh', 'New Chat', NOW)],
+ activeConversationId: 'fresh',
+ })
+})
+
+afterEach(() => {
+ cleanup()
+})
+
+describe('F1: eine aktive, leere Unterhaltung zeigt nie einen komplett leeren Hauptbereich', () => {
+ it('aufgeklappte Seitenleiste: der Leerzustand-Block steht trotzdem da (vorher: GAR NICHTS)', () => {
+ useUIStore.setState({ sidebarOpen: true })
+ render(createElement(ChatView))
+ expect(screen.getByTestId('chat-landing')).toBeTruthy()
+ expect(screen.getByText('Ask LU anything')).toBeTruthy()
+ })
+
+ it('aufgeklappte Seitenleiste: keine zweite Chat-Liste im Hauptbereich (Doppelung mit der Seitenleiste)', () => {
+ useUIStore.setState({ sidebarOpen: true })
+ render(createElement(ChatView))
+ expect(screen.queryByTestId('home-recent-chats')).toBeNull()
+ })
+
+ it('zugeklappte Seitenleiste: derselbe Block, plus die Liste der letzten Chats darin', () => {
+ useChatStore.setState({
+ conversations: [conv('a', 'Yesterdays thread', NOW - 3600_000), conv('fresh', 'New Chat', NOW)],
+ activeConversationId: 'fresh',
+ })
+ useUIStore.setState({ sidebarOpen: false })
+ render(createElement(ChatView))
+ expect(screen.getByTestId('chat-landing')).toBeTruthy()
+ expect(screen.getByText('Ask LU anything')).toBeTruthy()
+ expect(screen.getByTestId('home-recent-chats').textContent).toContain('Yesterdays thread')
+ })
+
+ it('NEGATIVKONTROLLE: sobald die erste Nachricht da ist, weicht der Block dem Transkript', () => {
+ useUIStore.setState({ sidebarOpen: true })
+ useChatStore.setState({
+ conversations: [{
+ ...conv('fresh', 'New Chat', NOW),
+ messages: [{ id: 'm1', role: 'user', content: 'hi', timestamp: NOW }],
+ }],
+ activeConversationId: 'fresh',
+ })
+ render(createElement(ChatView))
+ expect(screen.queryByTestId('chat-landing')).toBeNull()
+ })
+
+ it('NEGATIVKONTROLLE: keine aktive Unterhaltung bleibt der bekannte Leerzustand (unveraendert)', () => {
+ useUIStore.setState({ sidebarOpen: true })
+ useChatStore.setState({ conversations: [], activeConversationId: null })
+ render(createElement(ChatView))
+ expect(screen.getByTestId('chat-landing')).toBeTruthy()
+ })
+})
diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.ts
index 370d86be..274b9617 100644
--- a/src/lib/release-notes.ts
+++ b/src/lib/release-notes.ts
@@ -263,6 +263,10 @@ export const RELEASE_NOTES: ReleaseNote[] = [
title: 'A draft no longer merges into the next chat after switching.',
detail: 'A draft left in the message box no longer merges into the next thing you type after switching conversations, and the composer no longer gets stuck showing Stop after closing the window, signing out or quitting with a message still in flight.',
},
+ {
+ title: 'A brand new chat no longer shows a blank screen.',
+ detail: 'Right after "+ New Chat", with the side panel open, the main area could stay completely empty: no greeting, no history, nothing, even after a full reload of the same still-empty chat. Only switching to another tab and back brought it around. The greeting now shows for that chat from the first frame, the same as before the first message is sent.',
+ },
],
},
{