From 509304f9bbd64084ab7f30ddb831254c5ae286ca Mon Sep 17 00:00:00 2001 From: chengyongru Date: Tue, 29 Sep 2026 14:11:51 +0800 Subject: [PATCH] style(tui): simplify picker overflow indicator --- tui/src/app.test.ts | 4 ++-- tui/src/picker-menu.test.ts | 8 ++++---- tui/src/picker-menu.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tui/src/app.test.ts b/tui/src/app.test.ts index acb6a6dc8..81dd0d622 100644 --- a/tui/src/app.test.ts +++ b/tui/src/app.test.ts @@ -1503,13 +1503,13 @@ describe("NanobotTui layout", () => { await waitUntil(() => ui.runtimeControls.visible) await setup.flush() expect(ui.runtimeControls.menuRoot.getChildren()).toHaveLength(9) - expect(setup.captureCharFrame()).toContain("1–8 of 11 · ↓") + expect(setup.captureCharFrame()).toContain("1–8 of 11 ↓") expect(setup.captureCharFrame()).not.toContain("preset-8") for (let index = 0; index < 9; index += 1) setup.mockInput.pressArrow("down") await setup.flush() expect(setup.captureCharFrame()).toContain("› preset-8") - expect(setup.captureCharFrame()).toContain("3–10 of 11 · ↑↓") + expect(setup.captureCharFrame()).toContain("3–10 of 11 ↑↓") setup.mockInput.pressEnter() await waitUntil(() => sent.includes("/model preset-8")) diff --git a/tui/src/picker-menu.test.ts b/tui/src/picker-menu.test.ts index d3fafb5be..86a580489 100644 --- a/tui/src/picker-menu.test.ts +++ b/tui/src/picker-menu.test.ts @@ -42,7 +42,7 @@ describe("PickerMenu", () => { await setup.renderOnce() expect(menu.root.getChildren().filter((child) => child.id !== "test-picker-overflow")).toHaveLength(3) - expect(setup.captureCharFrame()).toContain("1–3 of 5 · ↓") + expect(setup.captureCharFrame()).toContain("1–3 of 5 ↓") expect(setup.captureCharFrame()).not.toContain("Choice 3") menu.move(1) @@ -50,7 +50,7 @@ describe("PickerMenu", () => { menu.move(1) await setup.flush() expect(menu.current()?.id).toBe("3") - expect(setup.captureCharFrame()).toContain("2–4 of 5 · ↑↓") + expect(setup.captureCharFrame()).toContain("2–4 of 5 ↑↓") expect(setup.captureCharFrame()).toContain("› Choice 3") expect(setup.captureCharFrame()).not.toContain("Choice 0") @@ -60,7 +60,7 @@ describe("PickerMenu", () => { menu.move(-1) await setup.flush() expect(menu.current()?.id).toBe("4") - expect(setup.captureCharFrame()).toContain("3–5 of 5 · ↑") + expect(setup.captureCharFrame()).toContain("3–5 of 5 ↑") const firstVisible = menu.root.getChildren()[0] as TextRenderable | undefined if (!firstVisible) throw new Error("picker row was not rendered") @@ -88,7 +88,7 @@ describe("PickerMenu", () => { await setup.renderOnce() expect(menu.current()?.id).toBe("d") expect(setup.captureCharFrame()).toContain("› Choice d") - expect(setup.captureCharFrame()).toContain("2–3 of 3 · ↑") + expect(setup.captureCharFrame()).toContain("2–3 of 3 ↑") menu.update("e", 2) await setup.flush() diff --git a/tui/src/picker-menu.ts b/tui/src/picker-menu.ts index 840fdb1f9..3652a578f 100644 --- a/tui/src/picker-menu.ts +++ b/tui/src/picker-menu.ts @@ -199,7 +199,7 @@ export class PickerMenu { const directions = `${this.windowStart > 0 ? "↑" : ""}${end < this.matches.length ? "↓" : ""}` this.root.add(new TextRenderable(this.renderer, { id: `${this.options.id}-overflow`, - content: ` ${this.windowStart + 1}–${end} of ${this.matches.length} · ${directions}`, + content: ` ${this.windowStart + 1}–${end} of ${this.matches.length} ${directions}`, width: "100%", height: 1, wrapMode: "none",