test(tui): stabilize snapshot workspace width
This commit is contained in:
@@ -67,6 +67,7 @@ buffer
|
|||||||
style 1-1 inverse
|
style 1-1 inverse
|
||||||
28| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
28| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
style 0-99 dim
|
style 0-99 dim
|
||||||
29| "/workspace/project ↑3.0k ↓"
|
29| "/workspace/project ↑3.0k ↓115 idle reasoning:on tools:compact"
|
||||||
style 0-99 dim
|
style 0-58 dim
|
||||||
|
style 67-99 dim
|
||||||
30-35| <blank>
|
30-35| <blank>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ buffer
|
|||||||
style 1-1 inverse
|
style 1-1 inverse
|
||||||
30| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
30| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
style 0-99 dim
|
style 0-99 dim
|
||||||
31| "/workspace/project ↑3.1k ↓158 idle"
|
31| "/workspace/project ↑3.1k ↓158 idle reasoning:on tools:compact"
|
||||||
style 0-93 dim
|
style 0-49 dim
|
||||||
style 96-99 dim
|
style 67-99 dim
|
||||||
32-35| <blank>
|
32-35| <blank>
|
||||||
|
|||||||
@@ -111,5 +111,6 @@ buffer
|
|||||||
style 1-1 inverse
|
style 1-1 inverse
|
||||||
48| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
48| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
style 0-99 dim
|
style 0-99 dim
|
||||||
49| "/workspace/project ↑"
|
49| "/workspace/project ↑18 ↓18 idle reasoning:on tools:compact"
|
||||||
style 0-99 dim
|
style 0-61 dim
|
||||||
|
style 67-99 dim
|
||||||
|
|||||||
@@ -101,5 +101,6 @@ buffer
|
|||||||
style 1-1 inverse
|
style 1-1 inverse
|
||||||
45| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
45| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
style 0-99 dim
|
style 0-99 dim
|
||||||
46| "/workspace/project ↑3.5k ↓22"
|
46| "/workspace/project ↑3.5k ↓227 idle reasoning:on tools:compact"
|
||||||
style 0-99 dim
|
style 0-56 dim
|
||||||
|
style 67-99 dim
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ buffer
|
|||||||
style 1-1 inverse
|
style 1-1 inverse
|
||||||
29| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
29| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
style 0-99 dim
|
style 0-99 dim
|
||||||
30| "/workspace/project ↑2"
|
30| "/workspace/project ↑2.9k ↓41 idle reasoning:on tools:compact"
|
||||||
style 0-99 dim
|
style 0-62 dim
|
||||||
|
style 67-99 dim
|
||||||
31-35| <blank>
|
31-35| <blank>
|
||||||
|
|||||||
@@ -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
|
lifecycle started=1 stopped=0 progress=inactive
|
||||||
title "DSH TUI snapshot"
|
title "DSH TUI snapshot"
|
||||||
cursor hidden column=1 viewportRow=33 bufferRow=38
|
cursor hidden column=1 viewportRow=33 bufferRow=36
|
||||||
buffer
|
buffer
|
||||||
0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
|
0| "╭──────────────────────────────────────────────────────────────────────────────────────────────────╮"
|
||||||
style 0-99 fg=bright-blue
|
style 0-99 fg=bright-blue
|
||||||
@@ -37,58 +37,55 @@ buffer
|
|||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
style 2-2 fg=green bold
|
style 2-2 fg=green bold
|
||||||
style 3-13 bold
|
style 3-13 bold
|
||||||
13| "▌ <path>/workspace/project"
|
13| "▌ <path>/workspace/project/a.txt</path> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
14| "▌ /a.txt</path> "
|
14| "▌ <type>file</type> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
15| "▌ <type>file</type> "
|
15| "▌ <content> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
16| "▌ <content> "
|
16| "▌ 1: alpha "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
17| "▌ 1: alpha "
|
17| "▌ "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
18| "▌ "
|
18| "▌ (End of file - total 1 lines) "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
19| "▌ (End of file - total 1 lines) "
|
19| "▌ </content> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
20| "▌ </content> "
|
20| "▌ "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
21| "▌ "
|
21| <blank>
|
||||||
|
22| "▌ "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
22| <blank>
|
23| "▌ ✓ Read b.txt "
|
||||||
23| "▌ "
|
|
||||||
style 0-0 fg=green
|
|
||||||
24| "▌ ✓ Read b.txt "
|
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
style 2-2 fg=green bold
|
style 2-2 fg=green bold
|
||||||
style 3-13 bold
|
style 3-13 bold
|
||||||
25| "▌ <path>/workspace/project"
|
24| "▌ <path>/workspace/project/b.txt</path> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
26| "▌ /b.txt</path> "
|
25| "▌ <type>file</type> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
27| "▌ <type>file</type> "
|
26| "▌ <content> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
28| "▌ <content> "
|
27| "▌ 1: beta "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
29| "▌ 1: beta "
|
28| "▌ "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
30| "▌ "
|
29| "▌ (End of file - total 1 lines) "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
31| "▌ (End of file - total 1 lines) "
|
30| "▌ </content> "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
32| "▌ </content> "
|
31| "▌ "
|
||||||
style 0-0 fg=green
|
style 0-0 fg=green
|
||||||
33| "▌ "
|
32| <blank>
|
||||||
style 0-0 fg=green
|
33| " Assistant "
|
||||||
34| <blank>
|
|
||||||
35| " Assistant "
|
|
||||||
style 1-9 fg=bright-magenta bold
|
style 1-9 fg=bright-magenta bold
|
||||||
36| " DONE "
|
34| " DONE "
|
||||||
|
35| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
|
style 0-99 dim
|
||||||
|
36| " "
|
||||||
|
style 1-1 inverse
|
||||||
37| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
37| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
style 0-99 dim
|
style 0-99 dim
|
||||||
38| " "
|
38| "/workspace/project ↑20 ↓6 idle reasoning:on tools:compact"
|
||||||
style 1-1 inverse
|
style 0-55 dim
|
||||||
39| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
style 67-99 dim
|
||||||
style 0-99 dim
|
|
||||||
40| "/workspace/project ↑20 ↓6"
|
|
||||||
style 0-99 dim
|
|
||||||
|
|||||||
@@ -76,6 +76,6 @@ buffer
|
|||||||
style 1-1 inverse
|
style 1-1 inverse
|
||||||
34| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
34| "────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||||
style 0-99 dim
|
style 0-99 dim
|
||||||
35| "/workspace/project ↑3.1k ↓145 idle"
|
35| "/workspace/project ↑3.1k ↓145 idle reasoning:on tools:compact"
|
||||||
style 0-93 dim
|
style 0-49 dim
|
||||||
style 96-99 dim
|
style 67-99 dim
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import WorkerWorkflowEngine from '@deepseek-ai/dsh-workflow-workerthread'
|
|||||||
import { HeadlessTerminal } from '../../../packages/ui/tui/tests/headless-terminal.ts'
|
import { HeadlessTerminal } from '../../../packages/ui/tui/tests/headless-terminal.ts'
|
||||||
|
|
||||||
const SNAPSHOTS_DIR = join(dirname(fileURLToPath(import.meta.url)), 'snapshots')
|
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 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
|
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<ScenarioResult> {
|
|||||||
const prompts = userPrompts(fixture)
|
const prompts = userPrompts(fixture)
|
||||||
expect(prompts.length, `${scenario.name} must carry at least one recorded user prompt`).toBeGreaterThan(0)
|
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 ctx: Context | undefined
|
||||||
let controller: ReturnType<typeof createTuiChat> | undefined
|
let controller: ReturnType<typeof createTuiChat> | undefined
|
||||||
const terminal = new HeadlessTerminal(100, 36)
|
const terminal = new HeadlessTerminal(100, 36)
|
||||||
|
|||||||
Reference in New Issue
Block a user