Skip to content

Commit cc9fc9b

Browse files
authored
update chat box ui (RooCodeInc#3868)
* chat area * changeset * arrow * nit * tailwind
1 parent dcf59bc commit cc9fc9b

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
update chat box ui

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
906906
}, [])
907907

908908
useEffect(() => {
909-
if (selectedImages.length === 0) {
909+
if (selectedImages.length === 0 && selectedFiles.length === 0) {
910910
setThumbnailsHeight(0)
911911
}
912-
}, [selectedImages])
912+
}, [selectedImages, selectedFiles])
913913

914914
const handleMenuMouseDown = useCallback(() => {
915915
setIsMouseDownOnMenu(true)
@@ -1493,12 +1493,13 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
14931493
borderRight: 0,
14941494
borderTop: 0,
14951495
borderColor: "transparent",
1496-
borderBottom: `${thumbnailsHeight + 6}px solid transparent`,
1497-
padding: "9px 28px 3px 9px",
1496+
borderBottom: `${thumbnailsHeight}px solid transparent`,
1497+
padding: "9px 28px 9px 9px",
14981498
}}
14991499
/>
15001500
<DynamicTextArea
15011501
data-testid="chat-input"
1502+
minRows={3}
15021503
ref={(el) => {
15031504
if (typeof ref === "function") {
15041505
ref(el)
@@ -1550,13 +1551,13 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
15501551
borderLeft: 0,
15511552
borderRight: 0,
15521553
borderTop: 0,
1553-
borderBottom: `${thumbnailsHeight + 6}px solid transparent`,
1554+
borderBottom: `${thumbnailsHeight}px solid transparent`,
15541555
borderColor: "transparent",
15551556
// borderRight: "54px solid transparent",
15561557
// borderLeft: "9px solid transparent", // NOTE: react-textarea-autosize doesn't calculate correct height when using borderLeft/borderRight so we need to use horizontal padding instead
15571558
// Instead of using boxShadow, we use a div with a border to better replicate the behavior when the textarea is focused
15581559
// boxShadow: "0px 0px 0px 1px var(--vscode-input-border)",
1559-
padding: "9px 28px 3px 9px",
1560+
padding: "9px 28px 9px 9px",
15601561
cursor: "text",
15611562
flex: 1,
15621563
zIndex: 1,
@@ -1570,6 +1571,11 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
15701571
}}
15711572
onScroll={() => updateHighlights()}
15721573
/>
1574+
{!inputValue && selectedImages.length === 0 && selectedFiles.length === 0 && (
1575+
<div className="absolute bottom-4 left-[25px] right-[60px] text-[10px] text-[var(--vscode-input-placeholderForeground)] opacity-70 whitespace-nowrap overflow-hidden text-ellipsis pointer-events-none z-[1]">
1576+
Type @ for context, / for slash commands & workflows
1577+
</div>
1578+
)}
15731579
{(selectedImages.length > 0 || selectedFiles.length > 0) && (
15741580
<Thumbnails
15751581
images={selectedImages}
@@ -1592,9 +1598,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
15921598
position: "absolute",
15931599
right: 23,
15941600
display: "flex",
1595-
alignItems: "flex-center",
1601+
alignItems: "flex-end",
15961602
height: textAreaBaseHeight || 31,
15971603
bottom: 9.5, // should be 10 but doesn't look good on mac
1604+
paddingBottom: "8px",
15981605
zIndex: 2,
15991606
}}>
16001607
<div

0 commit comments

Comments
 (0)