Skip to content

fix(app): support slash command picker on any line of multiline input#35519

Open
0xSkybreaker wants to merge 1 commit into
anomalyco:devfrom
0xSkybreaker:fix/slash-command-multiline-picker
Open

fix(app): support slash command picker on any line of multiline input#35519
0xSkybreaker wants to merge 1 commit into
anomalyco:devfrom
0xSkybreaker:fix/slash-command-multiline-picker

Conversation

@0xSkybreaker

@0xSkybreaker 0xSkybreaker commented Jul 6, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #35520

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The slash command picker (/) only worked on the first line of multiline input. The regex /^\/(\S*)$/ matched against the entire rawText, requiring the text to start with /. In multiline input where / was on a later line, the regex failed to match.

This fix:

  1. Only considers text up to the cursor position (rawText.substring(0, cursorPosition)) — same as how the @ mention picker already works
  2. Uses /(?:^|\n)\/(\S*)$/ to match a / at the start of any line

How did you verify your code works?

Tested locally with bun dev:

  • Typed multiline input and used / on different lines — the slash command picker appears on any line
  • Same scenario with @ mentions — continues to work as before
  • Both pickers respect cursor position on each line

Screenshots / recordings

Not applicable — no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

fix(app): support slash command picker on any line of multiline input

The slash command picker used `rawText.match(/^\/(\S*)$/)` which requires
the entire input to start with `/`. This means typing text first, then
Shift+Enter, then `/` on a new line would not trigger the picker.

Fix by checking only the text before the cursor position for a line-start
`/`, matching the same pattern used for @mention triggers. This allows
users to compose multiline prompts and trigger slash commands on any line.

Fixes anomalyco#34693

Co-Authored-By: Claude <noreply@anthropic.com>
@
@github-actions github-actions Bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slash command picker doesn't work on multiline input

1 participant