diff --git a/examples/tui-agent/tests/snapshots/bash-terminal-card/terminal.golden.txt b/examples/tui-agent/tests/snapshots/bash-terminal-card/terminal.golden.txt index 30770dcccb..ca123479dc 100644 --- a/examples/tui-agent/tests/snapshots/bash-terminal-card/terminal.golden.txt +++ b/examples/tui-agent/tests/snapshots/bash-terminal-card/terminal.golden.txt @@ -67,6 +67,7 @@ buffer style 1-1 inverse 28| "────────────────────────────────────────────────────────────────────────────────────────────────────" style 0-99 dim -29| "/workspace/project ↑3.0k ↓" - style 0-99 dim +29| "/workspace/project ↑3.0k ↓115 idle reasoning:on tools:compact" + style 0-58 dim + style 67-99 dim 30-35| diff --git a/examples/tui-agent/tests/snapshots/code-mode/terminal.golden.txt b/examples/tui-agent/tests/snapshots/code-mode/terminal.golden.txt index a7f1457d7a..428bdf80b4 100644 --- a/examples/tui-agent/tests/snapshots/code-mode/terminal.golden.txt +++ b/examples/tui-agent/tests/snapshots/code-mode/terminal.golden.txt @@ -73,7 +73,7 @@ buffer style 1-1 inverse 30| "────────────────────────────────────────────────────────────────────────────────────────────────────" style 0-99 dim -31| "/workspace/project ↑3.1k ↓158 idle" - style 0-93 dim - style 96-99 dim +31| "/workspace/project ↑3.1k ↓158 idle reasoning:on tools:compact" + style 0-49 dim + style 67-99 dim 32-35| diff --git a/examples/tui-agent/tests/snapshots/cordis-dynamic-toolchain/terminal.golden.txt b/examples/tui-agent/tests/snapshots/cordis-dynamic-toolchain/terminal.golden.txt index 5c5afc10ca..3359f54ca5 100644 --- a/examples/tui-agent/tests/snapshots/cordis-dynamic-toolchain/terminal.golden.txt +++ b/examples/tui-agent/tests/snapshots/cordis-dynamic-toolchain/terminal.golden.txt @@ -111,5 +111,6 @@ buffer style 1-1 inverse 48| "────────────────────────────────────────────────────────────────────────────────────────────────────" style 0-99 dim -49| "/workspace/project ↑" - style 0-99 dim +49| "/workspace/project ↑18 ↓18 idle reasoning:on tools:compact" + style 0-61 dim + style 67-99 dim diff --git a/examples/tui-agent/tests/snapshots/dynamic-workflow/terminal.golden.txt b/examples/tui-agent/tests/snapshots/dynamic-workflow/terminal.golden.txt index 8589ac94ea..1970a3761d 100644 --- a/examples/tui-agent/tests/snapshots/dynamic-workflow/terminal.golden.txt +++ b/examples/tui-agent/tests/snapshots/dynamic-workflow/terminal.golden.txt @@ -101,5 +101,6 @@ buffer style 1-1 inverse 45| "────────────────────────────────────────────────────────────────────────────────────────────────────" style 0-99 dim -46| "/workspace/project ↑3.5k ↓22" - style 0-99 dim +46| "/workspace/project ↑3.5k ↓227 idle reasoning:on tools:compact" + style 0-56 dim + style 67-99 dim diff --git a/examples/tui-agent/tests/snapshots/multi-turn-conversation/terminal.golden.txt b/examples/tui-agent/tests/snapshots/multi-turn-conversation/terminal.golden.txt index fca6c6dd4a..4c1f3b2c62 100644 --- a/examples/tui-agent/tests/snapshots/multi-turn-conversation/terminal.golden.txt +++ b/examples/tui-agent/tests/snapshots/multi-turn-conversation/terminal.golden.txt @@ -64,6 +64,7 @@ buffer style 1-1 inverse 29| "────────────────────────────────────────────────────────────────────────────────────────────────────" style 0-99 dim -30| "/workspace/project ↑2" - style 0-99 dim +30| "/workspace/project ↑2.9k ↓41 idle reasoning:on tools:compact" + style 0-62 dim + style 67-99 dim 31-35| diff --git a/examples/tui-agent/tests/snapshots/parallel-file-reads/terminal.golden.txt b/examples/tui-agent/tests/snapshots/parallel-file-reads/terminal.golden.txt index 7906694d0a..5fe973c177 100644 --- a/examples/tui-agent/tests/snapshots/parallel-file-reads/terminal.golden.txt +++ b/examples/tui-agent/tests/snapshots/parallel-file-reads/terminal.golden.txt @@ -1,7 +1,7 @@ -terminal 100x36 buffer=normal length=41 base=5 viewport=5 +terminal 100x36 buffer=normal length=39 base=3 viewport=3 lifecycle started=1 stopped=0 progress=inactive title "DSH TUI snapshot" -cursor hidden column=1 viewportRow=33 bufferRow=38 +cursor hidden column=1 viewportRow=33 bufferRow=36 buffer 0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮" style 0-99 fg=bright-blue @@ -37,58 +37,55 @@ buffer style 0-0 fg=green style 2-2 fg=green bold style 3-13 bold -13| "▌ /workspace/project" +13| "▌ /workspace/project/a.txt " style 0-0 fg=green -14| "▌ /a.txt " +14| "▌ file " style 0-0 fg=green -15| "▌ file " +15| "▌ " style 0-0 fg=green -16| "▌ " +16| "▌ 1: alpha " style 0-0 fg=green -17| "▌ 1: alpha " +17| "▌ " style 0-0 fg=green -18| "▌ " +18| "▌ (End of file - total 1 lines) " style 0-0 fg=green -19| "▌ (End of file - total 1 lines) " +19| "▌ " style 0-0 fg=green -20| "▌ " +20| "▌ " style 0-0 fg=green -21| "▌ " +21| +22| "▌ " style 0-0 fg=green -22| -23| "▌ " - style 0-0 fg=green -24| "▌ ✓ Read b.txt " +23| "▌ ✓ Read b.txt " style 0-0 fg=green style 2-2 fg=green bold style 3-13 bold -25| "▌ /workspace/project" +24| "▌ /workspace/project/b.txt " style 0-0 fg=green -26| "▌ /b.txt " +25| "▌ file " style 0-0 fg=green -27| "▌ file " +26| "▌ " style 0-0 fg=green -28| "▌ " +27| "▌ 1: beta " style 0-0 fg=green -29| "▌ 1: beta " +28| "▌ " style 0-0 fg=green -30| "▌ " +29| "▌ (End of file - total 1 lines) " style 0-0 fg=green -31| "▌ (End of file - total 1 lines) " +30| "▌ " style 0-0 fg=green -32| "▌ " +31| "▌ " style 0-0 fg=green -33| "▌ " - style 0-0 fg=green -34| -35| " Assistant " +32| +33| " Assistant " style 1-9 fg=bright-magenta bold -36| " DONE " +34| " DONE " +35| "────────────────────────────────────────────────────────────────────────────────────────────────────" + style 0-99 dim +36| " " + style 1-1 inverse 37| "────────────────────────────────────────────────────────────────────────────────────────────────────" style 0-99 dim -38| " " - style 1-1 inverse -39| "────────────────────────────────────────────────────────────────────────────────────────────────────" - style 0-99 dim -40| "/workspace/project ↑20 ↓6" - style 0-99 dim +38| "/workspace/project ↑20 ↓6 idle reasoning:on tools:compact" + style 0-55 dim + style 67-99 dim diff --git a/examples/tui-agent/tests/snapshots/todo-plan/terminal.golden.txt b/examples/tui-agent/tests/snapshots/todo-plan/terminal.golden.txt index 2d6520f067..278015e244 100644 --- a/examples/tui-agent/tests/snapshots/todo-plan/terminal.golden.txt +++ b/examples/tui-agent/tests/snapshots/todo-plan/terminal.golden.txt @@ -76,6 +76,6 @@ buffer style 1-1 inverse 34| "────────────────────────────────────────────────────────────────────────────────────────────────────" style 0-99 dim -35| "/workspace/project ↑3.1k ↓145 idle" - style 0-93 dim - style 96-99 dim +35| "/workspace/project ↑3.1k ↓145 idle reasoning:on tools:compact" + style 0-49 dim + style 67-99 dim diff --git a/examples/tui-agent/tests/tui.snapshot.ts b/examples/tui-agent/tests/tui.snapshot.ts index 453c587c2a..276c9c5f03 100644 --- a/examples/tui-agent/tests/tui.snapshot.ts +++ b/examples/tui-agent/tests/tui.snapshot.ts @@ -28,6 +28,8 @@ import WorkerWorkflowEngine from '@deepseek-ai/dsh-workflow-workerthread' import { HeadlessTerminal } from '../../../packages/ui/tui/tests/headless-terminal.ts' const SNAPSHOTS_DIR = join(dirname(fileURLToPath(import.meta.url)), 'snapshots') +// Keep pre-normalization layout widths identical across macOS and Linux. +const SNAPSHOT_TMP_ROOT = process.platform === 'win32' ? tmpdir() : '/tmp' const PROVIDERS = [{ id: 'deepseek', models: [{ id: 'deepseek-v4-flash' }] }] const UUID_RE = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi @@ -204,7 +206,7 @@ async function runScenario(scenario: Scenario): Promise { const prompts = userPrompts(fixture) expect(prompts.length, `${scenario.name} must carry at least one recorded user prompt`).toBeGreaterThan(0) - const cwd = await mkdtemp(join(tmpdir(), `dsh-tui-snapshot-${scenario.name}-`)) + const cwd = await mkdtemp(join(SNAPSHOT_TMP_ROOT, `dsh-tui-snapshot-${scenario.name}-`)) let ctx: Context | undefined let controller: ReturnType | undefined const terminal = new HeadlessTerminal(100, 36)