Skip to content

Slash menu does not open when typing / in a non-empty composer #316

Description

@davidtaylor6130

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

  1. Type a full message into the message composer
  2. Move the cursor back to the very start of the text
  3. Type /
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinguiUI-related changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions