From 7ce50dde63c7693d03bd06cf4006c3025f4a7734 Mon Sep 17 00:00:00 2001 From: James Long Date: Mon, 9 Nov 2026 12:56:13 -0600 Subject: [PATCH] fix(tui): use the base text color for the dialog search cursor (#62939) --- packages/tui/src/ui/dialog-select.tsx | 7 +------ packages/tui/test/cli/tui/dialog-select.test.tsx | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/tui/src/ui/dialog-select.tsx b/packages/tui/src/ui/dialog-select.tsx index 0599a7f83f1..f19b7ea0a97 100644 --- a/packages/tui/src/ui/dialog-select.tsx +++ b/packages/tui/src/ui/dialog-select.tsx @@ -654,12 +654,7 @@ export function DialogSelect(props: DialogSelectProps) { const searchInTitle = () => newDesigns() && props.searchInTitle === true && props.renderFilter !== false - // Terminals paint the glyph under a block cursor in their own color, so a near-white cursor hides the - // placeholder's first letter. Until the user types, match the highlighted row so that letter shows through. - const searchCursorColor = () => { - if (!newDesigns()) return theme.text.formfield.focused - return store.filter.length > 0 ? theme.text.base : theme.background.action.primary.focused - } + const searchCursorColor = () => (newDesigns() ? theme.text.base : theme.text.formfield.focused) const searchInput = () => ( { +test("uses the base text color for the search cursor under new designs", async () => { await using tmp = await tmpdir() const theme = resolveThemeDocument(getOpenCodeTheme(), "dark") const app = await renderSelect( @@ -392,10 +392,10 @@ test("matches the search cursor to the highlighted row until text is typed under try { await app.waitFor(() => app.renderer.getCursorState().visible) - expect(app.renderer.getCursorState().color.toInts()).toEqual(theme.background.action.primary.focused.toInts()) + expect(app.renderer.getCursorState().color.toInts()).toEqual(theme.text.base.toInts()) await app.mockInput.typeText("f") - await app.waitFor(() => app.renderer.getCursorState().color.equals(theme.text.base)) + await app.renderOnce() expect(app.renderer.getCursorState().color.toInts()).toEqual(theme.text.base.toInts()) } finally { app.renderer.destroy()