🤖 feat: real-time command highlighting in ChatInput #2006
+204
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
CommandPrefixBadgeinUserMessageContent). This PR brings the same visual treatment to the input field itself, providing immediate feedback that a command is being typed.Implementation
CommandHighlightOverlaycomponent: 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.VimTextArea: The overlay is positioned absolutely on top of the textarea withpointer-events: noneso all interactions pass through to the underlying input.extractCommandPrefixfunction covering various input patterns.How it works
/compact/compact/compact -t 5000/compact -t 5000/compact\nContinue working/compact(only first line)/model sonnet/model sonnetregular messageGenerated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high• Cost:$2.72