Fix console Enter/Tab completion to share separator rules - #175
Merged
Conversation
ConsoleAutocomplete's token-replacement logic (truncate to the token span, append a trailing space at end-of-input) is exactly what Console's Enter/Tab handling needs too. Pull it into a shared, tested helper instead of duplicating it.
Enter duplicated the Send button's submit logic inline and skipped its trailing-separator trim, so a command finished via the map picker (which appends a comma after every click) was sent with a dangling comma. Route Enter through the same submitCurrent() path as Send. Tab completion split on spaces only and always completed the last word, so it never matched the comma-separated form the console itself produces (e.g. "CRE KL123,A38"). Use getArgAtCursor()/replaceToken() so completion follows the same space-and-comma separator rules as the rest of the console, and completes the token under the cursor rather than assuming it's at the end of input.
Keep the Matterhorn shot as the representative example and drop the other seven Valais/Oberland/Léman entries added in #170.
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.
Summary
replaceToken()helper inconsoleTokens.ts(used by bothConsoleAutocompleteandConsole, no behavior change)Console.tsso Enter routes through the samesubmitCurrent()path as the Send button, instead of duplicating submit logic and skipping the trailing-separator trim (map-picker-built POLY commands were sent with a dangling comma)docs/gallery.mddown to a single Swiss Alps screenshot (unrelated docs cleanup bundled from the working tree)🤖 Generated with Claude Code