feat(chat): slash autocomplete — tiered ranking, Tab completes / Enter sends input / click sends #122
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
Two composer-autocomplete complaints (grill session 2026-07-10):
name,description, andarg_hint, results stay in catalog order (builtins pinned, then project skills alphabetical), and the highlight is always index 0. Typing/triagetherefore highlightssetup-matt-pocock-skills— its description contains the word "triage" and it sorts beforetriage. Enter accepts the highlighted row → wrong skill inserted./nameinserted); a second Enter is needed to send, even for commands that take no arguments.Agreed design
1. Tiered ranking (
acMatches)Rank matches by quality, stable catalog order within each tier, highlight stays index 0:
Query "triage" →
/triagefirst,setup-matt-pocock-skillsbelow it (discovery via description still works, it just never outranks a name match).2. Gesture model
/name(only completion gesture).isComposerSendrules (fine-pointer bare Enter sends, Shift/Alt+Enter newline, IME guard, Cmd/Ctrl+Enter always sends). ⚠️ This deliberately reverses the issue #70 decision that popover-Enter-accept takes precedence over send.arg_hint; ifarg_hintis present, click completes to/nameand focuses the input so the argument can be typed.arg_hintpresence is the one "expects more text" signal.3. No data-model or frontmatter changes
No new
CommandSpecfields, no backend changes, noSKILL.mdedits (repo skills are vendored via setup-matt-pocock-skills; hints can be added per-skill later as pain arises).Accepted consequences
/tri+ Enter sends the literal text/tri(user's responsibility; Tab first to complete)./clearexecutes it immediately (one click). Enter-path still requires the full text/clearin the input, which is its own confirmation./land-prsends it bare (no hint declared today); the skill asks for the PR number itself.Out of scope
Where
web/src/routes/RunChat.tsx—Composer:acMatches(~1523-1530, ranking),onKeyDown(~1561-1590, drop Enter-accept branch, keep Tab/arrows/Escape),acceptCommand(~1540-1548, split complete vs send paths), popover row click handler (~1656-1682).web/src/routes/RunChat.test.tsx— "Slash-command autocomplete" block (~2664-2806): the Enter-accepts test (~2725) and the #70 Enter-precedence test (~2773) must be rewritten to the new model; add ranking tests (exact/prefix beats description match), Tab-completes, Enter-sends-raw-input, click-sends-no-hint vs click-completes-hinted.Test plan
setup-matt-pocock-skills(description containing "triage") +triage→ query "triage" highlights/triage; query "tri" ditto (prefix tier)./name, does not send./triand completed/triage)./nameand does not post.Land audit — PR #123 →
main: PASSci / nativesuccess (Successful in 5m26s, run #128) — relied on as the vouching signal; not re-run. PR body reports 594 tests / 37 files, eslint, tsc, prettier andnpm run buildall green.feat(chat): …). ✓afk/122carries a workingCloses #122. ✓main(d8aafcf) — 0 conflict markers.acMatchesnow tiers matches (0 exact name · 1 name prefix · 2 name substring · 3 description/arg-hint) with a spec-stablesort, so catalog order survives within a tier and a description-only match can never outrank the command named after it.Tabcompletes (completeCommand→/name); the Enter-accept branch is dropped, so Enter falls through to the existingisComposerSendgate and posts the box as typed. Arrows/Escape/Cmd+Ctrl-Enter unchanged./namewhen it declares anarg_hint;send()gained an optionalbodyarg so click-send and Enter-send share one POST + clear-on-success.Verdict: PASS — ready to merge on your go-ahead.
Landing audit — PR #123 →
Closes #122: verdict PASSci / nativegreen (success in 5m26s, run #128) — relied on, not re-run. Body reports 594 tests / 37 files, eslint, tsc, prettier,npm run buildall pass.feat(chat): …); AFK contract satisfied — headafk/122carries a workingCloses #122.git merge-treeagainst currentorigin/main(67d7dfa) produces no conflict despite both sides touchingRunChat.tsx; the edits are disjoint.RunChat.tsx,RunChat.test.tsx, newdocs/adr/0041-composer-autocomplete-tiered-ranking-and-gesture-model.md):acMatchestiers correctly (0 exact → 1 prefix → 2 substring → 3 desc/hint),.sort()is stable so catalog order survives within a tier; a bare/prefix-matches every name → full catalog unchanged.isComposerSendsend gate (ADR-0041 reversal of ADR-0031's popover clause) and posts the box as typed.arg_hint, else completes to/nameand refocuses;send(body?)shares one POST + clear-on-success, and clear-on-success collapses the popover.No blockers. Awaiting free-text merge go-ahead.