Skip to content

Conversation

@paul-bouzian
Copy link
Contributor

Summary

  • Slash commands are now inserted into the input field instead of being sent immediately when selected
  • Users can add arguments after the command before pressing Enter to send
  • State-changing commands (/clear, /plan, /agent, /compact) still execute immediately

Problem

When selecting a slash command from suggestions (via Tab, Enter, or click), the command was sent immediately. This prevented users from adding arguments after commands that require them (like custom commands with argumentHint).

Solution

Simplified handleSlashSelect in both chat-input-area.tsx and new-chat-form.tsx:

  • Commands that change app state execute immediately (no text input needed)
  • All other commands are inserted with a trailing space, allowing users to continue typing

Test plan

  • Type / and select a command like /review with Tab → should insert /review without sending
  • Add text after the command and press Enter → should send the complete message
  • Test /clear, /plan, /agent → should execute immediately
  • Test custom commands → should insert without sending

🤖 Generated with Claude Code

When selecting a slash command from suggestions (via Tab, Enter, or click),
the command is now inserted into the input field instead of being sent
immediately. This allows users to add arguments after the command before
sending.

State-changing commands (/clear, /plan, /agent, /compact) still execute
immediately as they don't require additional input.

Co-Authored-By: Claude <noreply@anthropic.com>
@paul-bouzian
Copy link
Contributor Author

@1code what do you think about this? did i work well?

@1code-async
Copy link

1code-async bot commented Jan 24, 2026

@paul-bouzian Sorry, only collaborators with write access can trigger @1code.

@serafimcloud serafimcloud merged commit 1ed75f3 into 21st-dev:main Jan 25, 2026
guilhermexp added a commit to guilhermexp/1code that referenced this pull request Jan 25, 2026
… OAuth, slash commands fixes

Includes:
- Human-readable worktree folder names (21st-dev#87)
- Git branch management with local/remote branch selection (21st-dev#64)
- MCP OAuth authentication for servers with allowlists (21st-dev#88)
- Custom slash commands with multi-line arguments (21st-dev#86)
- Insert slash commands without auto-send (21st-dev#84)
- Claude SDK spawn errors and expired sessions (21st-dev#70)
- Claude binary version fetch using GCS bucket (21st-dev#74)
- Windows compatibility for git worktree (21st-dev#72)
- Traffic light spacer only on macOS (21st-dev#73)

Resolved conflicts in:
- App.tsx: Combined I18nProvider and WindowProvider
- chat-markdown-renderer.tsx: Added both onUrlClick and isStreaming deps
- atoms/index.ts: Kept previewSidebarOpen default as false
- ipc-chat-transport.ts: Added detailed SDK error logging
- active-chat.tsx: Combined imports and slash command expansion
- messages-list.tsx: Added both chatId and onUrlClick props
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.

2 participants