From 18d1dd453ae164effd9dcca1ae238104b89ce4d8 Mon Sep 17 00:00:00 2001 From: James Long Date: Thu, 15 Oct 2026 13:37:32 -0400 Subject: [PATCH] fix(tui): show remaining dialog hints label-first (#55745) --- packages/tui/src/component/dialog-highlights.tsx | 4 ++-- packages/tui/src/component/dialog-mcp.tsx | 6 +----- packages/tui/src/component/dialog-shell-output.tsx | 14 ++++++++------ packages/tui/test/cli/tui/dialog-mcp.test.tsx | 3 ++- .../tui/test/component/dialog-highlights.test.tsx | 4 ++-- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/tui/src/component/dialog-highlights.tsx b/packages/tui/src/component/dialog-highlights.tsx index 7c6765ee68e..c0ae0717981 100644 --- a/packages/tui/src/component/dialog-highlights.tsx +++ b/packages/tui/src/component/dialog-highlights.tsx @@ -5,7 +5,7 @@ import { useConfig } from "../config" import { Keymap } from "../context/keymap" import type { TuiHighlight } from "../context/runtime" import { useTheme } from "../context/theme" -import { DIALOG_INSET, DialogBleed, DialogHeader, DialogLayout, useDialog } from "../ui/dialog" +import { DIALOG_INSET, DialogBleed, DialogFooter, DialogHeader, DialogLayout, useDialog } from "../ui/dialog" import { getScrollAcceleration } from "../util/scroll" export function DialogHighlights(props: { version: string; items: ReadonlyArray }) { @@ -37,7 +37,7 @@ export function DialogHighlights(props: { version: string; items: ReadonlyArray< header={} footer={ - ↑/↓ scroll + - enter to view error - - } + footerHints={focusedError() ? [{ title: "view error", label: "enter" }] : []} /> } > diff --git a/packages/tui/src/component/dialog-shell-output.tsx b/packages/tui/src/component/dialog-shell-output.tsx index 04acd4374be..4616108202d 100644 --- a/packages/tui/src/component/dialog-shell-output.tsx +++ b/packages/tui/src/component/dialog-shell-output.tsx @@ -6,7 +6,7 @@ import stripAnsi from "strip-ansi" import { useClient } from "../context/client" import { Keymap } from "../context/keymap" import { useTheme } from "../context/theme" -import { DialogHeader, DialogLayout, useDialog } from "../ui/dialog" +import { DialogFooter, DialogHeader, DialogLayout, useDialog } from "../ui/dialog" const PAGE_BYTES = 64 * 1024 @@ -114,11 +114,13 @@ export function DialogShellOutput(props: { shell: ShellInfo; location: LocationR } footer={ - - ↑/↓ scroll - end follow - esc back - + } > diff --git a/packages/tui/test/cli/tui/dialog-mcp.test.tsx b/packages/tui/test/cli/tui/dialog-mcp.test.tsx index 3b603f72240..1bb343219d6 100644 --- a/packages/tui/test/cli/tui/dialog-mcp.test.tsx +++ b/packages/tui/test/cli/tui/dialog-mcp.test.tsx @@ -22,7 +22,7 @@ test.each(["enter", "space"])("starts OAuth with %s for an MCP server requiring try { await fixture.app.waitForFrame((frame) => frame.includes("Sign in required")) - expect(fixture.app.captureCharFrame()).not.toContain("enter to view error") + expect(fixture.app.captureCharFrame()).not.toContain("view error") if (key === "enter") fixture.app.mockInput.pressEnter() else fixture.app.mockInput.pressKey(" ") await fixture.app.waitForFrame((frame) => frame.includes("Waiting for authorization")) @@ -40,6 +40,7 @@ test("opens an investigation draft for a failed MCP server at its originating lo try { await fixture.app.waitForFrame((frame) => frame.includes("Failed !")) + expect(fixture.app.captureCharFrame()).toContain("view error enter") fixture.app.mockInput.pressEnter() await fixture.app.waitForFrame((frame) => frame.includes("investigate i")) fixture.app.mockInput.pressKey("i") diff --git a/packages/tui/test/component/dialog-highlights.test.tsx b/packages/tui/test/component/dialog-highlights.test.tsx index 6748e484303..6f3473ea4d2 100644 --- a/packages/tui/test/component/dialog-highlights.test.tsx +++ b/packages/tui/test/component/dialog-highlights.test.tsx @@ -50,7 +50,7 @@ test("scrolls long highlights between a fixed title and footer", async () => { await app.waitForFrame((frame) => frame.includes("What's new in 2.0.27") && frame.includes("Highlight 1")) const top = app.captureCharFrame() expect(top).toContain("command-1") - expect(top).toContain("↑/↓ scroll") + expect(top).toContain("scroll ↑/↓") expect(top).not.toContain("Highlight 5") expect(top).not.toContain("`") @@ -58,7 +58,7 @@ test("scrolls long highlights between a fixed title and footer", async () => { await app.waitForFrame((frame) => frame.includes("Highlight 5")) const bottom = app.captureCharFrame() expect(bottom).toContain("What's new in 2.0.27") - expect(bottom).toContain("↑/↓ scroll") + expect(bottom).toContain("scroll ↑/↓") expect(bottom).not.toContain("Highlight 1") app.mockInput.pressKey("k")