From f168dfcc4ae08b9cc815954a3376ad54f167a061 Mon Sep 17 00:00:00 2001 From: sosidudku1 Date: Thu, 20 Aug 2026 04:09:24 +0300 Subject: [PATCH 1/2] test(tui): follow the breadcrumb and the block splash mark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #171 replaced the three-section pill row with a breadcrumb, and #151 made the splash mark a scaled block raster. Three test files still asserted the old surface, so seven tests failed on main against code that behaves correctly — the one behavioural assertion in the same file (Esc twice does not quit) passed throughout. - escape-observe-tabs / escape-import-tab: the section is now the left half of a crumb (`Observe > Feed`), so assert `Observe >` rather than `> Observe`, and `Run` rather than `> Run`. - tui-app smoke: the splash mark is drawn in block glyphs whose exact shape varies with the surface, so assert the rail the Run screen always carries. Tests only; no production code touched. Co-Authored-By: Claude Opus 5 --- src/tui/escape-import-tab.test.tsx | 4 ++-- src/tui/escape-observe-tabs.test.tsx | 4 ++-- src/tui/tui-app.test.tsx | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/tui/escape-import-tab.test.tsx b/src/tui/escape-import-tab.test.tsx index 2c6d0ef7..280e02cd 100644 --- a/src/tui/escape-import-tab.test.tsx +++ b/src/tui/escape-import-tab.test.tsx @@ -49,7 +49,7 @@ describe("Esc on the Import tab", () => { bus.emit({ type: "ui_mode_set", mode: "debug" }); bus.emit({ type: "tab_changed", tab: "import" }); await settle(); - expect(strip(lastFrame() ?? "")).toContain("▸ Manage"); + expect(strip(lastFrame() ?? "")).toContain("Manage ▸"); stdin.write(ESC); await settle(); @@ -57,7 +57,7 @@ describe("Esc on the Import tab", () => { // The configure-mode handler ends in a catch-all `return true` that // swallows stray letters; before the fix it swallowed Esc too, so the // operator was stuck on the tab with no "back" gesture at all. - expect(strip(lastFrame() ?? "")).toContain("▸ Run"); + expect(strip(lastFrame() ?? "")).toContain("Run"); expect(quit).toBe(0); unmount(); }); diff --git a/src/tui/escape-observe-tabs.test.tsx b/src/tui/escape-observe-tabs.test.tsx index ec7582a3..e54d496e 100644 --- a/src/tui/escape-observe-tabs.test.tsx +++ b/src/tui/escape-observe-tabs.test.tsx @@ -57,7 +57,7 @@ describe("Esc on the Observe tabs", () => { bus.emit({ type: "ui_mode_set", mode: "debug" }); bus.emit({ type: "tab_changed", tab }); await settle(); - expect(strip(lastFrame() ?? "")).toContain("▸ Observe"); + expect(strip(lastFrame() ?? "")).toContain("Observe ▸"); stdin.write(ESC); await settle(); @@ -67,7 +67,7 @@ describe("Esc on the Observe tabs", () => { // reached the still-focused chat editor and quit the process. expect(counts.quit).toBe(0); expect(counts.abort).toBe(0); - expect(strip(lastFrame() ?? "")).toContain("▸ Run"); + expect(strip(lastFrame() ?? "")).toContain("Run"); unmount(); }); } diff --git a/src/tui/tui-app.test.tsx b/src/tui/tui-app.test.tsx index 30994713..cb0ddd1e 100644 --- a/src/tui/tui-app.test.tsx +++ b/src/tui/tui-app.test.tsx @@ -65,11 +65,10 @@ describe("TuiApp (smoke)", () => { expect(text).toContain("Run"); expect(text).not.toContain("Observe"); expect(text).not.toContain("Manage"); - // The splash mark scales with the window; ink-testing-library's - // 100-column stdout reports no rows, so the fallback 80x24 surface - // gets the compact mark rather than the wordmark + tagline. Assert - // on what every size keeps. See `components/splash-fit.render.test.tsx`. - expect(text).toContain(":::"); + // The splash mark scales with the window and is drawn as a block + // raster, so its exact glyphs vary by size. Assert the rail the Run + // screen always carries instead. See `components/splash-fit.render.test.tsx`. + expect(text).toContain("Sessions"); expect(text).toContain("commands"); unmount(); }); From ff9280d022e0d9ff03814b8591f411ead52faef4 Mon Sep 17 00:00:00 2001 From: sosidudku1 <273119990+sosidudku1@users.noreply.github.com> Date: Thu, 20 Aug 2026 07:59:04 +0300 Subject: [PATCH 2/2] test(tui): fix the last two stale smoke expectations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shift+Tab from Run wraps to the LAST Manage sub-tab. That is privacy, not telegram — MANAGE_TABS gained import and privacy after the test was written. The marker matters: a bare "Privacy" also matches the inactive chip in the sub-tab strip, so the assertion carries the active marker. The two-mode LLM panel test asserted RouteCard chrome the panel deliberately drops. ink-testing-library reports no rows, so LlmPanel falls back to the 80x24 surface and picks its compact header — correct code never renders "Active chat route" at that budget. The full/compact split is owned by components/llm-panel.test.tsx, which drives maxRows directly; the smoke test now asserts the two-mode body every budget keeps. Both assertions were checked by ablation: they fail when the behaviour they describe is removed. --- src/tui/tui-app.test.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/tui/tui-app.test.tsx b/src/tui/tui-app.test.tsx index cb0ddd1e..f9b6907c 100644 --- a/src/tui/tui-app.test.tsx +++ b/src/tui/tui-app.test.tsx @@ -209,9 +209,13 @@ describe("TuiApp (smoke)", () => { stdin.write("\u001b[Z"); await new Promise((r) => setTimeout(r, 10)); const text = strip(lastFrame() ?? ""); - // Shift+Tab from Run wraps to the last Manage sub-tab (Telegram). + // Shift+Tab from Run wraps to the LAST Manage sub-tab. That is + // `privacy`, not `telegram` — see `MANAGE_TABS` in `section.ts`, which + // gained `import` and `privacy` after this test was written. expect(text).toContain("Manage \u25b8"); - expect(text).toContain("▸ Telegram"); + // `▸` marks the ACTIVE sub-tab. A bare "Privacy" would also match the + // inactive chip in the strip, so it must carry the marker. + expect(text).toContain("▸ Privacy"); unmount(); }); @@ -307,11 +311,14 @@ describe("TuiApp (smoke)", () => { bus.emit({ type: "tab_changed", tab: "llm" }); await new Promise((r) => setTimeout(r, 10)); const text = strip(lastFrame() ?? ""); - expect(text).toContain("Active chat route"); - expect(text).toContain("Mode:"); + // ink-testing-library reports no rows, so the panel falls back to the + // 80x24 surface and picks its COMPACT header — `RouteCard` ("Active + // chat route") is dropped on purpose at that budget. The full/compact + // decision is covered directly in `components/llm-panel.test.tsx`, + // which drives `maxRows`; here we assert the two-mode body that every + // budget keeps. expect(text).toContain("Local text models"); expect(text).toContain("Local embeddings"); - expect(text).toContain("Press ←/→ to switch mode"); expect(text).not.toContain("Local runtime"); unmount(); });