Summary
The slash/skill menu only appears when the composer draft is empty (or exactly /query). If you type a message, move back to the start, and type /, the menu does not appear — it should.
Reproduction
- Type a full message into the message composer
- Move the cursor back to the very start of the text
- Type
/
- The slash/skill menu does not pop up
Expected
Typing / opens the slash/skill menu even when the composer already contains text. The menu query should be the text after the current / (up to the first space or the cursor).
Use case: start writing a message, remember to enable a skill or make a change, go back to the start, and type / to invoke it.
Root cause (as identified)
UI-V2/src/components/views/ChatView.tsx:1433:
const slashMatch = /^\/([\w-]*)$/.exec(draft)
The regex is anchored to the entire draft, so it only matches when the whole draft is / followed by word/- characters. Any surrounding text kills the match, and slashOpen (line 1487) depends on slashQuery !== null.
Suggested direction
Trigger the palette based on the cursor's current token: a / at the start of the draft or after whitespace, then filter on the text from that / to the first space/tab/cursor. Other palette triggers in the same block (permission-mode, command-safety, memory-level, codex-option queries) share the whole-draft assumption and should be revisited in the same fix.
Summary
The slash/skill menu only appears when the composer draft is empty (or exactly
/query). If you type a message, move back to the start, and type/, the menu does not appear — it should.Reproduction
/Expected
Typing
/opens the slash/skill menu even when the composer already contains text. The menu query should be the text after the current/(up to the first space or the cursor).Use case: start writing a message, remember to enable a skill or make a change, go back to the start, and type
/to invoke it.Root cause (as identified)
UI-V2/src/components/views/ChatView.tsx:1433:The regex is anchored to the entire draft, so it only matches when the whole draft is
/followed by word/-characters. Any surrounding text kills the match, andslashOpen(line 1487) depends onslashQuery !== null.Suggested direction
Trigger the palette based on the cursor's current token: a
/at the start of the draft or after whitespace, then filter on the text from that/to the first space/tab/cursor. Other palette triggers in the same block (permission-mode, command-safety, memory-level, codex-option queries) share the whole-draft assumption and should be revisited in the same fix.