Feature: Add slash command autocomplete dropdown#196
Merged
PureWeen merged 6 commits intoPureWeen:mainfrom Feb 23, 2026
Merged
Conversation
Show a filterable dropdown of available slash commands when the user types '/' at the start of the chat input (both expanded textarea and card input). Follows the existing Fiesta @-mention autocomplete pattern with keyboard navigation (Arrow keys, Tab to select, Escape to dismiss). The dropdown opens above the input and filters as the user types. Add SlashCommandAutocompleteTests to verify the JS command list stays in sync with the C# HandleSlashCommand handler and /help output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix arrow key scrolling (use manual scrollTop instead of scrollIntoView) - Match font size to textarea (0.9rem) - Enter key selects command (not just Tab) - Auto-send parameterless commands on Enter - Show parameter usage hints (e.g. /mcp [show|add|...]) - Add inline ghost text preview for commands with parameters - Clear ghost text on send - Sort commands alphabetically - Performance: rAF debounce, DOM caching, skip redundant updates Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…utton - Don't intercept Enter/Tab in locked mode (user typing args) — fixes /rename Foo losing arguments when pressing Enter - Use per-element _lastSlashValue instead of global _lastValue — fixes autocomplete not appearing when two cards have the same input value - Add send-btn class to SessionCard's send button — fixes auto-send for parameterless commands in card view - Fix AutocompleteDropdown_OpensAboveInput test to scope to slash section - Add 3 regression tests for the above issues Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…le dropdown - chooseOption: find command boundary from full value, not cursor position - getSlashContext: use full value for locked mode detection - updateDropdownPosition: invalidate cache on textarea resize (offsetHeight) - updateDropdownPosition: flip below when no space above, no 120px min - Add focusout listener to hide dropdown on Tab-out - hideDropdown clears focusout timer to prevent race condition - Add box-sizing:border-box to dropdown for accurate maxHeight - Cancel rAF in no-args auto-send to prevent stale dropdown reopen - Dropdown mousedown preventDefault to keep focus during scrollbar use - clearElementValue hides slash dropdown after sending commands - /status changed to hasArgs:true (handler accepts args) - Help text test now checks both directions (autocomplete ⊆ help AND help ⊆ autocomplete) - 22 tests covering all review findings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Summary
Adds an autocomplete dropdown when typing
/in the chat input (expanded view and card view).Demo
Features
/help,/clear, etc.) send immediately on selection/mcpshows[show|add|edit|delete|disable|enable] [server-name] | reload)Files changed
PolyPilot/wwwroot/index.html— JS implementation (~297 lines)PolyPilot/Components/SessionCard.razor— added.send-btnclass for auto-sendPolyPilot.Tests/SlashCommandAutocompleteTests.cs— 22 tests cross-referencing JS commands against C# handlerPerformance