feat(chat): slash autocomplete — tiered ranking, Tab completes / Enter sends / click sends unless hinted #123

Merged
dominik.polakovics merged 2 commits from afk/122 into main 2026-07-11 02:43:26 +02:00

Implements the #122 agreed design end to end.

Ranking (acMatches)

Matches are ranked into four tiers — exact name, name prefix, name substring, description/arg-hint substring — with catalog order kept as the stable within-tier order and the highlight staying at index 0. Typing /triage now puts /triage first; setup-matt-pocock-skills (description match) stays listed below it, so discovery via description survives without ever outranking a name match.

Gesture model

  • Tab completes the highlighted suggestion to /name — the only completion gesture.
  • Enter sends whatever is in the input, as-is, through the existing isComposerSend rules (fine-pointer bare Enter, Cmd/Ctrl+Enter everywhere, Shift/Alt newline, IME guard). It never accepts the highlight, popover open or not — the deliberate reversal of the issue #70 precedence rule, recorded in ADR-0041, which partially reverses ADR-0031's popover clause while leaving every other ADR-0031 decision standing.
  • Click sends the command immediately when it declares no arg_hint; a hinted command completes to /name and refocuses the input for the argument.
  • Arrows/Escape unchanged; no data-model, backend, or SKILL.md changes.

Tests

The autocomplete block was rewritten to the new contract: tiered-ranking regression test reproducing the original wrong-skill-wins bug, Tab-completes-without-sending, Enter-sends-raw (partial /cle and completed /clear), non-fine-pointer and Cmd/Ctrl+Enter guards, and click-sends vs click-completes. Full web suite green: 594 tests / 37 files, eslint, tsc, prettier, and npm run build all pass.

Closes #122

🤖 Generated with Claude Code

https://claude.ai/code/session_017uNReXe7rnsaVvgfo4LGzr

Implements the #122 agreed design end to end. ## Ranking (`acMatches`) Matches are ranked into four tiers — exact name, name prefix, name substring, description/arg-hint substring — with catalog order kept as the stable within-tier order and the highlight staying at index 0. Typing `/triage` now puts `/triage` first; `setup-matt-pocock-skills` (description match) stays listed below it, so discovery via description survives without ever outranking a name match. ## Gesture model - **Tab** completes the highlighted suggestion to `/name ` — the only completion gesture. - **Enter** sends whatever is in the input, as-is, through the existing `isComposerSend` rules (fine-pointer bare Enter, Cmd/Ctrl+Enter everywhere, Shift/Alt newline, IME guard). It never accepts the highlight, popover open or not — the deliberate reversal of the issue #70 precedence rule, recorded in **ADR-0041**, which partially reverses ADR-0031's popover clause while leaving every other ADR-0031 decision standing. - **Click** sends the command immediately when it declares no `arg_hint`; a hinted command completes to `/name ` and refocuses the input for the argument. - Arrows/Escape unchanged; no data-model, backend, or SKILL.md changes. ## Tests The autocomplete block was rewritten to the new contract: tiered-ranking regression test reproducing the original wrong-skill-wins bug, Tab-completes-without-sending, Enter-sends-raw (partial `/cle` and completed `/clear`), non-fine-pointer and Cmd/Ctrl+Enter guards, and click-sends vs click-completes. Full web suite green: 594 tests / 37 files, eslint, tsc, prettier, and `npm run build` all pass. Closes #122 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017uNReXe7rnsaVvgfo4LGzr
acMatches now ranks matches into four tiers — exact name, name prefix,
name substring, then description/arg-hint substring — with catalog order
stable within a tier, so a command whose description merely mentions the
query (setup-matt-pocock-skills vs /triage) can never outrank the command
named after it.

Gesture model: Tab is the only completion gesture; Enter always sends the
input as typed, falling through to the isComposerSend rules even with the
popover open (deliberately reversing the issue #70 popover-precedence
clause of ADR-0031 — recorded in ADR-0041); clicking a suggestion sends it
immediately unless it declares an arg_hint, in which case the click
completes to "/name " and focuses the input. Arrows/Escape unchanged.

Closes #122

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uNReXe7rnsaVvgfo4LGzr
Merge remote-tracking branch 'origin/main' into afk/122
All checks were successful
ci / native (pull_request) Successful in 5m38s
41c2e3f552
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/coding-lab!123
No description provided.