浏览代码

feat(tui): startup banner iterations — slogans, sweep reveal, then no banner

Squashes three linearized steps (feat/tui-startup, feat/banner-reveal,
feat/remove-banner): the banner experiment converged on removing the
startup banner entirely; later commits restore it borderless and add the
brand gradient.
Turtle 2 月之前
父节点
当前提交
45868b940f
共有 31 个文件被更改,包括 1081 次插入 和 1011 次删除
  1. 6 0
      .agents/notes/implemented/feature/2026-07-20-tui-startup-slogans.i18n.yaml
  2. 39 0
      .agents/notes/implemented/feature/2026-07-20-tui-startup-slogans.md
  3. 39 0
      .agents/notes/implemented/feature/2026-07-20-tui-startup-slogans.zh.md
  4. 6 0
      .agents/notes/implemented/feature/2026-07-21-tui-banner-sweep.i18n.yaml
  5. 35 0
      .agents/notes/implemented/feature/2026-07-21-tui-banner-sweep.md
  6. 35 0
      .agents/notes/implemented/feature/2026-07-21-tui-banner-sweep.zh.md
  7. 6 0
      .agents/notes/implemented/feature/2026-07-21-tui-no-banner.i18n.yaml
  8. 37 0
      .agents/notes/implemented/feature/2026-07-21-tui-no-banner.md
  9. 37 0
      .agents/notes/implemented/feature/2026-07-21-tui-no-banner.zh.md
  10. 37 47
      examples/tui-agent/tests/snapshots/bash-terminal-card/terminal.expected.txt
  11. 39 49
      examples/tui-agent/tests/snapshots/code-mode/terminal.expected.txt
  12. 57 67
      examples/tui-agent/tests/snapshots/cordis-dynamic-toolchain/terminal.expected.txt
  13. 54 64
      examples/tui-agent/tests/snapshots/dynamic-workflow/terminal.expected.txt
  14. 39 49
      examples/tui-agent/tests/snapshots/multi-turn-conversation/terminal.expected.txt
  15. 46 56
      examples/tui-agent/tests/snapshots/parallel-file-reads/terminal.expected.txt
  16. 43 52
      examples/tui-agent/tests/snapshots/todo-plan/terminal.expected.txt
  17. 3 1
      packages/ui/tui/tests/harness.ts
  18. 52 62
      packages/ui/tui/tests/snapshots/advanced-cards-collapsed.expected.txt
  19. 57 67
      packages/ui/tui/tests/snapshots/advanced-cards-expanded.expected.txt
  20. 25 35
      packages/ui/tui/tests/snapshots/code-mode-pending.expected.txt
  21. 29 39
      packages/ui/tui/tests/snapshots/conversation-streaming.expected.txt
  22. 27 37
      packages/ui/tui/tests/snapshots/cordis-tools-pending.expected.txt
  23. 30 53
      packages/ui/tui/tests/snapshots/disposed-terminal.expected.txt
  24. 27 38
      packages/ui/tui/tests/snapshots/dynamic-workflow-pending.expected.txt
  25. 30 53
      packages/ui/tui/tests/snapshots/errors-and-help.expected.txt
  26. 57 43
      packages/ui/tui/tests/snapshots/question-dialog-validation.expected.txt
  27. 51 40
      packages/ui/tui/tests/snapshots/question-dialog.expected.txt
  28. 19 29
      packages/ui/tui/tests/snapshots/surface-after-compaction-narrow.expected.txt
  29. 18 28
      packages/ui/tui/tests/snapshots/surface-after-compaction-wide.expected.txt
  30. 32 42
      packages/ui/tui/tests/snapshots/surface-before-compaction.expected.txt
  31. 69 60
      packages/ui/tui/tests/snapshots/untrusted-controls.expected.txt

+ 6 - 0
.agents/notes/implemented/feature/2026-07-20-tui-startup-slogans.i18n.yaml

@@ -0,0 +1,6 @@
+# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
+# side as of the last confirmed-consistent state. Both languages carry equal authority;
+# after editing either side, bring the other along and re-record with:
+#   pnpm run verify-translation-pairing --write
+2026-07-20-tui-startup-slogans.md: a2a22baafddd08145cec0d03b65ee56b2f8114b1
+2026-07-20-tui-startup-slogans.zh.md: 58fa5790f315845f27b810d62658bd79428b519b

+ 39 - 0
.agents/notes/implemented/feature/2026-07-20-tui-startup-slogans.md

@@ -0,0 +1,39 @@
+# Agent Note: Startup slogans replace the configured TUI welcome line
+
+Status: implemented
+
+English | [中文](2026-07-20-tui-startup-slogans.zh.md)
+
+> **Superseded** for the slogan/animation half by the [banner sweep Agent Note](2026-07-21-tui-banner-sweep.md): the slogan bank and typewriter reveal shipped, read as weird in use, and were replaced by a subtitle-free banner with a whole-banner sweep. The removal of the configured demo welcome and the animation-lifecycle groundwork (start after `ui.start()`, clear through `detachListeners`) stand.
+
+## Problem
+
+The TUI header subtitle came from a `welcome` config the demo leaf set to "TUI agent ready. Give it a coding task." — instructional filler that told a returning user nothing, restated what the product is on every boot, and had a hardcoded twin (`'ready.'`) as the schema default in two packages. The product wanted a startup moment with some character instead of a static banner caption.
+
+## Decision
+
+- `examples/tui-agent/cordis.yml` no longer configures `welcome`; the config key stays for deployments and fixtures that need a fixed, deterministic subtitle (the Code Mode overlay and every snapshot/scripted fixture keep theirs).
+- When `welcome` is unset, `dsh-tui` picks one member of an exported `STARTUP_SLOGANS` bank per boot (`pickStartupSlogan`, injectable random source) and reveals it with a typewriter animation: one character per 40 ms frame, a `▌` block cursor trailing until complete. The reveal starts only after `ui.start()` succeeds and its interval is cleared on dispose alongside the other listeners.
+- The slogan bank is presentation copy, deliberately not config: deployments that want controlled wording already have `welcome`. Slogans are ASCII-only by contract because the reveal slices per character.
+- `dsh-tui-demo` forwards `welcome` only when configured instead of defaulting it, so the app no longer decides the TUI's idle subtitle.
+- The keyless PTY boot scenario now waits for the reveal cursor (`▌` — the only source of that glyph in an empty transcript) instead of the removed welcome text.
+
+The same change restores `packages/ui/tui/src/index.ts` to 100 % per-file coverage, which the color-scheme merge had broken on the integration branch: the editor border-color reassignment inside `applyColorScheme` was dead (the `setStatus` call right after re-derives it) and is removed, and the color-scheme query's `.then`/`.catch` arrows became named, tested handlers (`applyReportedScheme`, `ignoreSchemeQueryFailure` — the latter pinned by a test whose terminal throws on the DSR query write).
+
+## Alternatives considered
+
+**A fixed cooler slogan.** Rejected: one string re-read on every boot decays into wallpaper exactly like the line it replaces; a small rotating bank keeps the moment alive at no complexity cost.
+
+**Making the bank and reveal speed configurable.** Rejected: that is two new knobs for presentation copy; `welcome` is already the escape hatch for deployments with an opinion, and the no-hardcoded-tunables rule targets deployment-varying behavior, not brand copy.
+
+**Animating in `HeaderComponent` itself.** Rejected: the component would need a TUI handle and its own lifecycle; the chat already owns a render loop, timers, and a disposal path, so the reveal lives beside the other `createTuiChat` effects and `detachListeners` clears it.
+
+## Consequences
+
+- Boot output is no longer byte-deterministic when `welcome` is unset (random slogan, timed frames). Every recorded or snapshot surface pins `welcome` explicitly, so no snapshot changed; the PTY smoke anchors on the reveal cursor and the session-id line instead.
+- The `welcome` schema default disappeared from both `dsh-tui` and `dsh-tui-demo`; a direct caller passing no welcome now gets a slogan, not `'ready.'`.
+- Adding a slogan is a one-line bank edit; tests assert membership, not specific text.
+
+## Testing
+
+`packages/ui/tui/tests/tui.spec.ts` pins deterministic bank selection with an injected random source, the reveal (a bank member fully rendered, cursor frames observed), the configured-welcome path rendering verbatim with no cursor, and dispose stopping a mid-reveal animation. `examples/tui-agent/tests/tui-keyless-smoke.e2e.ts` boots the real tree in a PTY and waits on the reveal cursor. Verified live in tmux (mid-reveal frame `no map below▌` then the full slogan).

+ 39 - 0
.agents/notes/implemented/feature/2026-07-20-tui-startup-slogans.zh.md

@@ -0,0 +1,39 @@
+# Agent Note: 启动 slogan 取代配置化的 TUI 欢迎语
+
+Status: implemented
+
+[English](2026-07-20-tui-startup-slogans.md) | 中文
+
+> **已被取代**:slogan/动画的那一半由[横幅扫入 Agent Note](2026-07-21-tui-banner-sweep.md)取代:slogan 库和打字机动画上线后实际使用中显得怪异,已替换为无副标题的横幅加整体扫入。移除示例配置中欢迎语的决定与动画生命周期基础设施(`ui.start()` 后启动、经 `detachListeners` 清除)保持不变。
+
+## Problem
+
+TUI 头部副标题来自一个 `welcome` 配置,示例叶子配置把它设为 "TUI agent ready. Give it a coding task."——一句说明书式的填充语,对老用户毫无信息量,每次启动都在复述产品是什么,而且它还有一个硬编码的孪生兄弟(`'ready.'`)作为两个包里的 schema 默认值。产品需要的是一个有性格的启动时刻,而不是一条静态横幅说明。
+
+## Decision
+
+- `examples/tui-agent/cordis.yml` 不再配置 `welcome`;该配置键保留给需要固定、确定性副标题的部署与 fixture(Code Mode overlay 和所有快照/脚本化 fixture 都保留各自的欢迎语)。
+- `welcome` 未设置时,`dsh-tui` 每次启动从导出的 `STARTUP_SLOGANS` 库里挑选一条(`pickStartupSlogan`,随机源可注入),并以打字机动画逐字显示:每帧 40 ms 一个字符,完成前尾随一个 `▌` 块状光标。动画只在 `ui.start()` 成功后启动,其定时器与其他监听器一起在 dispose 时清除。
+- slogan 库是展示文案,刻意不做成配置:想控制措辞的部署已经有 `welcome` 这个出口。按契约 slogan 只含 ASCII,因为逐字显示按字符切片。
+- `dsh-tui-demo` 只在配置了 `welcome` 时才转发它,不再填默认值,应用不再替 TUI 决定空闲副标题。
+- 无 key 的 PTY 启动场景改为等待逐字显示的光标(`▌`——空 transcript 里该字形的唯一来源),不再等待已删除的欢迎文本。
+
+同一变更把 `packages/ui/tui/src/index.ts` 恢复到 100% 的单文件覆盖率(颜色方案合并曾在集成分支上破坏它):`applyColorScheme` 里对编辑器边框颜色的重新赋值是死代码(紧随其后的 `setStatus` 调用会重新推导它),已删除;颜色方案查询的 `.then`/`.catch` 箭头函数改为具名、有测试的处理器(`applyReportedScheme`、`ignoreSchemeQueryFailure`——后者由一个让终端在 DSR 查询写入时抛错的测试固定)。
+
+## Alternatives considered
+
+**换一条更酷的固定 slogan。** 否决:一条每次启动都重读的字符串会和它取代的那行一样退化成墙纸;一个小的轮换库以零复杂度代价让这个时刻保持新鲜。
+
+**把 slogan 库和显示速度做成配置。** 否决:那是为展示文案新增两个旋钮;对措辞有主张的部署已经有 `welcome` 这个出口,而「插件里不许硬编码可调参数」规则针对的是随部署变化的行为,不是品牌文案。
+
+**在 `HeaderComponent` 内部做动画。** 否决:组件将需要持有 TUI 句柄和自己的生命周期;聊天层已经拥有渲染循环、定时器和释放路径,所以逐字显示与 `createTuiChat` 的其他资源放在一起,由 `detachListeners` 清除。
+
+## Consequences
+
+- `welcome` 未设置时启动输出不再字节级确定(随机 slogan、定时帧)。所有录制或快照表面都显式固定 `welcome`,因此没有快照变化;PTY 冒烟测试改为锚定逐字显示光标和会话 id 行。
+- `welcome` 的 schema 默认值从 `dsh-tui` 和 `dsh-tui-demo` 中消失;不传 welcome 的直接调用方现在得到的是 slogan,而不是 `'ready.'`。
+- 新增一条 slogan 只需在库里加一行;测试断言成员归属,不断言具体文本。
+
+## Testing
+
+`packages/ui/tui/tests/tui.spec.ts` 固定以下行为:注入随机源后的确定性选取、逐字显示(库中某条完整渲染、观察到光标帧)、配置了 welcome 时逐字动画不启动且原文渲染、以及 dispose 停止进行中的动画。`examples/tui-agent/tests/tui-keyless-smoke.e2e.ts` 在 PTY 里启动真实配置树并等待显示光标。已在 tmux 中实机验证(中途帧 `no map below▌`,随后是完整 slogan)。

+ 6 - 0
.agents/notes/implemented/feature/2026-07-21-tui-banner-sweep.i18n.yaml

@@ -0,0 +1,6 @@
+# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
+# side as of the last confirmed-consistent state. Both languages carry equal authority;
+# after editing either side, bring the other along and re-record with:
+#   pnpm run verify-translation-pairing --write
+2026-07-21-tui-banner-sweep.md: c146424d53e75a72b63e346f87a5bbd206d67350
+2026-07-21-tui-banner-sweep.zh.md: 01cc153e88f067b7b8d2eb6317648f3892fe8a5a

+ 35 - 0
.agents/notes/implemented/feature/2026-07-21-tui-banner-sweep.md

@@ -0,0 +1,35 @@
+# Agent Note: The banner sweeps in; the subtitle line is gone
+
+Status: implemented
+
+English | [中文](2026-07-21-tui-banner-sweep.zh.md)
+
+> **Superseded** by the [no-banner Agent Note](2026-07-21-tui-no-banner.md): the banner itself was removed, taking the sweep with it.
+
+## Problem
+
+The [startup-slogans Agent Note](2026-07-20-tui-startup-slogans.md) replaced the instructional welcome line with a random slogan bank revealed by a per-character typewriter. In use the quotes read as weird — random flavor text in a tool's header — and the animation was slow (40 ms/char over a full sentence) while animating only one line of a four-line banner. This note supersedes that decision's slogan half; the removal of the configured demo welcome and the animation-lifecycle groundwork stand.
+
+## Decision
+
+- The slogan bank, `pickStartupSlogan`, and the typewriter reveal are deleted. When `welcome` is unset the banner simply has **no subtitle line** — title and model/session detail only. The `welcome` config remains for deployments and fixtures that want a fixed subtitle, rendered frame-deterministically with no animation.
+- The startup animation is now the **whole banner**: `HeaderComponent` gains a `revealWidth` clip, and the header box wipes in left-to-right over ~24 frames at 15 ms (~360 ms total, ~60 fps), started after `ui.start()` succeeds and cleared through the same `detachListeners` path the typewriter used. `stopBannerReveal` also resets the clip so a disposed-mid-sweep header re-renders whole.
+- The PTY smoke's boot marker changes from the typewriter cursor (`▌`) to the banner's top-right corner (`╮`), which only renders once the sweep completes.
+
+## Alternatives considered
+
+**Keep the animation as-is and only change the copy.** Rejected: any fixed or rotating phrase re-read on every boot decays into wallpaper; the user's judgment was that the quotes themselves, not just their content, were wrong for the surface.
+
+**Animate per banner line (top-down) instead of a left-right sweep.** Rejected: with only four lines the animation would have four visible steps — closer to a flicker than a reveal; the horizontal sweep uses the full terminal width for a smooth motion at the same total duration.
+
+**Character-level clipping via `revealWidth` on styled text.** Adopted with `truncateToWidth` from pi-tui, the same ANSI-aware clipper the header already uses for width overflow, so the sweep cannot tear escape sequences.
+
+## Consequences
+
+- Boot output with `welcome` unset is again animation-dependent but no longer random: every boot sweeps the same banner. Configured welcomes (all snapshot/scripted fixtures, the Code Mode overlay) stay frame-deterministic and unchanged.
+- The `STARTUP_SLOGANS`/`pickStartupSlogan` exports are gone; no consumer outside the deleted tests referenced them.
+- The default banner is one line shorter (no subtitle), so PTY assertions anchored on banner geometry use the corner glyph rather than any subtitle text.
+
+## Testing
+
+`packages/ui/tui/tests/tui.spec.ts` pins: the sweep completes to a full banner (both corners + title) and produced at least one clipped mid-sweep frame; a configured welcome renders verbatim with no clipped frames; the unset-welcome banner has no subtitle; and dispose clears the sweep's own interval handle. The PTY smoke boots on the `╮` completion marker across the tui-demo bin, the dsh CLI, and the personal-overlay scenarios. Verified live in tmux.

+ 35 - 0
.agents/notes/implemented/feature/2026-07-21-tui-banner-sweep.zh.md

@@ -0,0 +1,35 @@
+# Agent Note: 横幅整体扫入;副标题行移除
+
+Status: implemented
+
+[English](2026-07-21-tui-banner-sweep.md) | 中文
+
+> **已被取代**:由[移除启动横幅 Agent Note](2026-07-21-tui-no-banner.md)取代:横幅本身已移除,扫入动画随之移除。
+
+## Problem
+
+[启动 slogan Agent Note](2026-07-20-tui-startup-slogans.md) 用随机 slogan 库加逐字打字机动画取代了说明书式的欢迎行。实际使用中这些引语显得怪异——工具头部出现随机的风味文案——而且动画很慢(每字符 40 ms,扫完一整句),却只动画四行横幅中的一行。本 note 取代该决定中 slogan 的那一半;移除示例配置中欢迎语的决定与动画生命周期的基础设施保持不变。
+
+## Decision
+
+- 删除 slogan 库、`pickStartupSlogan` 和打字机动画。`welcome` 未设置时横幅直接**没有副标题行**——只有标题和模型/会话详情。`welcome` 配置保留给想要固定副标题的部署与 fixture,无动画、逐帧确定地渲染。
+- 启动动画现在作用于**整个横幅**:`HeaderComponent` 增加 `revealWidth` 裁剪,头部盒子以约 24 帧、每帧 15 ms(总计约 360 ms、约 60 fps)从左到右扫入,在 `ui.start()` 成功后启动,经打字机动画用过的同一条 `detachListeners` 路径清除。`stopBannerReveal` 同时重置裁剪,因此扫入中途被 dispose 的头部会重新完整渲染。
+- PTY 冒烟测试的启动标记从打字机光标(`▌`)改为横幅右上角(`╮`),它只在扫入完成后才渲染。
+
+## Alternatives considered
+
+**保留动画原样、只改文案。** 否决:任何每次启动都被重读的固定或轮换语句都会退化成墙纸;用户的判断是引语本身——而不只是内容——对这个表面来说就是错的。
+
+**按横幅行逐行(自上而下)动画而非左右扫入。** 否决:只有四行时动画只有四个可见步骤——更像闪烁而不是展开;水平扫入用满终端宽度,在相同总时长内动作更平滑。
+
+**用 `revealWidth` 对带样式文本做字符级裁剪。** 采用 pi-tui 的 `truncateToWidth`——头部处理宽度溢出时已在使用的同一个 ANSI 感知裁剪器——因此扫入不可能撕裂转义序列。
+
+## Consequences
+
+- `welcome` 未设置时启动输出再次依赖动画但不再随机:每次启动扫入同一幅横幅。配置了欢迎语的场景(全部快照/脚本化 fixture、Code Mode overlay)保持逐帧确定且不变。
+- `STARTUP_SLOGANS`/`pickStartupSlogan` 导出移除;除被删除的测试外没有消费者引用它们。
+- 默认横幅少一行(无副标题),因此锚定横幅几何的 PTY 断言使用角落字形而非任何副标题文本。
+
+## Testing
+
+`packages/ui/tui/tests/tui.spec.ts` 固定:扫入完成为完整横幅(两个角 + 标题)且产生了至少一个裁剪的中途帧;配置的欢迎语原文渲染且无裁剪帧;未设置欢迎语的横幅没有副标题;dispose 清除扫入自己的定时器句柄。PTY 冒烟测试在 tui-demo bin、dsh CLI 和个人 overlay 场景中以 `╮` 完成标记启动。已在 tmux 中实机验证。

+ 6 - 0
.agents/notes/implemented/feature/2026-07-21-tui-no-banner.i18n.yaml

@@ -0,0 +1,6 @@
+# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
+# side as of the last confirmed-consistent state. Both languages carry equal authority;
+# after editing either side, bring the other along and re-record with:
+#   pnpm run verify-translation-pairing --write
+2026-07-21-tui-no-banner.md: 284d02df4b1fe3445a76b030aa873164081aa571
+2026-07-21-tui-no-banner.zh.md: 83bf7ffa27ca1abef0e71a1847b5aa1bd54bbe87

+ 37 - 0
.agents/notes/implemented/feature/2026-07-21-tui-no-banner.md

@@ -0,0 +1,37 @@
+# Agent Note: No startup banner
+
+Status: implemented
+
+English | [中文](2026-07-21-tui-no-banner.zh.md)
+
+## Problem
+
+The TUI opened with a boxed product banner ("DEEPSEEK HARNESS" + model/session detail), most recently with a sweep-in animation ([banner sweep Agent Note](2026-07-21-tui-banner-sweep.md)). The user's verdict: remove it. A product title re-read on every boot is chrome, the box spends four rows before any content, and the identifying facts it carried (model, session) have better homes.
+
+## Decision
+
+- `HeaderComponent`, the sweep animation, and its lifecycle wiring are deleted. The TUI mounts straight into the transcript; startup renders nothing above the separator.
+- The model name moves into the footer status line's left segment (`<model>  <cwd>  ↑tokens ↓tokens`), so the session's driving model stays visible at all times, not just at boot. The session id is no longer displayed — it lives in the session log and `./.sessions` filenames, and `RESUME_SESSION_ID` consumers retrieve it there.
+- `welcome`, when configured, renders as the transcript's first line (a muted notice) inside `rebuildTranscript`, so palette swaps preserve it. Unset renders nothing. Fixtures keep their configured welcomes; the PTY smoke's boot marker becomes the footer's model name, the only mounted-TUI text guaranteed to render regardless of cwd length.
+
+This supersedes the [banner sweep Agent Note](2026-07-21-tui-banner-sweep.md) entirely: both the sweep and the banner it animated are gone.
+
+## Alternatives considered
+
+**Keep a one-line header (no box).** Rejected: the only load-bearing fact was the model name, and the footer already aggregates session status; a dedicated header row for one fact is the same chrome, smaller.
+
+**Show the session id in the footer too.** Rejected: a 36-char UUID dominates the 100-column footer and clips the status segment; it identifies the session for resume, which is a log/filesystem concern, not a glanceable one.
+
+**Print the welcome outside the transcript (above the separator).** Rejected: any fixed region above the transcript is a banner again; as a transcript line it scrolls away naturally and survives rebuilds through the same path as every other transcript element.
+
+## Consequences
+
+- Startup output is fully deterministic again — no animation frames at all; the interval-lifecycle machinery from the two animation iterations is gone.
+- All 26 pi-tui terminal snapshots re-recorded (`test:snapshot:refresh`): banner rows gone, footer rows gain the model prefix.
+- Anything that anchored on banner text (`DEEPSEEK`, box corners) re-anchors on the footer model name; `main-session-` no longer appears in boot output.
+- `/clear` now wipes the welcome line too: it is an ordinary transcript line, and `/clear` empties the transcript (the old banner survived `/clear` only by sitting outside it).
+- The footer's left segment is wider; on narrow terminals the right status segment clips earlier.
+
+## Testing
+
+`packages/ui/tui/tests/tui.spec.ts` pins: no box corners/product title and an empty transcript when `welcome` is unset, with the model in the footer; a configured welcome as the first transcript line without a banner; and the welcome surviving a palette-swap transcript rebuild. The PTY smoke boots on the footer model name and asserts `DEEPSEEK HARNESS` is absent. Snapshots verify the full frames.

+ 37 - 0
.agents/notes/implemented/feature/2026-07-21-tui-no-banner.zh.md

@@ -0,0 +1,37 @@
+# Agent Note: 移除启动横幅
+
+Status: implemented
+
+[English](2026-07-21-tui-no-banner.md) | 中文
+
+## Problem
+
+TUI 启动时展示一个带框的产品横幅("DEEPSEEK HARNESS" + 模型/会话详情),最近一版还带扫入动画([横幅扫入 Agent Note](2026-07-21-tui-banner-sweep.md))。用户的裁决:删掉它。每次启动都被重读的产品标题是装饰,盒子在任何内容之前先占掉四行,而它承载的识别信息(模型、会话)有更好的去处。
+
+## Decision
+
+- 删除 `HeaderComponent`、扫入动画及其生命周期接线。TUI 直接挂载进 transcript;启动时分隔线之上不渲染任何东西。
+- 模型名移入页脚状态行的左段(`<model>  <cwd>  ↑tokens ↓tokens`),会话使用的模型因此始终可见,而不只是启动时。会话 id 不再显示——它存在于会话日志和 `./.sessions` 文件名中,`RESUME_SESSION_ID` 的使用者从那里获取。
+- 配置了 `welcome` 时,它作为 transcript 的第一行(一条弱化的通知)在 `rebuildTranscript` 内渲染,因此调色板切换会保留它。未设置则什么也不渲染。fixture 保留各自配置的欢迎语;PTY 冒烟测试的启动标记改为页脚的模型名——无论 cwd 多长都保证渲染的唯一挂载后文本。
+
+本 note 完全取代[横幅扫入 Agent Note](2026-07-21-tui-banner-sweep.md):扫入动画和它所动画的横幅都已移除。
+
+## Alternatives considered
+
+**保留单行头部(去掉盒子)。** 否决:唯一有承载价值的信息是模型名,而页脚已经聚合会话状态;为一条信息保留专用头部行仍是同一种装饰,只是小一点。
+
+**把会话 id 也放进页脚。** 否决:36 字符的 UUID 会占满 100 列页脚并裁掉状态段;它的用途是恢复会话的标识,属于日志/文件系统关注点,不是需要一瞥可见的信息。
+
+**把欢迎语渲染在 transcript 之外(分隔线上方)。** 否决:transcript 上方任何固定区域都会再次变成横幅;作为 transcript 行它自然滚走,并通过与其他 transcript 元素相同的路径在重建后保留。
+
+## Consequences
+
+- 启动输出再次完全确定——没有任何动画帧;两轮动画迭代留下的定时器生命周期机制全部移除。
+- 全部 26 个 pi-tui 终端快照重新录制(`test:snapshot:refresh`):横幅行消失,页脚行增加模型前缀。
+- 锚定横幅文本(`DEEPSEEK`、盒子角)的内容改为锚定页脚模型名;启动输出中不再出现 `main-session-`。
+- `/clear` 现在也会清掉欢迎行:它是普通的 transcript 行,而 `/clear` 清空 transcript(旧横幅能在 `/clear` 后存活只因为它在 transcript 之外)。
+- 页脚左段变宽;窄终端上右侧状态段更早被裁剪。
+
+## Testing
+
+`packages/ui/tui/tests/tui.spec.ts` 固定:`welcome` 未设置时无盒子角/产品标题、transcript 为空、模型在页脚;配置的欢迎语作为 transcript 第一行且无横幅;欢迎语在调色板切换的 transcript 重建后保留。PTY 冒烟测试以页脚模型名为启动标记并断言 `DEEPSEEK HARNESS` 不出现。快照验证完整帧。

+ 37 - 47
examples/tui-agent/tests/snapshots/bash-terminal-card/terminal.expected.txt

@@ -1,73 +1,63 @@
 terminal 100x36 buffer=normal length=36 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
-title "Use the bash tool to — DSH TUI snapshot"
-cursor hidden column=1 viewportRow=27 bufferRow=27
+title "DSH TUI snapshot"
+cursor hidden column=1 viewportRow=25 bufferRow=25
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Recorded replay: bash-terminal-card"
+  style 1-35 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Use the bash tool to                                                                             │"
-  style 0-0 fg=bright-blue
-  style 2-21 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Use the bash tool to run exactly: echo TERMINAL_OK. Then reply with the single word DONE and stop."
+6| "▌ Use the bash tool to run exactly: echo TERMINAL_OK. Then reply with the single word DONE and stop."
   style 0-0 fg=bright-blue
-9| "▌ "
+7| "▌ "
   style 0-0 fg=bright-blue
-10| <blank>
-11| " Reasoning                                                                                          "
+8| <blank>
+9| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-12| " The user wants me to run a simple bash command and then reply with \"DONE\".                         "
+10| " The user wants me to run a simple bash command and then reply with \"DONE\".                         "
   style 1-74 fg=bright-black italic
-13| <blank>
-14| "▌ "
+11| <blank>
+12| "▌ "
   style 0-0 fg=green
-15| "▌ ✓ echo TERMINAL_OK                                                                                "
+13| "▌ ✓ echo TERMINAL_OK                                                                                "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-19 bold
-16| "▌ Echo TERMINAL_OK to verify terminal access                                                        "
+14| "▌ Echo TERMINAL_OK to verify terminal access                                                        "
   style 0-0 fg=green
   style 2-43 fg=bright-black
-17| "▌ TERMINAL_OK                                                                                       "
+15| "▌ TERMINAL_OK                                                                                       "
   style 0-0 fg=green
-18| "▌ [exit 0]                                                                                          "
+16| "▌ [exit 0]                                                                                          "
   style 0-0 fg=green
   style 2-9 dim
-19| "▌ "
+17| "▌ "
   style 0-0 fg=green
-20| <blank>
-21| " Reasoning                                                                                          "
+18| <blank>
+19| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-22| " The command ran successfully and output \"TERMINAL_OK\". I should now reply with just \"DONE\".        "
+20| " The command ran successfully and output \"TERMINAL_OK\". I should now reply with just \"DONE\".        "
   style 1-91 fg=bright-black italic
-23| <blank>
-24| " Assistant                                                                                          "
+21| <blank>
+22| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-25| " DONE                                                                                               "
-26| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+23| " DONE                                                                                               "
+24| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-27| "                                                                                                    "
+25| "                                                                                                    "
   style 1-1 inverse
-28| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+26| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-29| "/tmp/dsh-tui-snapshot-bash-te  ↑3.0k ↓115 3% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-28 dim
-  style 42-99 dim
-30-35| <blank>
+27| "deepseek-v4-flash  /workspace/project  ↑3.0k ↓115  cache 48%  tools:col"
+  style 0-88 dim
+  style 91-99 dim
+28-35| <blank>

+ 39 - 49
examples/tui-agent/tests/snapshots/code-mode/terminal.expected.txt

@@ -1,79 +1,69 @@
 terminal 100x36 buffer=normal length=36 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
-title "Using ONE run_code program: call — DSH TUI snapshot"
-cursor hidden column=1 viewportRow=29 bufferRow=29
+title "DSH TUI snapshot"
+cursor hidden column=1 viewportRow=27 bufferRow=27
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Recorded replay: code-mode"
+  style 1-26 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Using ONE run_code program: call                                                                 │"
-  style 0-0 fg=bright-blue
-  style 2-33 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Using ONE run_code program: call the bash tool twice — exactly echo CODE_ONE then exactly echo    "
+6| "▌ Using ONE run_code program: call the bash tool twice — exactly echo CODE_ONE then exactly echo    "
   style 0-0 fg=bright-blue
   style 65-77 fg=cyan
   style 92-99 fg=cyan
-9| "▌ CODE_TWO — and return the two outputs joined with a plus sign. Then reply with that joined string "
+7| "▌ CODE_TWO — and return the two outputs joined with a plus sign. Then reply with that joined string "
   style 0-0 fg=bright-blue
   style 2-9 fg=cyan
-10| "▌ only and stop.                                                                                    "
+8| "▌ only and stop.                                                                                    "
   style 0-0 fg=bright-blue
-11| "▌ "
+9| "▌ "
   style 0-0 fg=bright-blue
-12| <blank>
-13| " Reasoning                                                                                          "
+10| <blank>
+11| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-14| " The user wants a single run_code program that calls bash twice, then returns the two outputs       "
+12| " The user wants a single run_code program that calls bash twice, then returns the two outputs       "
   style 1-99 fg=bright-black italic
-15| " joined with a plus sign. Let me write this.                                                        "
+13| " joined with a plus sign. Let me write this.                                                        "
   style 1-43 fg=bright-black italic
-16| <blank>
-17| "▌ "
+14| <blank>
+15| "▌ "
   style 0-0 fg=green
-18| "▌ ✓ const out1 = await tools.bash({ command: \"echo CODE_ONE\", description: \"First echo\" });         "
+16| "▌ ✓ const out1 = await tools.bash({ command: \"echo CODE_ONE\", description: \"First echo\" });         "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-99 bold
-19| "▌ const o                                                                                           "
+17| "▌ const o                                                                                           "
   style 0-0 fg=green
   style 2-8 bold
-20| "▌ CODE_ONE+CODE_TWO                                                                                 "
+18| "▌ CODE_ONE+CODE_TWO                                                                                 "
   style 0-0 fg=green
-21| "▌ "
+19| "▌ "
   style 0-0 fg=green
-22| <blank>
-23| " Reasoning                                                                                          "
+20| <blank>
+21| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-24| " The output is exactly what the user asked for: CODE_ONE+CODE_TWO                                   "
+22| " The output is exactly what the user asked for: CODE_ONE+CODE_TWO                                   "
   style 1-64 fg=bright-black italic
-25| <blank>
-26| " Assistant                                                                                          "
+23| <blank>
+24| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-27| " CODE_ONE+CODE_TWO                                                                                  "
-28| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+25| " CODE_ONE+CODE_TWO                                                                                  "
+26| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-29| "                                                                                                    "
+27| "                                                                                                    "
   style 1-1 inverse
-30| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+28| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-31| "/tmp/dsh-tui-snapshot-code-mo  ↑3.1k ↓158 3% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-28 dim
-  style 42-99 dim
-32-35| <blank>
+29| "deepseek-v4-flash  /workspace/project  ↑3.1k ↓158  cache 50%     tools:collapsed"
+  style 0-79 dim
+  style 85-99 dim
+30-35| <blank>

+ 57 - 67
examples/tui-agent/tests/snapshots/cordis-dynamic-toolchain/terminal.expected.txt

@@ -1,116 +1,106 @@
-terminal 100x36 buffer=normal length=50 base=14 viewport=14
+terminal 100x36 buffer=normal length=48 base=12 viewport=12
 lifecycle started=1 stopped=0 progress=inactive
-title "Run this advanced flow exactly — DSH TUI snapshot"
-cursor hidden column=1 viewportRow=33 bufferRow=47
+title "DSH TUI snapshot"
+cursor hidden column=1 viewportRow=33 bufferRow=45
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Recorded replay: cordis-dynamic-toolchain"
+  style 1-41 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Run this advanced flow exactly                                                                   │"
-  style 0-0 fg=bright-blue
-  style 2-31 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Run this advanced flow exactly once: mount a no-op Cordis plugin named snapshot-marker; use       "
+6| "▌ Run this advanced flow exactly once: mount a no-op Cordis plugin named snapshot-marker; use       "
   style 0-0 fg=bright-blue
-9| "▌ run_code to inspect the live dynamic mounts through tools.cordis_inspect; delegate once to a      "
+7| "▌ run_code to inspect the live dynamic mounts through tools.cordis_inspect; delegate once to a      "
   style 0-0 fg=bright-blue
-10| "▌ direct spawn child; run one workflow that delegates to another spawn child; unmount dyn-1; then   "
+8| "▌ direct spawn child; run one workflow that delegates to another spawn child; unmount dyn-1; then   "
   style 0-0 fg=bright-blue
-11| "▌ reply with exactly ADVANCED_ACP_OK.                                                               "
+9| "▌ reply with exactly ADVANCED_ACP_OK.                                                               "
   style 0-0 fg=bright-blue
-12| "▌ "
+10| "▌ "
   style 0-0 fg=bright-blue
-13| <blank>
-14| "▌ "
+11| <blank>
+12| "▌ "
   style 0-0 fg=green
-15| "▌ ✓ Mount plugin into live cordis runtime                                                           "
+13| "▌ ✓ Mount plugin into live cordis runtime                                                           "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-40 bold
-16| "▌ mounted dyn-1 (plugin \"snapshot-marker\", state: active)                                           "
+14| "▌ mounted dyn-1 (plugin \"snapshot-marker\", state: active)                                           "
   style 0-0 fg=green
-17| "▌ "
+15| "▌ "
   style 0-0 fg=green
-18| <blank>
-19| "▌ "
+16| <blank>
+17| "▌ "
   style 0-0 fg=green
-20| "▌ ✓ return await tools.cordis_inspect({ what: 'dynamic' })                                          "
+18| "▌ ✓ return await tools.cordis_inspect({ what: 'dynamic' })                                          "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-57 bold
-21| "▌ ## dynamic                                                                                        "
+19| "▌ ## dynamic                                                                                        "
   style 0-0 fg=green
-22| "▌ - dyn-1: snapshot-marker [active]                                                                 "
+20| "▌ - dyn-1: snapshot-marker [active]                                                                 "
   style 0-0 fg=green
-23| "▌ "
+21| "▌ "
   style 0-0 fg=green
-24| <blank>
-25| "▌ "
+22| <blank>
+23| "▌ "
   style 0-0 fg=green
-26| "▌ ✓ subagent                                                                                        "
+24| "▌ ✓ subagent                                                                                        "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-11 bold
-27| "▌ DIRECT_CHILD_OK                                                                                   "
+25| "▌ DIRECT_CHILD_OK                                                                                   "
   style 0-0 fg=green
-28| "▌ "
+26| "▌ "
   style 0-0 fg=green
-29| <blank>
-30| "▌ "
+27| <blank>
+28| "▌ "
   style 0-0 fg=green
-31| "▌ ✓ workflow: advanced-acp-snapshot                                                                 "
+29| "▌ ✓ workflow: advanced-acp-snapshot                                                                 "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-34 bold
-32| "▌ workflow \"advanced-acp-snapshot\" completed (1 agent).                                             "
+30| "▌ workflow \"advanced-acp-snapshot\" completed (1 agent).                                             "
   style 0-0 fg=green
-33| "▌ Return value:                                                                                     "
+31| "▌ Return value:                                                                                     "
   style 0-0 fg=green
-34| "▌ {                                                                                                 "
+32| "▌ {                                                                                                 "
   style 0-0 fg=green
-35| "▌   \"reply\": \"WORKFLOW_CHILD_OK\"                                                                    "
+33| "▌   \"reply\": \"WORKFLOW_CHILD_OK\"                                                                    "
   style 0-0 fg=green
-36| "▌ }                                                                                                 "
+34| "▌ }                                                                                                 "
   style 0-0 fg=green
-37| "▌ "
+35| "▌ "
   style 0-0 fg=green
-38| <blank>
-39| "▌ "
+36| <blank>
+37| "▌ "
   style 0-0 fg=green
-40| "▌ ✓ Unmount dyn-1                                                                                   "
+38| "▌ ✓ Unmount dyn-1                                                                                   "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-16 bold
-41| "▌ unmounted dyn-1 (plugin \"snapshot-marker\")                                                        "
+39| "▌ unmounted dyn-1 (plugin \"snapshot-marker\")                                                        "
   style 0-0 fg=green
-42| "▌ "
+40| "▌ "
   style 0-0 fg=green
-43| <blank>
-44| " Assistant                                                                                          "
+41| <blank>
+42| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-45| " ADVANCED_ACP_OK                                                                                    "
-46| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+43| " ADVANCED_ACP_OK                                                                                    "
+44| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-47| "                                                                                                    "
+45| "                                                                                                    "
   style 1-1 inverse
-48| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+46| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-49| "/tmp/dsh-tui-snapshot-cordis-dyn  ↑18 ↓18 7% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-31 dim
-  style 42-99 dim
+47| "deepseek-v4-flash  /workspace/project  ↑18 ↓18  cache 0%  tools:c"
+  style 0-90 dim
+  style 93-99 dim

+ 54 - 64
examples/tui-agent/tests/snapshots/dynamic-workflow/terminal.expected.txt

@@ -1,106 +1,96 @@
-terminal 100x36 buffer=normal length=47 base=11 viewport=11
+terminal 100x36 buffer=normal length=45 base=9 viewport=9
 lifecycle started=1 stopped=0 progress=inactive
-title "Use the workflow tool exactly — DSH TUI snapshot"
-cursor hidden column=1 viewportRow=33 bufferRow=44
+title "DSH TUI snapshot"
+cursor hidden column=1 viewportRow=33 bufferRow=42
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Recorded replay: dynamic-workflow"
+  style 1-33 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Use the workflow tool exactly                                                                    │"
-  style 0-0 fg=bright-blue
-  style 2-30 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Use the workflow tool exactly once, with args omitted, meta set to { \"name\": \"snapshot-flow\",     "
+6| "▌ Use the workflow tool exactly once, with args omitted, meta set to { \"name\": \"snapshot-flow\",     "
   style 0-0 fg=bright-blue
-9| "▌ \"description\": \"one child for the snapshot\" }, and this EXACT script body (copy it verbatim):     "
+7| "▌ \"description\": \"one child for the snapshot\" }, and this EXACT script body (copy it verbatim):     "
   style 0-0 fg=bright-blue
-10| "▌ phase('Run')                                                                                      "
+8| "▌ phase('Run')                                                                                      "
   style 0-0 fg=bright-blue
-11| "▌ const reply = await agent('Reply with exactly the word WF_CHILD_OK and nothing else.')            "
+9| "▌ const reply = await agent('Reply with exactly the word WF_CHILD_OK and nothing else.')            "
   style 0-0 fg=bright-blue
-12| "▌ return { reply }                                                                                  "
+10| "▌ return { reply }                                                                                  "
   style 0-0 fg=bright-blue
-13| "▌ After the workflow returns, reply with the single word WORKFLOW_DONE and stop. Do not use any     "
+11| "▌ After the workflow returns, reply with the single word WORKFLOW_DONE and stop. Do not use any     "
   style 0-0 fg=bright-blue
-14| "▌ other tool.                                                                                       "
+12| "▌ other tool.                                                                                       "
   style 0-0 fg=bright-blue
-15| "▌ "
+13| "▌ "
   style 0-0 fg=bright-blue
-16| <blank>
-17| " Reasoning                                                                                          "
+14| <blank>
+15| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-18| " The user wants me to use the workflow tool exactly once with specific parameters. Let me carefully "
+16| " The user wants me to use the workflow tool exactly once with specific parameters. Let me carefully "
   style 1-99 fg=bright-black italic
-19| " follow the instructions:                                                                           "
+17| " follow the instructions:                                                                           "
   style 1-24 fg=bright-black italic
-20| "                                                                                                    "
-21| " 1. args omitted (so I don't include it)                                                            "
+18| "                                                                                                    "
+19| " 1. args omitted (so I don't include it)                                                            "
   style 1-3 fg=bright-blue
   style 4-39 fg=bright-black italic
-22| " 2. meta = { \"name\": \"snapshot-flow\", \"description\": \"one child for the snapshot\" }                 "
+20| " 2. meta = { \"name\": \"snapshot-flow\", \"description\": \"one child for the snapshot\" }                 "
   style 1-3 fg=bright-blue
   style 4-82 fg=bright-black italic
-23| " 3. script = as given verbatim                                                                      "
+21| " 3. script = as given verbatim                                                                      "
   style 1-3 fg=bright-blue
   style 4-29 fg=bright-black italic
-24| " 4. After it returns, reply with \"WORKFLOW_DONE\"                                                    "
+22| " 4. After it returns, reply with \"WORKFLOW_DONE\"                                                    "
   style 1-3 fg=bright-blue
   style 4-47 fg=bright-black italic
-25| "                                                                                                    "
-26| " Let me do exactly that.                                                                            "
+23| "                                                                                                    "
+24| " Let me do exactly that.                                                                            "
   style 1-23 fg=bright-black italic
-27| <blank>
-28| "▌ "
+25| <blank>
+26| "▌ "
   style 0-0 fg=green
-29| "▌ ✓ workflow: snapshot-flow                                                                         "
+27| "▌ ✓ workflow: snapshot-flow                                                                         "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-26 bold
-30| "▌ workflow \"snapshot-flow\" completed (1 agent).                                                     "
+28| "▌ workflow \"snapshot-flow\" completed (1 agent).                                                     "
   style 0-0 fg=green
-31| "▌ Return value:                                                                                     "
+29| "▌ Return value:                                                                                     "
   style 0-0 fg=green
-32| "▌ {                                                                                                 "
+30| "▌ {                                                                                                 "
   style 0-0 fg=green
-33| "▌   \"reply\": \"WF_CHILD_OK\"                                                                          "
+31| "▌   \"reply\": \"WF_CHILD_OK\"                                                                          "
   style 0-0 fg=green
-34| "▌ }                                                                                                 "
+32| "▌ }                                                                                                 "
   style 0-0 fg=green
-35| "▌ "
+33| "▌ "
   style 0-0 fg=green
-36| <blank>
-37| " Reasoning                                                                                          "
+34| <blank>
+35| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-38| " The workflow returned successfully with the reply \"WF_CHILD_OK\". Now I need to reply with exactly  "
+36| " The workflow returned successfully with the reply \"WF_CHILD_OK\". Now I need to reply with exactly  "
   style 1-99 fg=bright-black italic
-39| " \"WORKFLOW_DONE\" and stop.                                                                          "
+37| " \"WORKFLOW_DONE\" and stop.                                                                          "
   style 1-25 fg=bright-black italic
-40| <blank>
-41| " Assistant                                                                                          "
+38| <blank>
+39| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-42| " WORKFLOW_DONE                                                                                      "
-43| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+40| " WORKFLOW_DONE                                                                                      "
+41| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-44| "                                                                                                    "
+42| "                                                                                                    "
   style 1-1 inverse
-45| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+43| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-46| "/tmp/dsh-tui-snapshot-dynamic  ↑3.5k ↓227 3% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-28 dim
-  style 42-99 dim
+44| "deepseek-v4-flash  /workspace/project  ↑3.5k ↓227  cache 47%  tools:colla"
+  style 0-86 dim
+  style 89-99 dim

+ 39 - 49
examples/tui-agent/tests/snapshots/multi-turn-conversation/terminal.expected.txt

@@ -1,70 +1,60 @@
 terminal 100x36 buffer=normal length=36 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
-title "Reply with exactly the word: — DSH TUI snapshot"
-cursor hidden column=1 viewportRow=28 bufferRow=28
+title "DSH TUI snapshot"
+cursor hidden column=1 viewportRow=26 bufferRow=26
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Reply with exactly the word:                                                                     │"
-  style 0-0 fg=bright-blue
-  style 2-29 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Recorded replay: multi-turn-conversation"
+  style 1-40 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
+  style 0-0 fg=bright-blue
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Reply with exactly the word: ONE. No tools.                                                       "
+6| "▌ Reply with exactly the word: ONE. No tools.                                                       "
   style 0-0 fg=bright-blue
-9| "▌ "
+7| "▌ "
   style 0-0 fg=bright-blue
-10| <blank>
-11| " Reasoning                                                                                          "
+8| <blank>
+9| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-12| " The user wants me to reply with exactly the word \"ONE\" and use no tools.                           "
+10| " The user wants me to reply with exactly the word \"ONE\" and use no tools.                           "
   style 1-72 fg=bright-black italic
-13| <blank>
-14| " Assistant                                                                                          "
+11| <blank>
+12| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-15| " ONE                                                                                                "
-16| <blank>
-17| "▌ "
+13| " ONE                                                                                                "
+14| <blank>
+15| "▌ "
   style 0-0 fg=bright-blue
-18| "▌ You                                                                                               "
+16| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-19| "▌ Reply with exactly the word: TWO. No tools.                                                       "
+17| "▌ Reply with exactly the word: TWO. No tools.                                                       "
   style 0-0 fg=bright-blue
-20| "▌ "
+18| "▌ "
   style 0-0 fg=bright-blue
-21| <blank>
-22| " Reasoning                                                                                          "
+19| <blank>
+20| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-23| " The user wants me to reply with exactly the word \"TWO\" and no tools.                               "
+21| " The user wants me to reply with exactly the word \"TWO\" and no tools.                               "
   style 1-68 fg=bright-black italic
-24| <blank>
-25| " Assistant                                                                                          "
+22| <blank>
+23| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-26| " TWO                                                                                                "
-27| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+24| " TWO                                                                                                "
+25| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-28| "                                                                                                    "
+26| "                                                                                                    "
   style 1-1 inverse
-29| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+27| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-30| "/tmp/dsh-tui-snapshot-multi-tu  ↑2.9k ↓41 3% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-29 dim
-  style 42-99 dim
-31-35| <blank>
+28| "deepseek-v4-flash  /workspace/project  ↑2.9k ↓41  cache 49%  tools"
+  style 0-92 dim
+  style 95-99 dim
+29-35| <blank>

+ 46 - 56
examples/tui-agent/tests/snapshots/parallel-file-reads/terminal.expected.txt

@@ -1,91 +1,81 @@
-terminal 100x36 buffer=normal length=39 base=3 viewport=3
+terminal 100x36 buffer=normal length=37 base=1 viewport=1
 lifecycle started=1 stopped=0 progress=inactive
-title "Use the read tool twice — DSH TUI snapshot"
-cursor hidden column=1 viewportRow=33 bufferRow=36
+title "DSH TUI snapshot"
+cursor hidden column=1 viewportRow=33 bufferRow=34
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Recorded replay: parallel-file-reads"
+  style 1-36 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Use the read tool twice                                                                          │"
-  style 0-0 fg=bright-blue
-  style 2-24 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Use the read tool twice in the same assistant message: read a.txt and b.txt. Then reply DONE.     "
+6| "▌ Use the read tool twice in the same assistant message: read a.txt and b.txt. Then reply DONE.     "
   style 0-0 fg=bright-blue
-9| "▌ "
+7| "▌ "
   style 0-0 fg=bright-blue
-10| <blank>
-11| "▌ "
+8| <blank>
+9| "▌ "
   style 0-0 fg=green
-12| "▌ ✓ Read a.txt                                                                                      "
+10| "▌ ✓ Read a.txt                                                                                      "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-13 bold
-13| "▌ <path>/workspace/project/a.txt</path>                               "
+11| "▌ <path>/workspace/project/a.txt</path>                               "
   style 0-0 fg=green
-14| "▌ <type>file</type>                                                                                 "
+12| "▌ <type>file</type>                                                                                 "
   style 0-0 fg=green
-15| "▌ <content>                                                                                         "
+13| "▌ <content>                                                                                         "
   style 0-0 fg=green
-16| "▌ 1: alpha                                                                                          "
+14| "▌ 1: alpha                                                                                          "
   style 0-0 fg=green
-17| "▌                                                                                                   "
+15| "▌                                                                                                   "
   style 0-0 fg=green
-18| "▌ (End of file - total 1 lines)                                                                     "
+16| "▌ (End of file - total 1 lines)                                                                     "
   style 0-0 fg=green
-19| "▌ </content>                                                                                        "
+17| "▌ </content>                                                                                        "
   style 0-0 fg=green
-20| "▌ "
+18| "▌ "
   style 0-0 fg=green
-21| <blank>
-22| "▌ "
+19| <blank>
+20| "▌ "
   style 0-0 fg=green
-23| "▌ ✓ Read b.txt                                                                                      "
+21| "▌ ✓ Read b.txt                                                                                      "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-13 bold
-24| "▌ <path>/workspace/project/b.txt</path>                               "
+22| "▌ <path>/workspace/project/b.txt</path>                               "
   style 0-0 fg=green
-25| "▌ <type>file</type>                                                                                 "
+23| "▌ <type>file</type>                                                                                 "
   style 0-0 fg=green
-26| "▌ <content>                                                                                         "
+24| "▌ <content>                                                                                         "
   style 0-0 fg=green
-27| "▌ 1: beta                                                                                           "
+25| "▌ 1: beta                                                                                           "
   style 0-0 fg=green
-28| "▌                                                                                                   "
+26| "▌                                                                                                   "
   style 0-0 fg=green
-29| "▌ (End of file - total 1 lines)                                                                     "
+27| "▌ (End of file - total 1 lines)                                                                     "
   style 0-0 fg=green
-30| "▌ </content>                                                                                        "
+28| "▌ </content>                                                                                        "
   style 0-0 fg=green
-31| "▌ "
+29| "▌ "
   style 0-0 fg=green
-32| <blank>
-33| " Assistant                                                                                          "
+30| <blank>
+31| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-34| " DONE                                                                                               "
-35| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+32| " DONE                                                                                               "
+33| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-36| "                                                                                                    "
+34| "                                                                                                    "
   style 1-1 inverse
-37| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+35| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-38| "/tmp/dsh-tui-snapshot-parallel-fi  ↑20 ↓6 3% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-32 dim
-  style 42-99 dim
+36| "deepseek-v4-flash  /workspace/project  ↑20 ↓6  cache 0%  tools:collaps"
+  style 0-84 dim
+  style 87-99 dim

+ 43 - 52
examples/tui-agent/tests/snapshots/todo-plan/terminal.expected.txt

@@ -1,81 +1,72 @@
 terminal 100x36 buffer=normal length=36 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
-title "Use the todo_write tool to — DSH TUI snapshot"
-cursor hidden column=1 viewportRow=33 bufferRow=33
+title "DSH TUI snapshot"
+cursor hidden column=1 viewportRow=31 bufferRow=31
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Recorded replay: todo-plan"
+  style 1-26 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Use the todo_write tool to                                                                       │"
-  style 0-0 fg=bright-blue
-  style 2-27 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Use the todo_write tool to record a plan with exactly three todos: \"read the code\" (in_progress), "
+6| "▌ Use the todo_write tool to record a plan with exactly three todos: \"read the code\" (in_progress), "
   style 0-0 fg=bright-blue
-9| "▌ \"write the fix\" (pending), \"run the tests\" (pending). Send all three in one todo_write call. Then "
+7| "▌ \"write the fix\" (pending), \"run the tests\" (pending). Send all three in one todo_write call. Then "
   style 0-0 fg=bright-blue
-10| "▌ reply with the single word DONE and stop.                                                         "
+8| "▌ reply with the single word DONE and stop.                                                         "
   style 0-0 fg=bright-blue
-11| "▌ "
+9| "▌ "
   style 0-0 fg=bright-blue
-12| <blank>
-13| " Reasoning                                                                                          "
+10| <blank>
+11| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-14| " The user wants me to use the todo_write tool to record a plan with exactly three todos in the      "
+12| " The user wants me to use the todo_write tool to record a plan with exactly three todos in the      "
   style 1-99 fg=bright-black italic
-15| " specified statuses, then reply with \"DONE\".                                                        "
+13| " specified statuses, then reply with \"DONE\".                                                        "
   style 1-43 fg=bright-black italic
-16| <blank>
-17| "▌ "
+14| <blank>
+15| "▌ "
   style 0-0 fg=green
-18| "▌ ✓ Update todo list                                                                                "
+16| "▌ ✓ Update todo list                                                                                "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-19 bold
-19| "▌ Updated todo list: 2 pending, 1 in progress, 0 completed.                                         "
+17| "▌ Updated todo list: 2 pending, 1 in progress, 0 completed.                                         "
   style 0-0 fg=green
-20| "▌ "
+18| "▌ "
   style 0-0 fg=green
-21| <blank>
-22| " Reasoning                                                                                          "
+19| <blank>
+20| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-23| " The todos have been written successfully. Now I just need to reply with the single word \"DONE\".    "
+21| " The todos have been written successfully. Now I just need to reply with the single word \"DONE\".    "
   style 1-95 fg=bright-black italic
-24| <blank>
-25| " Assistant                                                                                          "
+22| <blank>
+23| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-26| " DONE                                                                                               "
-27| <blank>
-28| "Plan"
+24| " DONE                                                                                               "
+25| <blank>
+26| "Plan"
   style 0-3 fg=bright-blue bold
-29| "  ● read the code"
+27| "  ● read the code"
   style 2-2 fg=yellow
-30| "  ○ write the fix"
+28| "  ○ write the fix"
   style 2-2 dim
-31| "  ○ run the tests"
+29| "  ○ run the tests"
   style 2-2 dim
-32| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+30| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-33| "                                                                                                    "
+31| "                                                                                                    "
   style 1-1 inverse
-34| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+32| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-35| "/tmp/dsh-tui-snapshot-todo-pl  ↑3.1k ↓145 3% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-28 dim
-  style 42-99 dim
+33| "deepseek-v4-flash  /workspace/project  ↑3.1k ↓145  cache 47%     tools:collapsed"
+  style 0-79 dim
+  style 85-99 dim
+34-35| <blank>

+ 3 - 1
packages/ui/tui/tests/harness.ts

@@ -24,6 +24,8 @@ interface FakeAgent extends Agent {
 export interface TuiHarnessOptions {
   status?: AgentStatus
   config?: Config
+  /** Omit the harness's default `welcome`, exercising the banner sweep-reveal path. */
+  omitWelcome?: boolean
   tools?: Record<string, ToolDefinition>
   configureContext?: (ctx: Context) => Promise<void>
   beforeMount?: (session: Session) => void
@@ -142,7 +144,7 @@ export async function createTuiTestHarness<TerminalType extends Terminal, Exit e
   }
   ctx.agents.register(agent)
   const controller = createTuiChat(ctx, Object.assign({
-    welcome: 'Coding agent ready.',
+    ...options.omitWelcome === true ? {} : { welcome: 'Coding agent ready.' },
     sessionId,
     color: false,
   }, options.config), {

+ 52 - 62
packages/ui/tui/tests/snapshots/advanced-cards-collapsed.expected.txt

@@ -1,108 +1,98 @@
-terminal 100x40 buffer=normal length=41 base=1 viewport=1
+terminal 100x40 buffer=normal length=40 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=37 bufferRow=38
+cursor hidden column=1 viewportRow=36 bufferRow=36
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                            │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=green
-7| "▌ ✓ pnpm run test:coverage                                                                          "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
+  style 0-0 fg=green
+5| "▌ ✓ pnpm run test:coverage                                                                          "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-25 bold
-8| "▌ Run the coverage gate                                                                             "
+6| "▌ Run the coverage gate                                                                             "
   style 0-0 fg=green
   style 2-22 fg=bright-black
-9| "▌ /workspace/project                                                                                "
+7| "▌ /workspace/project                                                                                "
   style 0-0 fg=green
   style 2-19 dim
-10| "▌ … +4 lines (Ctrl+O to expand)                                                                     "
+8| "▌ packages/ui/tui 100%                                                                              "
   style 0-0 fg=green
-  style 2-30 dim
-11| "▌ [exit 0]                                                                                          "
+9| "▌ … 4 more lines (Ctrl+O to expand)                                                                 "
   style 0-0 fg=green
-  style 2-9 dim
-12| "▌ "
+  style 2-34 dim
+10| "▌ "
   style 0-0 fg=green
-13| <blank>
-14| "▌ "
+11| <blank>
+12| "▌ "
   style 0-0 fg=green
-15| "▌ ✓ Edit renderer                                                                                   "
+13| "▌ ✓ Edit renderer                                                                                   "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-16 bold
-16| "▌ src/view.ts                                                                                       "
+14| "▌ src/view.ts                                                                                       "
   style 0-0 fg=green
   style 2-12 bold
-17| "▌ - old line                                                                                        "
+15| "▌ - old line                                                                                        "
   style 0-0 fg=green
   style 2-11 fg=red
-18| "▌ … +5 lines (Ctrl+O to expand)                                                                     "
+16| "▌ - keep                                                                                            "
   style 0-0 fg=green
-  style 2-30 dim
-19| "▌ + expect(screen).toMatchSnapshot()                                                                "
+  style 2-7 fg=red
+17| "▌ … 5 more lines (Ctrl+O to expand)                                                                 "
   style 0-0 fg=green
-  style 2-35 fg=green
-20| "▌ "
+  style 2-34 dim
+18| "▌ "
   style 0-0 fg=green
-21| <blank>
-22| "▌ "
+19| <blank>
+20| "▌ "
   style 0-0 fg=green
-23| "▌ ✓ Delegate renderer audit                                                                         "
+21| "▌ ✓ Delegate renderer audit                                                                         "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-26 bold
-24| "▌ The renderer has explicit lifecycle ownership.                                                    "
+22| "▌ The renderer has explicit lifecycle ownership.                                                    "
   style 0-0 fg=green
-25| "▌ "
+23| "▌ "
   style 0-0 fg=green
-26| <blank>
-27| "▌ "
+24| <blank>
+25| "▌ "
   style 0-0 fg=green
-28| "▌ ✓ Read output from background task subagent-7                                                     "
+26| "▌ ✓ Read output from background task subagent-7                                                     "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-46 bold
-29| "▌ audit complete                                                                                    "
+27| "▌ audit complete                                                                                    "
   style 0-0 fg=green
-30| "▌ [status: completed]                                                                               "
+28| "▌ [status: completed]                                                                               "
   style 0-0 fg=green
-31| "▌ "
+29| "▌ "
   style 0-0 fg=green
-32| <blank>
-33| "▌ "
+30| <blank>
+31| "▌ "
   style 0-0 fg=green
-34| "▌ ✓ Load skill dsh-code-review                                                                      "
+32| "▌ ✓ Load skill dsh-code-review                                                                      "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-29 bold
-35| "▌ Loaded review instructions.                                                                       "
+33| "▌ Loaded review instructions.                                                                       "
   style 0-0 fg=green
-36| "▌ "
+34| "▌ "
   style 0-0 fg=green
-37| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+35| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-38| "                                                                                                    "
+36| "                                                                                                    "
   style 1-1 inverse
-39| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+37| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-40| "/workspace/project  ↑0 ↓0                 0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 42-99 dim
+38| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                         tools:collapsed"
+  style 0-43 dim
+  style 85-99 dim
+39| <blank>

+ 57 - 67
packages/ui/tui/tests/snapshots/advanced-cards-expanded.expected.txt

@@ -1,127 +1,117 @@
-terminal 100x40 buffer=normal length=50 base=10 viewport=10
+terminal 100x40 buffer=normal length=48 base=8 viewport=8
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=37 bufferRow=47
+cursor hidden column=1 viewportRow=37 bufferRow=45
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                            │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=green
-7| "▌ ✓ pnpm run test:coverage                                                                          "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
+  style 0-0 fg=green
+5| "▌ ✓ pnpm run test:coverage                                                                          "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-25 bold
-8| "▌ Run the coverage gate                                                                             "
+6| "▌ Run the coverage gate                                                                             "
   style 0-0 fg=green
   style 2-22 fg=bright-black
-9| "▌ /workspace/project                                                                                "
+7| "▌ /workspace/project                                                                                "
   style 0-0 fg=green
   style 2-19 dim
-10| "▌ packages/ui/tui 100%                                                                              "
+8| "▌ packages/ui/tui 100%                                                                              "
   style 0-0 fg=green
-11| "▌ 4016 tests passed                                                                                 "
+9| "▌ 4016 tests passed                                                                                 "
   style 0-0 fg=green
-12| "▌ 1 test skipped                                                                                    "
+10| "▌ 1 test skipped                                                                                    "
   style 0-0 fg=green
-13| "▌ coverage complete                                                                                 "
+11| "▌ coverage complete                                                                                 "
   style 0-0 fg=green
-14| "▌ [exit 0]                                                                                          "
+12| "▌ [exit 0]                                                                                          "
   style 0-0 fg=green
   style 2-9 dim
-15| "▌ "
+13| "▌ "
   style 0-0 fg=green
-16| <blank>
-17| "▌ "
+14| <blank>
+15| "▌ "
   style 0-0 fg=green
-18| "▌ ✓ Edit renderer                                                                                   "
+16| "▌ ✓ Edit renderer                                                                                   "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-16 bold
-19| "▌ src/view.ts                                                                                       "
+17| "▌ src/view.ts                                                                                       "
   style 0-0 fg=green
   style 2-12 bold
-20| "▌ - old line                                                                                        "
+18| "▌ - old line                                                                                        "
   style 0-0 fg=green
   style 2-11 fg=red
-21| "▌ - keep                                                                                            "
+19| "▌ - keep                                                                                            "
   style 0-0 fg=green
   style 2-7 fg=red
-22| "▌ + new line                                                                                        "
+20| "▌ + new line                                                                                        "
   style 0-0 fg=green
   style 2-11 fg=green
-23| "▌ + keep                                                                                            "
+21| "▌ + keep                                                                                            "
   style 0-0 fg=green
   style 2-7 fg=green
-24| "▌                                                                                                   "
+22| "▌                                                                                                   "
   style 0-0 fg=green
-25| "▌ tests/view.spec.ts                                                                                "
+23| "▌ tests/view.spec.ts                                                                                "
   style 0-0 fg=green
   style 2-19 bold
-26| "▌ + expect(screen).toMatchSnapshot()                                                                "
+24| "▌ + expect(screen).toMatchSnapshot()                                                                "
   style 0-0 fg=green
   style 2-35 fg=green
-27| "▌ "
+25| "▌ "
   style 0-0 fg=green
-28| <blank>
-29| "▌ "
+26| <blank>
+27| "▌ "
   style 0-0 fg=green
-30| "▌ ✓ Delegate renderer audit                                                                         "
+28| "▌ ✓ Delegate renderer audit                                                                         "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-26 bold
-31| "▌ The renderer has explicit lifecycle ownership.                                                    "
+29| "▌ The renderer has explicit lifecycle ownership.                                                    "
   style 0-0 fg=green
-32| "▌ "
+30| "▌ "
   style 0-0 fg=green
-33| <blank>
-34| "▌ "
+31| <blank>
+32| "▌ "
   style 0-0 fg=green
-35| "▌ ✓ Read output from background task subagent-7                                                     "
+33| "▌ ✓ Read output from background task subagent-7                                                     "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-46 bold
-36| "▌ audit complete                                                                                    "
+34| "▌ audit complete                                                                                    "
   style 0-0 fg=green
-37| "▌ [status: completed]                                                                               "
+35| "▌ [status: completed]                                                                               "
   style 0-0 fg=green
-38| "▌ "
+36| "▌ "
   style 0-0 fg=green
-39| <blank>
-40| "▌ "
+37| <blank>
+38| "▌ "
   style 0-0 fg=green
-41| "▌ ✓ Load skill dsh-code-review                                                                      "
+39| "▌ ✓ Load skill dsh-code-review                                                                      "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-29 bold
-42| "▌ Loaded review instructions.                                                                       "
+40| "▌ Loaded review instructions.                                                                       "
   style 0-0 fg=green
-43| "▌ "
+41| "▌ "
   style 0-0 fg=green
-44| <blank>
-45| " Tool cards expanded.                                                                               "
+42| <blank>
+43| " Tool cards expanded.                                                                               "
   style 1-20 fg=bright-black
-46| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+44| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-47| "                                                                                                    "
+45| "                                                                                                    "
   style 1-1 inverse
-48| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+46| "────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-99 dim
-49| "/workspace/project  ↑0 ↓0                0% context  tools:expanded  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 41-99 dim
+47| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                          tools:expanded"
+  style 0-43 dim
+  style 86-99 dim

+ 25 - 35
packages/ui/tui/tests/snapshots/code-mode-pending.expected.txt

@@ -1,52 +1,42 @@
 terminal 96x36 buffer=normal length=36 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=15 bufferRow=15
+cursor hidden column=1 viewportRow=13 bufferRow=13
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-95 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                             │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 95-95 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                        │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 95-95 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                           │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 95-95 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-95 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=yellow
-7| "▌ ◌ const first = await tools.bash({ command: 'echo CODE_ONE' })                                "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
+  style 0-0 fg=yellow
+5| "▌ ◌ const first = await tools.bash({ command: 'echo CODE_ONE' })                                "
   style 0-0 fg=yellow
   style 2-2 fg=yellow bold
   style 3-95 bold
-8| "▌ const second = await tools.bas                                                                "
+6| "▌ const second = await tools.bas                                                                "
   style 0-0 fg=yellow
   style 2-31 bold
-9| "▌ const first = await tools.bash({ command: 'echo CODE_ONE' })                                  "
+7| "▌ const first = await tools.bash({ command: 'echo CODE_ONE' })                                  "
   style 0-0 fg=yellow
-10| "▌ const second = await tools.bash({ command: 'echo CODE_TWO' })                                 "
+8| "▌ const second = await tools.bash({ command: 'echo CODE_TWO' })                                 "
   style 0-0 fg=yellow
-11| "▌ console.log(first, second)                                                                    "
+9| "▌ console.log(first, second)                                                                    "
   style 0-0 fg=yellow
-12| "▌ return `${first}+${second}`                                                                   "
+10| "▌ return `${first}+${second}`                                                                   "
   style 0-0 fg=yellow
-13| "▌ "
+11| "▌ "
   style 0-0 fg=yellow
-14| "────────────────────────────────────────────────────────────────────────────────────────────────"
+12| "────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-95 dim
-15| "                                                                                                "
+13| "                                                                                                "
   style 1-1 inverse
-16| "────────────────────────────────────────────────────────────────────────────────────────────────"
+14| "────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-95 dim
-17| "/workspace/project  ↑0 ↓0             0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 38-95 dim
-18-35| <blank>
+15| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                     tools:collapsed"
+  style 0-43 dim
+  style 81-95 dim
+16-35| <blank>

+ 29 - 39
packages/ui/tui/tests/snapshots/conversation-streaming.expected.txt

@@ -1,52 +1,42 @@
 terminal 96x36 buffer=normal length=36 base=0 viewport=0
-lifecycle started=1 stopped=0 progress=active
+lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=17 bufferRow=17
+cursor hidden column=1 viewportRow=15 bufferRow=15
 viewport
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-95 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                             │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 95-95 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                        │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 95-95 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                           │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 95-95 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-95 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                                           "
+5| "▌ You                                                                                           "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Show the live update.                                                                         "
+6| "▌ Show the live update.                                                                         "
   style 0-0 fg=bright-blue
-9| "▌ "
+7| "▌ "
   style 0-0 fg=bright-blue
-10| <blank>
-11| " Reasoning                                                                                      "
+8| <blank>
+9| " Reasoning                                                                                      "
   style 1-9 fg=bright-black italic
-12| " Inspecting width and styles.                                                                   "
+10| " Inspecting width and styles.                                                                   "
   style 1-28 fg=bright-black italic
-13| <blank>
-14| " Assistant                                                                                      "
+11| <blank>
+12| " Assistant                                                                                      "
   style 1-9 fg=bright-magenta bold
-15| " Streaming visible state…                                                                       "
+13| " Streaming visible state…                                                                       "
   style 11-23 bold
-16| "────────────────────────────────────────────────────────────────────────────────────────────────"
-  style 0-95 fg=bright-blue
-17| "                                                                                                "
+14| "────────────────────────────────────────────────────────────────────────────────────────────────"
+  style 0-95 dim
+15| "                                                                                                "
   style 1-1 inverse
-18| "────────────────────────────────────────────────────────────────────────────────────────────────"
-  style 0-95 fg=bright-blue
-19| "◒ Working · 0s                                                                     esc interrupt"
-  style 0-13 fg=bright-blue
-  style 83-95 dim
-20-35| <blank>
+16| "────────────────────────────────────────────────────────────────────────────────────────────────"
+  style 0-95 dim
+17| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                     tools:collapsed"
+  style 0-43 dim
+  style 81-95 dim
+18-35| <blank>

+ 27 - 37
packages/ui/tui/tests/snapshots/cordis-tools-pending.expected.txt

@@ -1,59 +1,49 @@
 terminal 96x36 buffer=normal length=36 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=18 bufferRow=18
+cursor hidden column=1 viewportRow=16 bufferRow=16
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-95 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                             │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 95-95 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                        │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 95-95 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                           │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 95-95 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-95 fg=bright-blue
-5| <blank>
-6| "▌ ◌ Inspect cordis runtime: tools                                                               "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ ◌ Inspect cordis runtime: tools                                                               "
   style 0-0 fg=yellow
   style 2-2 fg=yellow bold
   style 3-32 bold
-7| <blank>
-8| "▌ "
+5| <blank>
+6| "▌ "
   style 0-0 fg=yellow
-9| "▌ ◌ Mount plugin into live cordis runtime                                                       "
+7| "▌ ◌ Mount plugin into live cordis runtime                                                       "
   style 0-0 fg=yellow
   style 2-2 fg=yellow bold
   style 3-40 bold
-10| "▌ {                                                                                             "
+8| "▌ {                                                                                             "
   style 0-0 fg=yellow
-11| "▌   \"code\": \"return { name: 'snapshot-marker', apply(ctx) { ctx.provide('snapshotMarker', {     "
+9| "▌   \"code\": \"return { name: 'snapshot-marker', apply(ctx) { ctx.provide('snapshotMarker', {     "
   style 0-0 fg=yellow
-12| "▌ ready: true }) } }\"                                                                           "
+10| "▌ ready: true }) } }\"                                                                           "
   style 0-0 fg=yellow
-13| "▌ }                                                                                             "
+11| "▌ }                                                                                             "
   style 0-0 fg=yellow
-14| "▌ "
+12| "▌ "
   style 0-0 fg=yellow
-15| <blank>
-16| "▌ ◌ Unmount dyn-1                                                                               "
+13| <blank>
+14| "▌ ◌ Unmount dyn-1                                                                               "
   style 0-0 fg=yellow
   style 2-2 fg=yellow bold
   style 3-16 bold
-17| "────────────────────────────────────────────────────────────────────────────────────────────────"
+15| "────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-95 dim
-18| "                                                                                                "
+16| "                                                                                                "
   style 1-1 inverse
-19| "────────────────────────────────────────────────────────────────────────────────────────────────"
+17| "────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-95 dim
-20| "/workspace/project  ↑0 ↓0             0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 38-95 dim
-21-35| <blank>
+18| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                     tools:collapsed"
+  style 0-43 dim
+  style 81-95 dim
+19-35| <blank>

+ 30 - 53
packages/ui/tui/tests/snapshots/disposed-terminal.expected.txt

@@ -1,67 +1,44 @@
 terminal 92x32 buffer=normal length=32 base=0 viewport=0
 lifecycle started=1 stopped=1 progress=inactive
 title "DSH snapshot"
-cursor visible column=0 viewportRow=30 bufferRow=30
+cursor visible column=0 viewportRow=21 bufferRow=21
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-91 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                         │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 91-91 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                    │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 91-91 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                       │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 91-91 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-91 fg=bright-blue
-5| <blank>
-6| " Keyboard shortcuts                                                                         "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| " Keyboard shortcuts                                                                         "
   style 1-18 fg=bright-blue bold
-7| " Enter send • Shift/Alt+Enter newline • Up/Down prompt history                              "
+5| " Enter send • Shift/Alt+Enter newline • Up/Down prompt history                              "
   style 1-61 fg=bright-black
-8| " Esc cancel active turn • Ctrl+O toggle tool cards • Ctrl+R toggle reasoning                "
+6| " Esc cancel active turn • Ctrl+O expand tool cards • Ctrl+R toggle reasoning                "
   style 1-75 fg=bright-black
-9| " Ctrl+C cancel while running; clear input or exit while idle • Ctrl+D exit                  "
+7| " Ctrl+C cancel while running; clear input or exit while idle • Ctrl+D exit                  "
   style 1-73 fg=bright-black
-10| "                                                                                            "
-11| " /cancel — Cancel the active turn                                                           "
-  style 1-32 fg=bright-black
-12| " /clear — Clear the transcript view (session history is unchanged)                          "
-  style 1-65 fg=bright-black
-13| " /exit — Exit after the active turn reaches idle                                            "
-  style 1-47 fg=bright-black
-14| " /help — Show keyboard shortcuts and commands                                               "
-  style 1-44 fg=bright-black
-15| " /model [[provider/]model] — Show or switch this session's model                            "
+8| " /help /clear /reasoning /tools /redraw /reload /resume /exit                               "
+  style 1-60 fg=bright-black
+9| " /skill:<name> [instructions] load a skill into the conversation                            "
   style 1-63 fg=bright-black
-16| " /reasoning — Toggle reasoning blocks                                                       "
-  style 1-36 fg=bright-black
-17| " /redraw — Invalidate components and redraw the terminal                                    "
-  style 1-55 fg=bright-black
-18| " /tools — Expand or collapse all tool cards                                                 "
-  style 1-42 fg=bright-black
-19| <blank>
-20| " provider stream failed after partial output                                                "
+10| <blank>
+11| " Unknown command: /unknown-advanced-command                                                 "
+  style 1-42 fg=yellow
+12| <blank>
+13| " provider stream failed after partial output                                                "
   style 1-43 fg=red
-21| <blank>
-22| " The previous process ended during this turn.                                               "
+14| <blank>
+15| " The previous process ended during this turn.                                               "
   style 1-44 fg=yellow
-23| <blank>
-24| " Unknown command: /unknown-advanced-command                                                 "
-  style 1-42 fg=yellow
-25| "────────────────────────────────────────────────────────────────────────────────────────────"
+16| "────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-91 dim
-26| "                                                                                            "
+17| "                                                                                            "
   style 1-1 inverse
-27| "────────────────────────────────────────────────────────────────────────────────────────────"
+18| "────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-91 dim
-28| "/workspace/project  ↑0 ↓0         0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 34-91 dim
-29-31| <blank>
+19| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                 tools:collapsed"
+  style 0-43 dim
+  style 77-91 dim
+20-31| <blank>

+ 27 - 38
packages/ui/tui/tests/snapshots/dynamic-workflow-pending.expected.txt

@@ -1,56 +1,45 @@
 terminal 96x36 buffer=normal length=36 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=17 bufferRow=17
+cursor hidden column=1 viewportRow=15 bufferRow=15
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-95 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                             │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 95-95 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                        │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 95-95 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                           │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 95-95 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-95 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=yellow
-7| "▌ ◌ workflow: tui-matrix                                                                        "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
+  style 0-0 fg=yellow
+5| "▌ ◌ workflow: tui-matrix                                                                        "
   style 0-0 fg=yellow
   style 2-2 fg=yellow bold
   style 3-23 bold
-8| "▌ phase('Inspect')                                                                              "
+6| "▌ phase('Inspect')                                                                              "
   style 0-0 fg=yellow
-9| "▌ const reports = await parallel([                                                              "
+7| "▌ const reports = await parallel([                                                              "
   style 0-0 fg=yellow
-10| "▌   () => agent('Audit layout', { label: 'layout', phase: 'Inspect' }),                         "
+8| "▌   () => agent('Audit layout', { label: 'layout', phase: 'Inspect' }),                         "
   style 0-0 fg=yellow
-11| "▌ … +1 lines (Ctrl+O to expand)                                                                 "
+9| "▌   () => agent('Audit lifecycle', { label: 'lifecycle', phase: 'Inspect' }),                   "
   style 0-0 fg=yellow
-  style 2-30 dim
-12| "▌ ])                                                                                            "
+10| "▌ ])                                                                                            "
   style 0-0 fg=yellow
-13| "▌ phase('Verify')                                                                               "
+11| "▌ phase('Verify')                                                                               "
   style 0-0 fg=yellow
-14| "▌ return { reports, verdict: 'covered' }                                                        "
+12| "▌ return { reports, verdict: 'covered' }                                                        "
   style 0-0 fg=yellow
-15| "▌ "
+13| "▌ "
   style 0-0 fg=yellow
-16| "────────────────────────────────────────────────────────────────────────────────────────────────"
+14| "────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-95 dim
-17| "                                                                                                "
+15| "                                                                                                "
   style 1-1 inverse
-18| "────────────────────────────────────────────────────────────────────────────────────────────────"
+16| "────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-95 dim
-19| "/workspace/project  ↑0 ↓0             0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 38-95 dim
-20-35| <blank>
+17| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                     tools:collapsed"
+  style 0-43 dim
+  style 81-95 dim
+18-35| <blank>

+ 30 - 53
packages/ui/tui/tests/snapshots/errors-and-help.expected.txt

@@ -1,67 +1,44 @@
 terminal 92x32 buffer=normal length=32 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=26 bufferRow=26
+cursor hidden column=1 viewportRow=17 bufferRow=17
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-91 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                         │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 91-91 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                    │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 91-91 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                       │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 91-91 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-91 fg=bright-blue
-5| <blank>
-6| " Keyboard shortcuts                                                                         "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| " Keyboard shortcuts                                                                         "
   style 1-18 fg=bright-blue bold
-7| " Enter send • Shift/Alt+Enter newline • Up/Down prompt history                              "
+5| " Enter send • Shift/Alt+Enter newline • Up/Down prompt history                              "
   style 1-61 fg=bright-black
-8| " Esc cancel active turn • Ctrl+O toggle tool cards • Ctrl+R toggle reasoning                "
+6| " Esc cancel active turn • Ctrl+O expand tool cards • Ctrl+R toggle reasoning                "
   style 1-75 fg=bright-black
-9| " Ctrl+C cancel while running; clear input or exit while idle • Ctrl+D exit                  "
+7| " Ctrl+C cancel while running; clear input or exit while idle • Ctrl+D exit                  "
   style 1-73 fg=bright-black
-10| "                                                                                            "
-11| " /cancel — Cancel the active turn                                                           "
-  style 1-32 fg=bright-black
-12| " /clear — Clear the transcript view (session history is unchanged)                          "
-  style 1-65 fg=bright-black
-13| " /exit — Exit after the active turn reaches idle                                            "
-  style 1-47 fg=bright-black
-14| " /help — Show keyboard shortcuts and commands                                               "
-  style 1-44 fg=bright-black
-15| " /model [[provider/]model] — Show or switch this session's model                            "
+8| " /help /clear /reasoning /tools /redraw /reload /resume /exit                               "
+  style 1-60 fg=bright-black
+9| " /skill:<name> [instructions] load a skill into the conversation                            "
   style 1-63 fg=bright-black
-16| " /reasoning — Toggle reasoning blocks                                                       "
-  style 1-36 fg=bright-black
-17| " /redraw — Invalidate components and redraw the terminal                                    "
-  style 1-55 fg=bright-black
-18| " /tools — Expand or collapse all tool cards                                                 "
-  style 1-42 fg=bright-black
-19| <blank>
-20| " provider stream failed after partial output                                                "
+10| <blank>
+11| " Unknown command: /unknown-advanced-command                                                 "
+  style 1-42 fg=yellow
+12| <blank>
+13| " provider stream failed after partial output                                                "
   style 1-43 fg=red
-21| <blank>
-22| " The previous process ended during this turn.                                               "
+14| <blank>
+15| " The previous process ended during this turn.                                               "
   style 1-44 fg=yellow
-23| <blank>
-24| " Unknown command: /unknown-advanced-command                                                 "
-  style 1-42 fg=yellow
-25| "────────────────────────────────────────────────────────────────────────────────────────────"
+16| "────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-91 dim
-26| "                                                                                            "
+17| "                                                                                            "
   style 1-1 inverse
-27| "────────────────────────────────────────────────────────────────────────────────────────────"
+18| "────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-91 dim
-28| "/workspace/project  ↑0 ↓0         0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 34-91 dim
-29-31| <blank>
+19| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                 tools:collapsed"
+  style 0-43 dim
+  style 77-91 dim
+20-31| <blank>

+ 57 - 43
packages/ui/tui/tests/snapshots/question-dialog-validation.expected.txt

@@ -1,47 +1,61 @@
 terminal 56x20 buffer=normal length=20 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=56 viewportRow=17 bufferRow=17
+cursor hidden column=56 viewportRow=13 bufferRow=13
 viewport
-0| "╭──────────────────────────────────────────────────────╮"
-  style 0-55 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                     │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 55-55 fg=bright-blue
-2| "│ Snapshot agent ready.                                │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 55-55 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                   │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 55-55 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────╯"
-  style 0-55 fg=bright-blue
-5| "                                                        "
-6| "  Question 1/3 (3 unanswered) · Coverage                "
-  style 2-39 fg=bright-black
-7| "  Which advanced TUI states belong in the required      "
-8| "  matrix?                                               "
-9| "                                                        "
-10| "  › 1. [ ] Code Mode     run_code programs and capture  "
-  style 2-19 fg=bright-blue bold
-  style 25-53 fg=bright-black
-11| "    2. [ ] Workflows     phases and parallel agents     "
-  style 25-50 fg=bright-black
-12| "    3. [ ] Cordis tools  inspect, mount, and unmount    "
-  style 25-51 fg=bright-black
-13| "  1/4                                                   "
-  style 2-4 dim
-14| "  Tab custom answer • ↑/↓ navigate • Space toggle •     "
-  style 2-55 dim
-15| "  Enter submit • Esc interrupt                          "
-  style 2-29 dim
-16| "  Select at least one option, or press Tab for a        "
-  style 2-55 fg=red
-17| "  custom answer.                                        "
-  style 2-15 fg=red
-18| "                                                        "
-19| <blank>
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| "────────────────────────────────────────────────────────"
+  style 0-55 dim
+4| "    ╭ Coverage ────────────────────────────────────╮    "
+  style 1-1 inverse
+  style 4-51 fg=bright-blue
+5| "────│ Which advanced TUI states belong in the      │────"
+  style 0-3 dim
+  style 4-4 fg=bright-blue
+  style 6-50 bold
+  style 51-51 fg=bright-blue bold
+  style 52-55 dim
+6| "deep│ required matrix?                             │coll"
+  style 0-3 dim
+  style 4-4 fg=bright-blue
+  style 6-21 bold
+  style 51-51 fg=bright-blue
+  style 52-55 dim
+7| "    │                                              │    "
+  style 4-4 fg=bright-blue
+  style 51-51 fg=bright-blue
+8| "    │ › [ ] Code Mode — run_code programs and capt │    "
+  style 4-4 fg=bright-blue
+  style 6-6 fg=bright-blue inverse
+  style 7-20 inverse
+  style 21-49 fg=bright-black inverse
+  style 51-51 fg=bright-blue
+9| "    │   [ ] Workflows — phases and parallel agents │    "
+  style 4-4 fg=bright-blue
+  style 21-49 fg=bright-black
+  style 51-51 fg=bright-blue
+10| "    │   [ ] Cordis tools — inspect, mount, and unm │    "
+  style 4-4 fg=bright-blue
+  style 24-49 fg=bright-black
+  style 51-51 fg=bright-blue
+11| "    │ 1/4                                          │    "
+  style 4-4 fg=bright-blue
+  style 6-8 dim
+  style 51-51 fg=bright-blue
+12| "    │ ↑↓ navigate • Space toggle • Enter submit •  │    "
+  style 4-4 fg=bright-blue
+  style 6-49 dim
+  style 51-51 fg=bright-blue
+13| "    │ Select at least one option, or press C for a │    "
+  style 4-4 fg=bright-blue
+  style 6-49 fg=red
+  style 51-51 fg=bright-blue
+14| "    ╰──────────────────────────────────────────────╯    "
+  style 4-51 fg=bright-blue
+15-19| <blank>

+ 51 - 40
packages/ui/tui/tests/snapshots/question-dialog.expected.txt

@@ -3,45 +3,56 @@ lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
 cursor hidden column=0 viewportRow=19 bufferRow=19
 viewport
-0| "╭──────────────────────────────────────────────────────╮"
-  style 0-55 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                     │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 55-55 fg=bright-blue
-2| "│ Snapshot agent ready.                                │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 55-55 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                   │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 55-55 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────╯"
-  style 0-55 fg=bright-blue
-5| "────────────────────────────────────────────────────────"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| "────────────────────────────────────────────────────────"
   style 0-55 dim
-6| "                                                        "
+4| "                                                        "
   style 1-1 inverse
-7| "                                                        "
-8| "  Question 1/3 (3 unanswered) · Coverage                "
-  style 2-39 fg=bright-black
-9| "  Which advanced TUI states belong in the required      "
-10| "  matrix?                                               "
-11| "                                                        "
-12| "  › 1. [ ] Code Mode     run_code programs and capture  "
-  style 2-19 fg=bright-blue bold
-  style 25-53 fg=bright-black
-13| "    2. [ ] Workflows     phases and parallel agents     "
-  style 25-50 fg=bright-black
-14| "    3. [ ] Cordis tools  inspect, mount, and unmount    "
-  style 25-51 fg=bright-black
-15| "  1/4                                                   "
-  style 2-4 dim
-16| "  Tab custom answer • ↑/↓ navigate • Space toggle •     "
-  style 2-55 dim
-17| "  Enter submit • Esc interrupt                          "
-  style 2-29 dim
-18| "                                                        "
-19| <blank>
+5| "────╭ Coverage ────────────────────────────────────╮────"
+  style 0-3 dim
+  style 4-51 fg=bright-blue
+  style 52-55 dim
+6| "deep│ Which advanced TUI states belong in the      │coll"
+  style 0-3 dim
+  style 4-4 fg=bright-blue
+  style 6-50 bold
+  style 51-51 fg=bright-blue bold
+  style 52-55 dim
+7| "    │ required matrix?                             │    "
+  style 4-4 fg=bright-blue
+  style 6-21 bold
+  style 51-51 fg=bright-blue
+8| "    │                                              │    "
+  style 4-4 fg=bright-blue
+  style 51-51 fg=bright-blue
+9| "    │ › [ ] Code Mode — run_code programs and capt │    "
+  style 4-4 fg=bright-blue
+  style 6-6 fg=bright-blue inverse
+  style 7-20 inverse
+  style 21-49 fg=bright-black inverse
+  style 51-51 fg=bright-blue
+10| "    │   [ ] Workflows — phases and parallel agents │    "
+  style 4-4 fg=bright-blue
+  style 21-49 fg=bright-black
+  style 51-51 fg=bright-blue
+11| "    │   [ ] Cordis tools — inspect, mount, and unm │    "
+  style 4-4 fg=bright-blue
+  style 24-49 fg=bright-black
+  style 51-51 fg=bright-blue
+12| "    │ 1/4                                          │    "
+  style 4-4 fg=bright-blue
+  style 6-8 dim
+  style 51-51 fg=bright-blue
+13| "    │ ↑↓ navigate • Space toggle • Enter submit •  │    "
+  style 4-4 fg=bright-blue
+  style 6-49 dim
+  style 51-51 fg=bright-blue
+14| "    ╰──────────────────────────────────────────────╯    "
+  style 4-51 fg=bright-blue
+15-19| <blank>

+ 19 - 29
packages/ui/tui/tests/snapshots/surface-after-compaction-narrow.expected.txt

@@ -1,40 +1,30 @@
 terminal 44x18 buffer=normal length=18 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=11 bufferRow=11
+cursor hidden column=1 viewportRow=9 bufferRow=9
 buffer
-0| "╭──────────────────────────────────────────╮"
-  style 0-43 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                         │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 43-43 fg=bright-blue
-2| "│ Snapshot agent ready.                    │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 43-43 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session       │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 43-43 fg=bright-blue
-4| "╰──────────────────────────────────────────╯"
-  style 0-43 fg=bright-blue
-5| <blank>
-6| " Context · compact                          "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| " Context · compact                          "
   style 1-17 dim
-7| " Compacted summary: the prior command       "
+5| " Compacted summary: the prior command       "
   style 1-43 fg=bright-black
-8| " completed and its details were retired     "
+6| " completed and its details were retired     "
   style 1-43 fg=bright-black
-9| " from the active surface.                   "
+7| " from the active surface.                   "
   style 1-24 fg=bright-black
-10| "────────────────────────────────────────────"
+8| "────────────────────────────────────────────"
   style 0-43 dim
-11| "                                            "
+9| "                                            "
   style 1-1 inverse
-12| "────────────────────────────────────────────"
+10| "────────────────────────────────────────────"
+  style 0-43 dim
+11| "deepseek-v4-flash  /workspace/project  ↑0 ↓0"
   style 0-43 dim
-13| " 0% context  deepseek-v4-flash(reasoning:on)"
-  style 1-43 dim
-14-17| <blank>
+12-17| <blank>

+ 18 - 28
packages/ui/tui/tests/snapshots/surface-after-compaction-wide.expected.txt

@@ -1,37 +1,27 @@
 terminal 104x30 buffer=normal length=30 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=9 bufferRow=9
+cursor hidden column=1 viewportRow=7 bufferRow=7
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-103 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                     │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 103-103 fg=bright-blue
-2| "│ Snapshot agent ready.                                                                                │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 103-103 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                                   │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 103-103 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-103 fg=bright-blue
-5| <blank>
-6| " Context · compact                                                                                      "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| " Context · compact                                                                                      "
   style 1-17 dim
-7| " Compacted summary: the prior command completed and its details were retired from the active surface.   "
+5| " Compacted summary: the prior command completed and its details were retired from the active surface.   "
   style 1-100 fg=bright-black
-8| "────────────────────────────────────────────────────────────────────────────────────────────────────────"
+6| "────────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-103 dim
-9| "                                                                                                        "
+7| "                                                                                                        "
   style 1-1 inverse
-10| "────────────────────────────────────────────────────────────────────────────────────────────────────────"
+8| "────────────────────────────────────────────────────────────────────────────────────────────────────────"
   style 0-103 dim
-11| "/workspace/project  ↑0 ↓0                     0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 46-103 dim
-12-29| <blank>
+9| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                             tools:collapsed"
+  style 0-43 dim
+  style 89-103 dim
+10-29| <blank>

+ 32 - 42
packages/ui/tui/tests/snapshots/surface-before-compaction.expected.txt

@@ -1,68 +1,58 @@
-terminal 80x24 buffer=normal length=25 base=1 viewport=1
+terminal 80x24 buffer=normal length=24 base=0 viewport=0
 lifecycle started=1 stopped=0 progress=inactive
 title "DSH snapshot"
-cursor hidden column=1 viewportRow=21 bufferRow=22
+cursor hidden column=1 viewportRow=20 bufferRow=20
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────╮"
-  style 0-79 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                             │"
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Snapshot agent ready."
+  style 1-21 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 79-79 fg=bright-blue
-2| "│ Snapshot agent ready.                                                        │"
-  style 0-0 fg=bright-blue
-  style 2-22 fg=bright-black
-  style 79-79 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                           │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 79-79 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────╯"
-  style 0-79 fg=bright-blue
-5| <blank>
-6| "▌ "
-  style 0-0 fg=bright-blue
-7| "▌ You                                                                           "
+5| "▌ You                                                                           "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Old prompt with a long line that exercises wrapping before compaction.        "
+6| "▌ Old prompt with a long line that exercises wrapping before compaction.        "
   style 0-0 fg=bright-blue
-9| "▌ "
+7| "▌ "
   style 0-0 fg=bright-blue
-10| <blank>
-11| "▌ "
+8| <blank>
+9| "▌ "
   style 0-0 fg=green
-12| "▌ ✓ pnpm run test:coverage                                                      "
+10| "▌ ✓ pnpm run test:coverage                                                      "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-25 bold
-13| "▌ Run the coverage gate                                                         "
+11| "▌ Run the coverage gate                                                         "
   style 0-0 fg=green
   style 2-22 fg=bright-black
-14| "▌ /workspace/project                                                            "
+12| "▌ /workspace/project                                                            "
   style 0-0 fg=green
   style 2-19 dim
-15| "▌ packages/ui/tui 100%                                                          "
+13| "▌ packages/ui/tui 100%                                                          "
   style 0-0 fg=green
-16| "▌ … +1 lines (Ctrl+O to expand)                                                 "
+14| "▌ 4016 tests passed                                                             "
   style 0-0 fg=green
-  style 2-30 dim
-17| "▌ 1 test skipped                                                                "
+15| "▌ 1 test skipped                                                                "
   style 0-0 fg=green
-18| "▌ coverage complete                                                             "
+16| "▌ coverage complete                                                             "
   style 0-0 fg=green
-19| "▌ [exit 0]                                                                      "
+17| "▌ [exit 0]                                                                      "
   style 0-0 fg=green
   style 2-9 dim
-20| "▌ "
+18| "▌ "
   style 0-0 fg=green
-21| "────────────────────────────────────────────────────────────────────────────────"
+19| "────────────────────────────────────────────────────────────────────────────────"
   style 0-79 dim
-22| "                                                                                "
+20| "                                                                                "
   style 1-1 inverse
-23| "────────────────────────────────────────────────────────────────────────────────"
+21| "────────────────────────────────────────────────────────────────────────────────"
   style 0-79 dim
-24| "/workspace/pro  ↑0 ↓0 0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-13 dim
-  style 22-79 dim
+22| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                     tools:collapsed"
+  style 0-43 dim
+  style 65-79 dim
+23| <blank>

+ 69 - 60
packages/ui/tui/tests/snapshots/untrusted-controls.expected.txt

@@ -1,87 +1,96 @@
-terminal 100x34 buffer=normal length=40 base=6 viewport=6
+terminal 100x34 buffer=normal length=38 base=4 viewport=4
 lifecycle started=1 stopped=0 progress=inactive
 title "Unsafe terminal title \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m"
-cursor hidden column=100 viewportRow=33 bufferRow=39
+cursor hidden column=100 viewportRow=33 bufferRow=37
 buffer
-0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
-  style 0-99 fg=bright-blue
-1| "│ DEEPSEEK HARNESS                                                                                 │"
-  style 0-0 fg=bright-blue
-  style 2-9 fg=bright-blue bold
-  style 11-17 bold
-  style 99-99 fg=bright-blue
-2| "│ Unsafe welcome \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                     │"
-  style 0-0 fg=bright-blue
-  style 2-61 fg=bright-black
-  style 99-99 fg=bright-blue
-3| "│ deepseek-v4-flash  •  main-session                                                               │"
-  style 0-0 fg=bright-blue
-  style 2-35 dim
-  style 99-99 fg=bright-blue
-4| "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
-  style 0-99 fg=bright-blue
-5| <blank>
-6| "▌ "
+0| " DEEPSEEK HARNESS"
+  style 1-8 fg=bright-blue bold
+  style 10-16 bold
+1| " Unsafe welcome \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m"
+  style 1-60 fg=bright-black
+2| " deepseek-v4-flash  •  main-session"
+  style 1-34 dim
+3| <blank>
+4| "▌ "
   style 0-0 fg=bright-blue
-7| "▌ You                                                                                               "
+5| "▌ You                                                                                               "
   style 0-0 fg=bright-blue
   style 2-4 fg=bright-blue bold
-8| "▌ Unsafe user \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                         "
+6| "▌ Unsafe user \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                         "
   style 0-0 fg=bright-blue
-9| "▌ "
+7| "▌ "
   style 0-0 fg=bright-blue
-10| <blank>
-11| " Reasoning                                                                                          "
+8| <blank>
+9| " Reasoning                                                                                          "
   style 1-9 fg=bright-black italic
-12| " Unsafe reasoning \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                     "
+10| " Unsafe reasoning \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                     "
   style 1-62 fg=bright-black italic
-13| <blank>
-14| " Assistant                                                                                          "
+11| <blank>
+12| " Assistant                                                                                          "
   style 1-9 fg=bright-magenta bold
-15| " Unsafe assistant \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                     "
-16| <blank>
-17| "▌ "
+13| " Unsafe assistant \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                     "
+14| <blank>
+15| "▌ "
   style 0-0 fg=green
-18| "▌ ✓ Unsafe title \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                      "
+16| "▌ ✓ Unsafe title \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                      "
   style 0-0 fg=green
   style 2-2 fg=green bold
   style 3-61 bold
-19| "▌ Unsafe description \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                  "
+17| "▌ Unsafe description \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                  "
   style 0-0 fg=green
   style 2-65 fg=bright-black
-20| "▌ /unsafe/\\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                             "
+18| "▌ /unsafe/\\x1b╭ Unsafe header \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m ─────────╮              "
   style 0-0 fg=green
-  style 2-54 dim
-21| "▌ Unsafe output \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                       "
+  style 2-13 dim
+  style 14-85 fg=bright-blue
+19| "▌ Unsafe outpu│ Unsafe question \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m        │              "
   style 0-0 fg=green
-22| "▌ [signal SIG\\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m]                                         "
+  style 14-14 fg=bright-blue
+  style 16-76 bold
+  style 85-85 fg=bright-blue
+20| "▌ [signal SIG\\│                                                                      │              "
   style 0-0 fg=green
-  style 2-58 fg=red
-23| "▌ "
+  style 2-13 fg=red
+  style 14-14 fg=bright-blue
+  style 85-85 fg=bright-blue
+21| "▌             │ › ● Unsafe option \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m — Un │              "
   style 0-0 fg=green
-24| <blank>
-25| " Context · unsafe-\\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                     "
-  style 1-62 dim
-26| " Unsafe context \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                       "
+  style 14-14 fg=bright-blue
+  style 16-16 fg=bright-blue inverse
+  style 17-17 inverse
+  style 18-18 fg=bright-blue inverse
+  style 19-78 inverse
+  style 79-83 fg=bright-black inverse
+  style 85-85 fg=bright-blue
+22| "              │ ↑↓ navigate • Enter select • C custom • Esc cancel                   │              "
+  style 14-14 fg=bright-blue
+  style 16-65 dim
+  style 85-85 fg=bright-blue
+23| " Context · uns╰──────────────────────────────────────────────────────────────────────╯              "
+  style 1-13 dim
+  style 14-85 fg=bright-blue
+24| " Unsafe context \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                       "
   style 1-60 fg=bright-black
-27| <blank>
-28| " Prompt blocked: Unsafe policy \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                        "
+25| <blank>
+26| " Prompt blocked: Unsafe policy \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                        "
   style 1-75 fg=yellow
+27| <blank>
+28| " Unsafe turn error \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                    "
+  style 1-63 fg=red
 29| <blank>
-30| " Unsafe turn error \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                    "
+30| " Unsafe live error \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                    "
   style 1-63 fg=red
 31| <blank>
-32| "                                                                                                    "
-33| "  Question 1/1 (1 unanswered) · Unsafe header \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m         "
-  style 2-90 fg=bright-black
-34| "  Unsafe question \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m                                     "
+32| "Plan"
+  style 0-3 fg=bright-blue bold
+33| "  ● Unsafe todo \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m"
+  style 2-2 fg=yellow
+34| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+  style 0-99 dim
 35| "                                                                                                    "
-36| "  › 1. Unsafe option \\x1b]2;snapshot-controlled\\x07\\x09\\x7f\\x9b31m Unsafe detail \\x1b]2;snapshot-c  "
-  style 2-65 fg=bright-blue bold
-  style 67-97 fg=bright-black
-37| "  Tab custom answer • ↑/↓ navigate • Enter submit • Esc interrupt                                   "
-  style 2-64 dim
-38| "                                                                                                    "
-39| "/workspace/project  ↑0 ↓0                 0% context  tools:compact  deepseek-v4-flash(reasoning:on)"
-  style 0-24 dim
-  style 42-99 dim
+  style 1-1 inverse
+36| "────────────────────────────────────────────────────────────────────────────────────────────────────"
+  style 0-99 dim
+37| "deepseek-v4-flash  /workspace/project  ↑0 ↓0                                         tools:collapsed"
+  style 0-43 dim
+  style 85-99 dim