Skip to content

Commit bada375

Browse files
committed
Update inline code and image card styling with theme colors
- Make inline code blocks bold with orange color (dark) / burnt orange (light) - Add imageCardBorder theme color (neutral grey #6B7280) - Update /image mode input, image cards, and pending images banner to use grey
1 parent 0bb16ae commit bada375

File tree

12 files changed

+77
-16
lines changed

12 files changed

+77
-16
lines changed

cli/src/__tests__/unit/segmented-control.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ const theme: ChatTheme = {
4242
modeMaxText: '#d22',
4343
modePlanBg: '#14e',
4444
modePlanText: '#14e',
45+
// Link
46+
link: '#3B82F6',
47+
// Directory
48+
directory: '#9CA3AF',
49+
// Image card
50+
imageCardBorder: '#3B82F6',
4551
// Markdown
4652
markdown: {
4753
codeBackground: '#111',

cli/src/components/image-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const ImageCard = ({
9898
style={{
9999
flexDirection: 'column',
100100
borderStyle: 'single',
101-
borderColor: theme.info,
101+
borderColor: theme.imageCardBorder,
102102
width: IMAGE_CARD_WIDTH,
103103
padding: 0,
104104
}}

cli/src/components/login-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export const LoginModal = ({
397397
text={loginUrl}
398398
maxWidth={maxUrlWidth}
399399
formatLines={formatLoginUrlLines}
400-
color={hasClickedLink ? theme.success : theme.info}
400+
color={hasClickedLink ? theme.success : theme.link}
401401
activeColor={theme.success}
402402
underlineOnHover={true}
403403
isActive={justCopied}

cli/src/components/pending-images-banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const PendingImagesBanner = () => {
6666
marginLeft: width.is('sm') ? 0 : 1,
6767
marginRight: width.is('sm') ? 0 : 1,
6868
borderStyle: 'single',
69-
borderColor: theme.info,
69+
borderColor: theme.imageCardBorder,
7070
paddingLeft: 1,
7171
paddingRight: 1,
7272
paddingTop: 0,
@@ -83,7 +83,7 @@ export const PendingImagesBanner = () => {
8383
))}
8484

8585
{/* Header */}
86-
<text style={{ fg: theme.info }}>
86+
<text style={{ fg: theme.imageCardBorder }}>
8787
📎{' '}
8888
{readyCount > 0 && `${pluralize(readyCount, 'image')} attached`}
8989
{readyCount > 0 && processingCount > 0 && ', '}

cli/src/components/terminal-link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const TerminalLink: React.FC<TerminalLinkProps> = ({
3838
const theme = useTheme()
3939

4040
// Use theme colors as defaults if not provided
41-
const linkColor = color ?? theme.info
41+
const linkColor = color ?? theme.link
4242
const linkActiveColor = activeColor ?? theme.success
4343
const [isHovered, setIsHovered] = useState(false)
4444

cli/src/components/tools/list-directory.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22

33
import { SimpleToolCallItem } from './tool-call-item'
44
import { defineToolComponent } from './types'
5+
import { useTheme } from '../../hooks/use-theme'
56

67
import type { ToolRenderConfig } from './types'
78

@@ -41,8 +42,20 @@ export const ListDirectoryComponent = defineToolComponent({
4142
// Format directory list
4243
const description = directories.join(', ')
4344

45+
// Use a wrapper component to access theme
46+
const ListDirectoryContent = () => {
47+
const theme = useTheme()
48+
return (
49+
<SimpleToolCallItem
50+
name="List"
51+
description={description}
52+
descriptionColor={theme.directory}
53+
/>
54+
)
55+
}
56+
4457
return {
45-
content: <SimpleToolCallItem name="List" description={description} />,
58+
content: <ListDirectoryContent />,
4659
}
4760
},
4861
})

cli/src/components/tools/read-subtree.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { SimpleToolCallItem } from './tool-call-item'
22
import { defineToolComponent } from './types'
3+
import { useTheme } from '../../hooks/use-theme'
34

45
import type { ToolRenderConfig } from './types'
56

@@ -24,11 +25,20 @@ export const ReadSubtreeComponent = defineToolComponent({
2425

2526
const finalPath = displayPath || '.'
2627

27-
// Render a single bullet line like the Read tool
28+
// Use a wrapper component to access theme
29+
const ReadSubtreeContent = () => {
30+
const theme = useTheme()
31+
return (
32+
<SimpleToolCallItem
33+
name="List deeply"
34+
description={finalPath}
35+
descriptionColor={theme.directory}
36+
/>
37+
)
38+
}
39+
2840
return {
29-
content: (
30-
<SimpleToolCallItem name="List deeply" description={finalPath} />
31-
),
41+
content: <ReadSubtreeContent />,
3242
}
3343
},
3444
})

cli/src/components/tools/tool-call-item.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ const renderExpandedContent = (
124124
interface SimpleToolCallItemProps {
125125
name: string
126126
description: string
127+
descriptionColor?: string
127128
}
128129

129130
export const SimpleToolCallItem = ({
130131
name,
131132
description,
133+
descriptionColor,
132134
}: SimpleToolCallItemProps) => {
133135
const theme = useTheme()
134136
const bulletChar = '• '
@@ -140,7 +142,7 @@ export const SimpleToolCallItem = ({
140142
<span fg={theme.foreground} attributes={TextAttributes.BOLD}>
141143
{name}
142144
</span>
143-
<span fg={theme.foreground}> {description}</span>
145+
<span fg={descriptionColor ?? theme.foreground}> {description}</span>
144146
</text>
145147
</box>
146148
)

cli/src/types/theme-system.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface MarkdownThemeOverrides {
1616
blockquoteTextFg?: string
1717
dividerFg?: string
1818
codeMonochrome?: boolean
19+
linkFg?: string
1920
}
2021

2122
/**
@@ -45,9 +46,15 @@ export interface ChatTheme {
4546
/** Warning color - cautions, alerts, validation issues */
4647
warning: string
4748

48-
/** Info color - informational elements, links, hints */
49+
/** Info color - informational elements, hints */
4950
info: string
5051

52+
/** Link color - hyperlinks, clickable references */
53+
link: string
54+
55+
/** Directory color - folder/directory paths */
56+
directory: string
57+
5158
// ============================================================================
5259
// NEUTRAL SCALE
5360
// ============================================================================
@@ -118,6 +125,13 @@ export interface ChatTheme {
118125
/** Plan mode toggle text */
119126
modePlanText: string
120127

128+
// ============================================================================
129+
// IMAGE CARD
130+
// ============================================================================
131+
132+
/** Image card border color */
133+
imageCardBorder: string
134+
121135
// ============================================================================
122136
// MARKDOWN
123137
// ============================================================================

cli/src/utils/input-modes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export type ThemeColorKey =
1414
| 'success'
1515
| 'info'
1616
| 'muted'
17+
| 'imageCardBorder'
18+
| 'link'
1719

1820
export type InputModeConfig = {
1921
/** Prefix icon shown before input (e.g., "!" for bash) */
@@ -65,7 +67,7 @@ export const INPUT_MODE_CONFIGS: Record<InputMode, InputModeConfig> = {
6567
},
6668
image: {
6769
icon: '📎',
68-
color: 'info',
70+
color: 'imageCardBorder',
6971
placeholder: 'enter image path or Ctrl+V to paste',
7072
widthAdjustment: 3, // emoji width + padding
7173
showAgentModeToggle: false,

0 commit comments

Comments
 (0)