feat(slash): interactive slash-command picker - filtering, visible highlight, argument hints (LC-509) #476
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-509-slash-command-picker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Turns the composer's slash-command autocomplete into a polished Slack/Discord-style interactive picker, reusing the existing @mention combobox interaction model. Stack stays Askama + HTMX + Tailwind.
What changed
Live filtering + empty state. The server already prefix-filtered; now
visible_commandsalso matches a description keyword (e.g./actionsurfaces/me). A query that matches nothing renders a subtle "no matching commands" state instead of silently hiding (the list view now carries the typed query so the template can tell "nothing typed" from "typed, no match").Visible keyboard highlight. The highlighted option was ARIA-only (invisible) - arrow-key navigation gave no feedback. Added a shared
.lc-ac-optionrule where hover andaria-selectedshare onesurface-sunkenhighlight, applied to the slash, mention, and emoji popovers so all three composer autocompletes look uniform.Argument hinting. While typing a recognized command's arguments (e.g.
/poll), a newhint=trueendpoint mode returns a non-interactive usage bar showing the expected syntax + description (/poll "Question" "Option A" "Option B" ...). Inserting a command now drops the caret after the trailing space and immediately surfaces that hint. Because the hint bar has norole=option, the keyboard nav no-ops and Enter sends the message as normal.Panel polish. Small uppercase header, consistent padding, monospace command token vs muted description, anchored above the composer.
Keyboard model unchanged and consistent with mentions: arrows move the highlight, Tab/Enter insert (trailing space, caret positioned for args), Esc dismisses, click inserts. A stale hint/list is cleared after a send (the box clears with no input event, so a form
afterRequestlistener re-evaluates).Tests
Added coverage for the empty state, description-keyword matching, hint mode (usage bar for a known command, empty for an unknown one).
just check,just test,just test-saas,just build-cssall pass.