fix(tui): use the base text color for the dialog search cursor (#62939)

This commit is contained in:
James Long
2026-11-09 12:56:13 -06:00
committed by GitHub
Unverified
parent 5fde43180d
commit 7ce50dde63
2 changed files with 4 additions and 9 deletions
+1 -6
View File
@@ -654,12 +654,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
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 = () => (
<input
@@ -378,7 +378,7 @@ test("dialog actions run without options while row actions still require a selec
}
})
test("matches the search cursor to the highlighted row until text is typed under new designs", async () => {
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()