Skip to content

fix: autocomplete keyboard navigation and file names with spaces#22

Open
thegalloza wants to merge 1 commit into
Roasbeef:mainfrom
thegalloza:fix/autocomplete-keyboard-nav-and-spaces
Open

fix: autocomplete keyboard navigation and file names with spaces#22
thegalloza wants to merge 1 commit into
Roasbeef:mainfrom
thegalloza:fix/autocomplete-keyboard-nav-and-spaces

Conversation

@thegalloza

Copy link
Copy Markdown

Bug fixes

1. Arrow keys / Enter not working in autocomplete popup

AutocompletePopup.show() set this.visible = true before calling render(). But render() calls hide() internally to clear any existing popup — and hide() resets visible to false. So isVisible() always returned false while the popup was open.

ChatInput gates all keydown delegation on isVisible(), so arrow keys and Enter never reached the popup. Mouse clicks worked because they bypass that check entirely.

Fix: move this.visible = true to after render().

2. File names with spaces not matching @ mentions

checkForAutocomplete() returned early if any space appeared after @, which made it impossible to mention files like 2026-04 April Log.md. getFileSuggestions() uses .includes() and handles spaces correctly — the guard was unnecessary.

Fix: remove the space check.

Testing

  • Type @ in the chat input — arrow keys and Enter now navigate and
    select from the popup.
  • Type @2026-04 A (or any file with a space) — suggestions appear
    and can be selected.

NOTE: Fix was done via Claude.

AutocompletePopup.show() set this.visible = true before calling
render(), but render() calls hide() internally to clear any existing
popup. hide() resets visible to false, so isVisible() always returned
false while the popup was open. ChatInput checked isVisible() before
delegating keydown events, so arrow keys and Enter never reached the
popup.

Fix: move this.visible = true to after render().

Also removed the space guard in ChatInput.checkForAutocomplete() that
blocked @ mentions from matching file names containing spaces.
getFileSuggestions() uses includes() and handles spaces correctly —
the guard was unnecessary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant