Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Add real-time visual highlighting for slash commands as you type in the chat input, using the same blue tint (--color-plan-mode-light) that appears on commands in sent messages.

Background

Currently, slash commands are styled with a blue highlight color only after sending the message (via CommandPrefixBadge in UserMessageContent). This PR brings the same visual treatment to the input field itself, providing immediate feedback that a command is being typed.

Implementation

  • New CommandHighlightOverlay component: Extracts the command prefix (first line starting with /) and renders it with the highlight color. The rest of the text is transparent so the original textarea text shows through.
  • Integration in VimTextArea: The overlay is positioned absolutely on top of the textarea with pointer-events: none so all interactions pass through to the underlying input.
  • Unit tests: Tests for the extractCommandPrefix function covering various input patterns.

How it works

Input Highlighted portion
/compact /compact
/compact -t 5000 /compact -t 5000
/compact\nContinue working /compact (only first line)
/model sonnet /model sonnet
regular message (none)

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high • Cost: $2.72

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions github-actions bot added the enhancement New feature or functionality label Jan 29, 2026
@ammar-agent ammar-agent force-pushed the chat-input-74rb branch 2 times, most recently from 384d265 to 3a45e81 Compare January 29, 2026 03:35
Add visual highlighting for slash commands as you type in the chat input.
Commands are highlighted with the same blue tint used in sent messages.
- Move typography (font-size, font-family) to wrapper container
- Overlay inherits all styles via 'font: inherit', no duplication
- Make textarea text transparent when command prefix exists
- Overlay positioned behind textarea, shows through transparent text
- Caret remains visible via caret-color
- Background moved to wrapper so overlay renders correctly
- CommandPrefixText accepts className for font override when needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant