Verify there is no existing issue for this
Description
Currently, slash commands (/undo, /new, /compact, custom commands) only trigger when typed at the very beginning of an empty prompt. The regex rawText.match(/^\/(\S*)$/) requires the entire input to be just the slash command.
This means users cannot type context first and then invoke a slash command, e.g.:
explain the auth flow /compact — does nothing
fix the bug in auth.ts /undo — does nothing
Expected: Typing / after a space anywhere in the prompt should open the slash command popover, just like @ mentions work mid-prompt today.
After selecting:
- Custom commands: replace the
/trigger fragment with the expanded command, keep surrounding text
- Builtin commands: remove the
/trigger fragment, keep surrounding text, execute the command
Related: the @ mention popover already works mid-prompt via textBeforeCursor.match(/@(\S*)$/). Slash commands should behave the same way.
Verify there is no existing issue for this
Description
Currently, slash commands (
/undo,/new,/compact, custom commands) only trigger when typed at the very beginning of an empty prompt. The regexrawText.match(/^\/(\S*)$/)requires the entire input to be just the slash command.This means users cannot type context first and then invoke a slash command, e.g.:
explain the auth flow /compact— does nothingfix the bug in auth.ts /undo— does nothingExpected: Typing
/after a space anywhere in the prompt should open the slash command popover, just like@mentions work mid-prompt today.After selecting:
/triggerfragment with the expanded command, keep surrounding text/triggerfragment, keep surrounding text, execute the commandRelated: the
@mention popover already works mid-prompt viatextBeforeCursor.match(/@(\S*)$/). Slash commands should behave the same way.