fix(tui): slash menu hijacks fully-typed commands via description matches - #183
Conversation
…ches Typing /update submitted /set: /update was missing from slashMenuItems, and the menu filter matches descriptions too, so /set's 'Update config' was the only visible row and Enter submitted it. - add the missing commands to the menu (/update, /context, /gemma, /plan) - rank command-name matches ahead of description matches in the filter - Enter with a filter that exactly names a command submits that command verbatim, regardless of which row the selection sits on
Sigilix OverviewEffort: 2/5 (small) Quality gates
Summary — latest pushFixes a bug where typing a fully-qualified slash command like Important files
Sequence diagramsequenceDiagram
participant User
participant InputModel
participant Filter
participant Menu
User->>InputModel: Type /update
InputModel->>Filter: filter = "update"
Filter->>Menu: Rank /update (Cmd match) ahead of /set (Desc match)
User->>InputModel: Press Enter
InputModel->>InputModel: Exact match "/update" found in slashMenuItems
InputModel-->>User: Submit /update verbatim
Confidence: 4/5The fix is narrow and well-targeted with three focused tests covering the core regression, though the exact-match Enter override introduces a new control-flow path that should be manually verified to ensure it doesn't interfere with partial matches.
Suggested labels:
|
QualityMax ReviewVerdict: COMMENT · Confidence: evidence-backed scan Files eligible: 2 · Files reviewed: 2 · Files with findings: 0 · Findings: 0 · Inline cards: 0 Priority findings
Review gates
Important files
Change diagram — Flowgraph TD
A[User presses Enter] --> B{Exact command match?}
B -- Yes --> C[Submit exact command]
B -- No --> D[Submit selected menu item]
E[User types filter] --> F{Filter matches}
F --> G[Rank Cmd matches first]
G --> H[Rank Desc matches second]
Review lifecycleUse the inline cards to inspect evidence and suggested remediation. Re-run the QualityMax review after pushing a fix; unchanged cards are identified by their stable finding marker. Dismiss with a reason through the existing QualityMax/GitHub review feedback flow. 0 prior card(s) are stale/resolved on this head. Proof legend: VERIFIED independently judged patch · REPRODUCED verified finding · GROUNDED deterministic evidence · MODEL-ONLY model judgment. QualityMax project results are available in the configured project. Receipt · commit |
|
| Gate | Result |
|---|---|
| 🔍 AI diff review | ✅ Clean · gemini-3.1-flash-lite · completed · 2 eligible / 2 reviewed · gemini-3.1-flash-lite |
| 🔍 SAST | completed · 2 eligible / 2 reviewed · qwen3.7-plus |
| 🔍 Canonical PR review delivery | completed · 0 eligible / 0 reviewed · exact-head review #5092353224 and overview #5512924864 confirmed |
| 🧪 Repo Tests | ✅ 725/725 passed (go) |
Powered by QualityMax — AI-Powered Test Automation
Problem
Typing
/updatein the REPL runs/setinstead (reproduced twice by the user on v1.28.0):Root cause
Two defects compound in
internal/tui/input.go:/updateis missing fromslashMenuItems(as are/context,/gemma,/plan). Typing/on an empty line opens the slash menu, so a command absent from the table can never be submitted as typed text — Enter always submits a menu row./set's description is literally "Update config". Filterupdate→ the only visible row is/set→ Enter submits it.Fix
/update,/context,/gemma,/plan).filteredMenuItemsranks command-name matches ahead of description matches, so a typed name is never outranked by a description coincidence.Tests
TestSlashMenuFilterRanksCmdMatchAheadOfDescMatch— filterupdate:/update(Cmd match) ranks before/set(Desc "Update config")TestSlashMenuEnterSubmitsExactTypedCommand— selection deliberately parked on the/setrow, Enter still submits/updateTestSlashMenuCoversCriticalCommands— the four missing commands plus the core set are present in the tableTest plan
go test ./...— 0 failures; gofmt/vet clean/updatein a session on a build with this fix → the update flow runs