Skip to content

fix(web): font picker highlights and Enter-selects the first match after typing - #45

Merged
asfires merged 1 commit into
mainfrom
t3code/keyboard-font-search-selection
Aug 18, 2026
Merged

asfires merged 1 commit into
mainfrom
t3code/keyboard-font-search-selection

Conversation

@asfires

@asfires asfires commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Problem

Typing in any Settings > Appearance font picker (Interface, Prompt, Code, Terminal) did not visibly highlight the first match, up/down navigation misbehaved, hovering could show two highlighted rows, and Enter did nothing. The only way to apply a font was to click it with the mouse.

Root cause: @legendapp/list memoizes each row's rendered element on [itemKey, item, extraData] only. When the filter changes, a font that stays visible while its position shifts keeps a stale index prop. Base UI's combobox is index-keyed (highlight is activeIndex === index, Enter clicks listRef[activeIndex]), so it highlighted the wrong or an unmounted row and Enter clicked nothing.

Fix

  • Pass the full collection as items and the filtered list as filteredItems (same pattern as the branch selector and model picker).
  • Give LegendList the filtered list as extraData, so every filter change re-renders the visible rows with fresh indices. Base UI's own highlight, arrows, hover, and Enter path then work unchanged.

Verified in the web app: typing highlights the first match, up/down move a single highlight from the search input, Enter applies.

Note: BranchToolbarBranchSelector and ModelPickerContent have the same latent stale-index issue with their virtualized lists; left for a follow-up.

Claude Fable 5 via Claude Code (initial implementation by GPT-5.6 Sol via Codex CLI)

…ter typing

Typing in an Appearance font picker did not visibly highlight the first
match, arrows misbehaved, and Enter did nothing, so the only way to apply a
font was to click it. LegendList only re-renders a row when its item or
extraData changes, so a font that stayed visible while the filter shifted its
position kept a stale index. Base UI's combobox highlights and Enter-selects
by index, so it targeted the wrong or an unmounted row.

Pass the full collection as items and the filtered list as filteredItems, and
give LegendList the filtered list as extraData so every filter change
re-renders the visible rows with fresh indices. Base UI's own highlight,
arrow navigation, hover, and Enter path then work as-is.

Claude Fable 5 via Claude Code (initial implementation by GPT-5.6 Sol via Codex CLI)
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Aug 17, 2026
@asfires
asfires merged commit 214936e into main Aug 18, 2026
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant