From 3033d4abb4d867c3b34d0a89a8cfe23e796dc352 Mon Sep 17 00:00:00 2001 From: seedlord Date: Sun, 29 Jun 2025 07:47:57 +0200 Subject: [PATCH 1/2] Adjust padding and margin for improved layout in AutoApproveMenu and ChatTextArea components --- .../src/components/chat/AutoApproveMenu.tsx | 2 +- .../src/components/chat/ChatTextArea.tsx | 8 +- webview-ui/src/components/chat/ChatView.tsx | 148 +++++++++--------- 3 files changed, 82 insertions(+), 76 deletions(-) diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx index ac02d6b8c4..b5d43f7dcf 100644 --- a/webview-ui/src/components/chat/AutoApproveMenu.tsx +++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx @@ -134,7 +134,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { display: "flex", alignItems: "center", gap: "8px", - padding: isExpanded ? "8px 0" : "8px 0 0 0", + padding: isExpanded ? "8px 0" : "2px 0 0 0", cursor: "pointer", }} onClick={toggleExpanded}> diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index dc07764077..51279062d2 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -787,10 +787,10 @@ const ChatTextArea = forwardRef( "relative", "flex", "flex-col", - "gap-2", + "gap-1", "bg-editor-background", - "m-2 mt-1", - "p-1.5", + "px-1.5", + "pb-1", "outline-none", "border", "border-none", @@ -998,7 +998,7 @@ const ChatTextArea = forwardRef( /> )} -
+
{showAnnouncement && } @@ -1447,7 +1449,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction +
)} @@ -1458,7 +1460,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction
- - {showScrollToBottom ? ( -
- -
{ - scrollToBottomSmooth() - disableAutoScrollRef.current = false - }}> - -
-
-
- ) : ( +
+ +
+ {areButtonsVisible && (
- {primaryButtonText && !isStreaming && ( - - handlePrimaryButtonClick(inputValue, selectedImages)}> - {primaryButtonText} - - - )} - {(secondaryButtonText || isStreaming) && ( - + {showScrollToBottom ? ( + handleSecondaryButtonClick(inputValue, selectedImages)}> - {isStreaming ? t("chat:cancel.title") : secondaryButtonText} + className="flex-[2]" + onClick={() => { + scrollToBottomSmooth() + disableAutoScrollRef.current = false + }}> + + ) : ( + <> + {primaryButtonText && !isStreaming && ( + + handlePrimaryButtonClick(inputValue, selectedImages)}> + {primaryButtonText} + + + )} + {(secondaryButtonText || isStreaming) && ( + + handleSecondaryButtonClick(inputValue, selectedImages)}> + {isStreaming ? t("chat:cancel.title") : secondaryButtonText} + + + )} + )}
)} From 0b82c796543d4f62a1293087c1f63fc945d40dc5 Mon Sep 17 00:00:00 2001 From: seedlord Date: Sun, 29 Jun 2025 21:10:07 +0200 Subject: [PATCH 2/2] fix: Add min-w-0 class to TaskItem component for better layout handling -fixes the buttons on the right edge of task items being hidden too early when initial message of that task was too long/big --- webview-ui/src/components/history/TaskItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/components/history/TaskItem.tsx b/webview-ui/src/components/history/TaskItem.tsx index 5ebe9f9831..5338819dd3 100644 --- a/webview-ui/src/components/history/TaskItem.tsx +++ b/webview-ui/src/components/history/TaskItem.tsx @@ -68,7 +68,7 @@ const TaskItem = ({
)} -
+
{/* Header with metadata */}