Skip to content

Fix console Enter/Tab completion to share separator rules - #175

Merged
amorfinv merged 3 commits into
mainfrom
fix/console-enter-tab-completion
Aug 9, 2026
Merged

Fix console Enter/Tab completion to share separator rules#175
amorfinv merged 3 commits into
mainfrom
fix/console-enter-tab-completion

Conversation

@amorfinv

@amorfinv amorfinv commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extract a shared replaceToken() helper in consoleTokens.ts (used by both ConsoleAutocomplete and Console, no behavior change)
  • Fix Console.ts so Enter routes through the same submitCurrent() 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)
  • Fix Tab completion to use the console's actual space-and-comma separator rules and complete the token under the cursor, instead of naively splitting on spaces and always completing the last word
  • Trim docs/gallery.md down to a single Swiss Alps screenshot (unrelated docs cleanup bundled from the working tree)

🤖 Generated with Claude Code

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.
@amorfinv
amorfinv merged commit 60d8de1 into main Aug 9, 2026
4 checks passed
@amorfinv
amorfinv deleted the fix/console-enter-tab-completion branch August 9, 2026 06:39
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