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): the pinned plan is a plain list in the chat flow, not a floating card (CA P1)

purpleacfb58ff364f
diff --git a/e2e/ca-shots.spec.ts b/e2e/ca-shots.spec.ts
index df9d4af9..d98fc7ef 100644
--- a/e2e/ca-shots.spec.ts
+++ b/e2e/ca-shots.spec.ts
@@ -159,6 +159,27 @@ const PLAN_RUN: Turn[] = [
{ text: 'I stopped here: `median()` still needs its even-length case.' },
]
+/** A run that ticks off everything it planned. */
+const PLAN_DONE: Turn[] = [
+ {
+ text: 'Here is the plan.',
+ toolCalls: [{ name: 'todo_write', args: { todos: [
+ { content: 'Read src/math.ts', status: 'in_progress' },
+ { content: 'Implement median()', status: 'pending' },
+ { content: 'Run the tests', status: 'pending' },
+ ] } }],
+ },
+ {
+ text: 'All three are through.',
+ toolCalls: [{ name: 'todo_write', args: { todos: [
+ { content: 'Read src/math.ts', status: 'completed' },
+ { content: 'Implement median()', status: 'completed' },
+ { content: 'Run the tests', status: 'completed' },
+ ] } }],
+ },
+ { text: '`median()` is implemented and the tests pass.' },
+]
+
test.describe('CA shots: pinned plan', () => {
test.skip(!OUT, 'set LU_CA_SHOTS to a folder')
for (const theme of ['dark', 'light'] as const) {
@@ -178,7 +199,64 @@ test.describe('CA shots: pinned plan', () => {
await page.evaluate(() => (window as unknown as { __E2E_RELEASE_TOOLS__?: () => void }).__E2E_RELEASE_TOOLS__?.())
await expect(page.getByTestId('plan-run-stopped')).toBeVisible({ timeout: 60_000 })
await shot(page, `plan-${theme}-${width}-2-ended`)
+ // Folded to one line: the count and the step that comes next.
+ const plan = page.getByTestId('plan-pinned')
+ await plan.getByTitle('Collapse the plan').click()
+ await shot(page, `plan-${theme}-${width}-3-folded`)
+ await plan.getByTitle('Show every step').click()
+ // A window too short for the transcript, scrolled back to its start:
+ // the plan stays at the bottom edge and the answer runs under it.
+ await page.setViewportSize({ width, height: 500 })
+ await plan.evaluate((el) => {
+ let box = el.parentElement
+ while (box && !/auto|scroll/.test(getComputedStyle(box).overflowY)) box = box.parentElement
+ box?.scrollTo({ top: 0 })
+ })
+ await shot(page, `plan-${theme}-${width}-4-scrolled`)
})
}
+
+ test(`plan all done ${theme} 1280`, async ({ page }) => {
+ await boot(page, PLAN_DONE, 1280, theme)
+ await page.getByRole('button', { name: 'Code', exact: true }).click()
+ await openNewChat(page)
+ await send(page, 'median() in src/math.ts is missing, implement it and run the tests')
+ await expect(page.getByTestId('plan-all-done')).toBeVisible({ timeout: 60_000 })
+ await shot(page, `plan-${theme}-1280-5-all-done`)
+ })
+
+ // The same list in the LU tab's transcript (Agent mode, MessageList).
+ test(`plan agent ${theme} 1280`, async ({ page }) => {
+ await page.addInitScript(() => {
+ window.localStorage.setItem(
+ 'locally-uncensored-permissions',
+ JSON.stringify({
+ state: {
+ globalPermissions: {
+ filesystem: 'auto', terminal: 'auto', desktop: 'auto', web: 'auto',
+ system: 'auto', image: 'auto', video: 'auto', workflow: 'auto',
+ },
+ conversationOverrides: {}, perToolOverrides: {}, modeScope: 'agent',
+ },
+ version: 2,
+ }),
+ )
+ })
+ // The tidy-up nudge asks twice more before the run ends with the plan open.
+ const last = PLAN_RUN[PLAN_RUN.length - 1]
+ await boot(page, [...PLAN_RUN, last, last, last], 1280, theme, true)
+ await openNewChat(page)
+ const agent = page.getByRole('main').getByRole('button', { name: 'Agent', exact: true })
+ await agent.click()
+ const sandbox = page.getByRole('button', { name: /^Sandbox/ })
+ if (await sandbox.isVisible({ timeout: 5_000 }).catch(() => false)) await sandbox.click()
+ await expect(agent).toHaveAttribute('title', /Agent Mode is on/i, { timeout: 10_000 })
+ await send(page, 'median() in src/math.ts is missing, implement it and run the tests')
+ await expect(page.getByTestId('plan-pinned')).toBeVisible({ timeout: 30_000 })
+ await shot(page, `plan-agent-${theme}-1280-1-running`)
+ await page.evaluate(() => (window as unknown as { __E2E_RELEASE_TOOLS__?: () => void }).__E2E_RELEASE_TOOLS__?.())
+ await expect(page.getByTestId('plan-run-stopped')).toBeVisible({ timeout: 60_000 })
+ await shot(page, `plan-agent-${theme}-1280-2-ended`)
+ })
}
})
diff --git a/src/components/chat/PlanBar.tsx b/src/components/chat/PlanBar.tsx
index 5b0d9e53..c465b6c4 100644
--- a/src/components/chat/PlanBar.tsx
+++ b/src/components/chat/PlanBar.tsx
@@ -20,19 +20,29 @@
// times (last 2026-08-22), and `the-prompt-window-is-the-prompt-window.test.ts`
// keeps it: the plan is part of the transcript, not of the composer.
//
-// One row per step: open (empty circle), running (spinner, bold), done (tick,
-// muted and struck through). Exactly one row runs: a model that marks two
-// steps `in_progress` gets the first one shown as running and the other as
-// open, never as done (a typo must not tick off work). The model replaces the
-// whole list on every `todo_write`, so a changed plan replaces this list whole.
+// How it looks (David, 14.11.2026: "Claude Code is not a glass surface, it is
+// integrated into the chat much more cleanly"): no card, no shadow, no frame.
+// It is a plain list in the flow of the chat, on the left edge of the answer
+// text and in its size, under one hairline. Because it sticks to the
+// bottom of the transcript and text scrolls under it, it carries the
+// transcript's own colour (`lu-chat-scrim`, index.css: the pane, light and
+// dark), so it reads as the page and not as a sheet on top of it.
//
-// Collapsible to one line ("3 of 5 done" and the step that runs). When the run
-// is over, a short closing box sits under the list: the plan is done (and
-// whether changes still wait for approval), or the run ended with steps open,
-// with "Continue" and "Clear plan".
+// One row per step: open (empty circle), running (spinner, full text colour),
+// done (tick, muted; no strike-through, a finished step steps back instead of
+// being crossed out). Exactly one row runs: a model that marks two steps
+// `in_progress` gets the first one shown as running and the other as open,
+// never as done (a typo must not tick off work). The model replaces the whole
+// list on every `todo_write`, so a changed plan replaces this list whole.
+//
+// Collapsible to one line ("3 of 5 done · the step that runs"); the line is
+// the list's own first line, so folding moves nothing sideways. When the run
+// is over, a closing line sits under the list: the plan is done (and whether
+// changes still wait for approval), or the run ended with steps open, with
+// "Continue" and "Clear plan".
import { useState, type ReactNode } from 'react'
-import { AlertCircle, CheckCircle2, Circle, ChevronDown, ChevronRight, Loader2, ListTodo, X } from 'lucide-react'
+import { AlertCircle, Check, CheckCircle2, Circle, ChevronDown, ChevronRight, Loader2, X } from 'lucide-react'
import { useTodoStore, type TodoItem } from '../../stores/todoStore'
import { useCodexStore } from '../../stores/codexStore'
import { useGenerationStore } from '../../stores/generationStore'
@@ -42,6 +52,7 @@ import { isRunQueued } from '../../lib/run-lanes'
import { isRunStopped } from '../../lib/run-stop'
import { isActiveCodexStatus } from '../../types/codex'
import { HINWEIS_TEXT } from '../../lib/hinweis'
+import { ICON_SM } from '../ui/icon-size'
/** What the closing box says once the model ticked off every step. Ticking
* off a step is not the same as the change being on disk. */
@@ -91,6 +102,40 @@ export function planCountLabel(todos: TodoItem[]): string {
return `${done} of ${todos.length} done`
}
+/**
+ * The three greys of the list, written as the full text colour thinned out
+ * and not as `text-gray-N`. The contrast rescue in index.css redraws the plain
+ * grey utilities per theme (a `text-gray-400` is gray-700 in light mode, a
+ * `text-gray-700` is gray-500 in dark mode and beats its `dark:` partner), so
+ * three steps of grey would arrive as one. Worked out against the pane
+ * colour, `quiet` comes to 4.7:1 in light and 4.3:1 in dark, so a finished
+ * step is muted and still readable.
+ */
+const TONE = {
+ strong: 'text-gray-900 dark:text-gray-50',
+ normal: 'text-gray-900/80 dark:text-gray-50/70',
+ quiet: 'text-gray-900/60 dark:text-gray-50/45',
+} as const
+
+/** A row's text colour. The running step stands out by being the darkest
+ * line, not by being bold; a finished one steps back. */
+const ROW_TEXT: Record<PlanRowState, string> = {
+ done: TONE.quiet,
+ running: TONE.strong,
+ open: TONE.normal,
+}
+
+/** Weight and leading of a line. The size is the scale's 12 px step, the size
+ * of the answers above (`t-control` on the list's box); that class also
+ * brings a control's weight and leading, which a line of text sets back. */
+const LINE = 'font-normal leading-normal'
+
+/** The glyph column: 12 px, centred on the first line of its row. */
+const GLYPH = 'shrink-0 mt-[3px]'
+
+/** Chevron, close, open circle and tick: present, never louder than the text. */
+const GLYPH_QUIET = 'text-gray-900/50 dark:text-gray-50/40'
+
interface Props {
conversationId: string | null | undefined
/** Sends a message in this chat; the "Continue" button uses it. */
@@ -127,67 +172,62 @@ export function PlanBar({ conversationId, onContinue }: Props) {
const headline = todos[runningIdx] ?? todos.find((t) => t.status !== 'completed') ?? todos[todos.length - 1]
const nextOpen = todos.find((t) => t.status !== 'completed')
+ const Fold = collapsed ? ChevronRight : ChevronDown
+
return (
- <div className="sticky bottom-0 z-10 px-3 pt-2 pb-1" data-testid="plan-pinned">
- <div className="rounded-lg lu-elevated overflow-hidden">
- <div className="flex items-center gap-1.5 px-2.5 py-1.5">
+ // `pl-12` is where the answer text starts (12 px row padding, the 24 px
+ // avatar column, its 8 px gap and the text's own 4 px), so the glyphs
+ // stand on the text's left edge.
+ <div className="lu-chat-scrim sticky bottom-0 z-10 pl-12 pr-3 pt-1.5" data-testid="plan-pinned">
+ <div className="t-control border-t border-gray-200 dark:border-white/[0.07] pt-2 pb-2">
+ <div className="flex items-center gap-2">
<button
type="button"
onClick={() => setCollapsed((v) => !v)}
aria-expanded={!collapsed}
title={collapsed ? 'Show every step' : 'Collapse the plan'}
- className="flex items-center gap-1.5 min-w-0 flex-1 text-left"
+ className="group flex items-center gap-2 min-w-0 flex-1 text-left"
>
- {collapsed ? (
- <ChevronRight size={12} className="text-gray-400 dark:text-gray-500 shrink-0" />
- ) : (
- <ChevronDown size={12} className="text-gray-400 dark:text-gray-500 shrink-0" />
- )}
- <ListTodo size={12} className="text-gray-500 dark:text-gray-400 shrink-0" />
- <span className="t-micro font-medium text-gray-700 dark:text-gray-200 shrink-0" data-testid="plan-count">
- {planCountLabel(todos)}
- </span>
- {collapsed && (
- <span className="flex-1 min-w-0 truncate t-micro text-gray-600 dark:text-gray-300" title={headline.content}>
- · {headline.content}
+ <Fold size={ICON_SM} className={`shrink-0 ${GLYPH_QUIET} group-hover:text-gray-900 dark:group-hover:text-gray-50 transition-colors`} />
+ <span className={`${LINE} min-w-0 truncate`}>
+ <span className={TONE.quiet} data-testid="plan-count">
+ {planCountLabel(todos)}
</span>
- )}
+ {collapsed && (
+ <span className={runningIdx >= 0 ? TONE.strong : TONE.normal} title={headline.content}>
+ {' '}· {headline.content}
+ </span>
+ )}
+ </span>
</button>
<button
type="button"
onClick={() => clearTodos(conversationId)}
title="Clear the plan"
aria-label="Clear the plan"
- className="flex items-center justify-center w-5 h-5 rounded text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors shrink-0"
+ className={`flex items-center justify-center w-5 h-5 rounded ${GLYPH_QUIET} hover:text-gray-900 dark:hover:text-gray-50 transition-colors shrink-0`}
>
- <X size={11} />
+ <X size={ICON_SM} />
</button>
</div>
{!collapsed && (
// Capped so a fifteen-step plan cannot cover the transcript it pins to.
- <ul className="px-2.5 pb-2 space-y-1 max-h-56 overflow-y-auto scrollbar-thin" data-testid="plan-steps">
+ <ul className="mt-1 space-y-0.5 max-h-56 overflow-y-auto scrollbar-thin" data-testid="plan-steps">
{todos.map((t, i) => {
const state = states[i]
const halted = !runActive && t.status === 'in_progress'
return (
<li key={`${i}-${t.content}`} className="flex items-start gap-2" data-state={state}>
{state === 'done' ? (
- <CheckCircle2 size={13} className="text-gray-400 dark:text-gray-500 shrink-0 mt-[1px]" />
+ <Check size={ICON_SM} className={`${GLYPH} ${GLYPH_QUIET}`} />
) : state === 'running' ? (
- <Loader2 size={13} className="text-gray-700 dark:text-gray-200 animate-spin shrink-0 mt-[1px]" />
+ <Loader2 size={ICON_SM} className={`${GLYPH} ${TONE.strong} animate-spin`} />
) : (
- <Circle size={13} className={`shrink-0 mt-[1px] ${halted ? HINWEIS_TEXT.ruhig : 'text-gray-300 dark:text-gray-600'}`} />
+ <Circle size={ICON_SM} className={`${GLYPH} ${halted ? HINWEIS_TEXT.ruhig : GLYPH_QUIET}`} />
)}
- <span
- className={`t-control leading-snug ${
- state === 'done'
- ? 'text-gray-400 dark:text-gray-500 line-through'
- : state === 'running'
- ? 'text-gray-900 dark:text-gray-50 font-medium'
- : 'text-gray-600 dark:text-gray-300'
- }`}
- >
+ {/* The colour eases over when a step is ticked off; nothing else moves. */}
+ <span className={`${LINE} min-w-0 break-words transition-colors duration-[var(--motion-slow)] ${ROW_TEXT[state]}`}>
{t.content}
</span>
</li>
@@ -198,13 +238,13 @@ export function PlanBar({ conversationId, onContinue }: Props) {
{!runActive && allDone && (
<Abschluss testid="plan-all-done" Symbol={CheckCircle2} ton={pending > 0 ? 'ruhig' : 'gut'}>
- <span className="first-letter:uppercase inline-block">{planDoneLabel(pending)}.</span>
+ {planDoneLabel(pending)}.
</Abschluss>
)}
{stoppedShort && (
<Abschluss testid="plan-run-stopped" Symbol={AlertCircle} ton="ruhig">
- <span className="first-letter:uppercase inline-block">{planStoppedLabel(done, todos.length)}.</span>
+ {planStoppedLabel(done, todos.length)}.
{nextOpen && <span> Next: {nextOpen.content}</span>}
<div className="mt-1.5 flex flex-wrap gap-1.5">
{onContinue && (
@@ -212,7 +252,7 @@ export function PlanBar({ conversationId, onContinue }: Props) {
type="button"
onClick={() => onContinue('continue')}
data-testid="plan-continue"
- className="lu-control lu-primary px-3 t-control font-medium"
+ className="lu-control lu-primary"
>
Continue
</button>
@@ -220,7 +260,7 @@ export function PlanBar({ conversationId, onContinue }: Props) {
<button
type="button"
onClick={() => clearTodos(conversationId)}
- className="lu-control px-3 t-control text-gray-800 dark:text-gray-100 border border-gray-300 dark:border-white/15 hover:bg-gray-100 dark:hover:bg-white/[0.06] transition-colors"
+ className="lu-control lu-control--outline"
>
Clear plan
</button>
@@ -233,9 +273,10 @@ export function PlanBar({ conversationId, onContinue }: Props) {
}
/**
- * The closing box under the list once the run is over, in two tones: `gut`
+ * The closing line under the list once the run is over, in two tones: `gut`
* (the plan is through) and `ruhig`. Neither a run that ends nor a change that
- * waits for approval is an error, so no amber (`lib/hinweis.ts`).
+ * waits for approval is an error, so no amber (`lib/hinweis.ts`). It is a row
+ * like the steps above it, glyph and sentence, with no frame of its own.
*/
function Abschluss({
testid,
@@ -250,9 +291,11 @@ function Abschluss({
}) {
const farbe = ton === 'gut' ? 'text-emerald-600 dark:text-emerald-400' : HINWEIS_TEXT.ruhig
return (
- <div className="border-t border-gray-200 dark:border-white/[0.06] px-2.5 py-2 flex items-start gap-2" data-testid={testid}>
- <Symbol size={13} className={`shrink-0 mt-[1px] ${farbe}`} />
- <div className="t-control leading-snug text-gray-700 dark:text-gray-200 min-w-0">{children}</div>
+ <div className="mt-1.5 flex items-start gap-2" data-testid={testid}>
+ <Symbol size={ICON_SM} className={`${GLYPH} ${farbe}`} />
+ {/* The labels are written mid-sentence (they are tested as such); the
+ capital is drawn here, on the first letter of the line. */}
+ <div className={`${LINE} min-w-0 break-words text-gray-800 dark:text-gray-200 first-letter:uppercase`}>{children}</div>
</div>
)
}
diff --git a/src/components/chat/__tests__/plan-pinned-under-the-newest-message.test.tsx b/src/components/chat/__tests__/plan-pinned-under-the-newest-message.test.tsx
index b87b025e..a3c07998 100644
--- a/src/components/chat/__tests__/plan-pinned-under-the-newest-message.test.tsx
+++ b/src/components/chat/__tests__/plan-pinned-under-the-newest-message.test.tsx
@@ -6,6 +6,11 @@
* folds to one line, and once the run is over a closing box says how it ended.
* Same component for local and cloud models: it reads only the plan the model
* wrote through todo_write.
+ *
+ * David, 14.11.2026, on the first version, a floating card: "Looks nothing
+ * like Claude Code. Claude Code is not a glass surface, it is integrated into
+ * the chat much more cleanly." Since then it is a plain list in the flow of
+ * the chat, and the block "part of the page" below keeps it one.
*/
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { act, cleanup, fireEvent, render } from '@testing-library/react'
@@ -74,6 +79,35 @@ describe('PlanBar, pinned in the transcript', () => {
expect(v.queryByTestId('plan-run-stopped')).toBeNull()
})
+ it('is part of the page, not a sheet on top of it', () => {
+ running(true)
+ writeTodos(CONV, PLAN)
+ const v = render(<PlanBar conversationId={CONV} />)
+ const box = v.getByTestId('plan-pinned')
+ // No card: nothing in it floats, casts a shadow, blurs or rings the list.
+ const classes = [box, ...box.querySelectorAll('*')].map((el) => el.getAttribute('class') ?? '').join(' ')
+ expect(classes).not.toMatch(/(?<![\w-])(?:lu-elevated|shadow(?:-\w+)?|backdrop-blur(?:-\w+)?|ring-\w+)(?![\w-])/)
+ // Text scrolls under a sticky list, so it needs a ground: the transcript's
+ // own colour (index.css), which is why it reads as the page.
+ expect(box.className).toMatch(/(?<![\w-])lu-chat-scrim(?![\w-])/)
+ // On the left edge of the answer text: 12 px row padding, the 24 px avatar
+ // column, its 8 px gap and the text's own 4 px.
+ expect(box.className).toMatch(/(?<![\w-])pl-12(?![\w-])/)
+ })
+
+ it('a finished step steps back, it is not crossed out', () => {
+ running(true)
+ writeTodos(CONV, PLAN)
+ const v = render(<PlanBar conversationId={CONV} />)
+ const [done, runs] = [...v.getByTestId('plan-steps').querySelectorAll('li')]
+ expect(done.innerHTML).not.toMatch(/line-through/)
+ // Three tones and no bold: the running step is the full text colour, the
+ // finished one a thinned-out one.
+ expect(done.querySelector('span')?.className).toMatch(/text-gray-900\/60/)
+ expect(runs.querySelector('span')?.className).toMatch(/(?<![\w-])text-gray-900(?![\w/-])/)
+ expect(runs.innerHTML).not.toMatch(/font-(?:medium|semibold|bold)/)
+ })
+
it('updates live and replaces the whole list when the plan changes', () => {
running(true)
writeTodos(CONV, PLAN)