Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions webview-ui/src/components/chat/ChatTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
appearance: "none" as const,
}

const optionStyle = {
backgroundColor: "var(--vscode-dropdown-background)",
color: "var(--vscode-dropdown-foreground)",
}

const caretContainerStyle = {
position: "absolute" as const,
left: 6,
Expand Down Expand Up @@ -731,20 +736,21 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
flex: "0 0 auto",
}}>
{getAllModes(customModes).map((mode) => (
<option
key={mode.slug}
value={mode.slug}
style={{
backgroundColor: "var(--vscode-dropdown-background)",
color: "var(--vscode-dropdown-foreground)",
}}>
<option key={mode.slug} value={mode.slug} style={{ ...optionStyle }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting repeated inline styles for select and option elements into a shared utility or CSS module for better maintainability. This is from our Development Standards: https://www.notion.so/Development-Standards-59febcf8ead647fd9c2ec3f60c22f3df?pvs=4#11869ad2d5818094a05ef707e188c0d5

{mode.name}
</option>
))}
<option disabled style={{ borderTop: "1px solid var(--vscode-dropdown-border)" }}>
<option
disabled
style={{
borderTop: "1px solid var(--vscode-dropdown-border)",
...optionStyle,
}}>
────
</option>
<option value="prompts-action">Edit...</option>
<option value="prompts-action" style={{ ...optionStyle }}>
Edit...
</option>
</select>
<div style={caretContainerStyle}>
<CaretIcon />
Expand Down Expand Up @@ -784,16 +790,22 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
key={config.name}
value={config.name}
style={{
backgroundColor: "var(--vscode-dropdown-background)",
color: "var(--vscode-dropdown-foreground)",
...optionStyle,
}}>
{config.name}
</option>
))}
<option disabled style={{ borderTop: "1px solid var(--vscode-dropdown-border)" }}>
<option
disabled
style={{
borderTop: "1px solid var(--vscode-dropdown-border)",
...optionStyle,
}}>
────
</option>
<option value="settings-action">Edit...</option>
<option value="settings-action" style={{ ...optionStyle }}>
Edit...
</option>
</select>
<div style={caretContainerStyle}>
<CaretIcon />
Expand Down
Loading