Skip to content

Add slash command menu

83285d1
Select commit
Loading
Failed to load commit list.
Open

Add slash command menu #5813

Add slash command menu
83285d1
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 1, 2026 in 15m 19s

Code review found 2 important issues

Found 5 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 2
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important packages/app/ui/components/BareChatInput/index.tsx:944-957 Arrow/Escape keys swallowed when slash mode active with no candidates
🔴 Important packages/app/ui/components/BareChatInput/index.tsx:483-499 Mention positions not adjusted after slash command insertion

Annotations

Check failure on line 957 in packages/app/ui/components/BareChatInput/index.tsx

See this annotation in the file changed.

@claude claude / Claude Code Review

Arrow/Escape keys swallowed when slash mode active with no candidates

ArrowUp/Down (and Escape) in handleKeyPress only check `isSlashCommandModeActive`, not `hasSlashCommandCandidates`. When the slash trigger activates but no commands match (e.g. typing `hello /unknownword`, or any `/word` token after whitespace that isn't a known command), `SlashCommandPopup` renders nothing yet `preventDefault()` is still fired — so multiline cursor navigation is silently broken whenever a non-matching slash token is in the draft. The fix is to add the same `&& hasSlashCommandCa

Check failure on line 499 in packages/app/ui/components/BareChatInput/index.tsx

See this annotation in the file changed.

@claude claude / Claude Code Review

Mention positions not adjusted after slash command insertion

Selecting a slash command rewrites controlledText via handleSelectSlashCommand without adjusting any mention indices, so any mention whose start ≥ slashCommandStartIndex now points at the wrong substring of the new text. This corrupts the immediately-stored draft (textAndMentionsToContent slices from stale offsets, dropping characters and duplicating mention text) and can silently lose mentions on the next keystroke when handleMention's display-equality check fails. Fix by shifting mention.start