fix: autocomplete keyboard navigation and file names with spaces#22
Open
thegalloza wants to merge 1 commit into
Open
fix: autocomplete keyboard navigation and file names with spaces#22thegalloza wants to merge 1 commit into
thegalloza wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixes
1. Arrow keys / Enter not working in autocomplete popup
AutocompletePopup.show()setthis.visible = truebefore callingrender(). Butrender()callshide()internally to clear any existing popup — andhide()resetsvisibletofalse. SoisVisible()always returnedfalsewhile the popup was open.ChatInputgates all keydown delegation onisVisible(), so arrow keys and Enter never reached the popup. Mouse clicks worked because they bypass that check entirely.Fix: move
this.visible = trueto afterrender().2. File names with spaces not matching @ mentions
checkForAutocomplete()returned early if any space appeared after@, which made it impossible to mention files like2026-04 April Log.md.getFileSuggestions()uses.includes()and handles spaces correctly — the guard was unnecessary.Fix: remove the space check.
Testing
@in the chat input — arrow keys and Enter now navigate andselect from the popup.
@2026-04 A(or any file with a space) — suggestions appearand can be selected.
NOTE: Fix was done via Claude.