Highlight slash commands in history (#5323)

This commit is contained in:
Miguel Solorio
2025-07-31 16:24:23 -07:00
committed by GitHub
parent 61e382444a
commit 6f7beb414c
2 changed files with 19 additions and 3 deletions

View File

@@ -15,11 +15,15 @@ interface UserMessageProps {
export const UserMessage: React.FC<UserMessageProps> = ({ text }) => {
const prefix = '> ';
const prefixWidth = prefix.length;
const isSlashCommand = text.startsWith('/');
const textColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray;
const borderColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray;
return (
<Box
borderStyle="round"
borderColor={Colors.Gray}
borderColor={borderColor}
flexDirection="row"
paddingX={2}
paddingY={0}
@@ -27,10 +31,10 @@ export const UserMessage: React.FC<UserMessageProps> = ({ text }) => {
alignSelf="flex-start"
>
<Box width={prefixWidth}>
<Text color={Colors.Gray}>{prefix}</Text>
<Text color={textColor}>{prefix}</Text>
</Box>
<Box flexGrow={1}>
<Text wrap="wrap" color={Colors.Gray}>
<Text wrap="wrap" color={textColor}>
{text}
</Text>
</Box>