From 7470c570ff08b16bc53f661446e26fa94ee97576 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 28 Jul 2025 08:29:34 +0000 Subject: [PATCH] feat: Add message queueing while AI is processing - Updated ChatTextArea to show queue icon when sending is disabled - Modified send button behavior to queue messages instead of being disabled - Enhanced QueuedMessages component UI with truncated previews - Added translation keys for queue-related UI text - Updated tests to cover new queueing behavior Closes #6287 --- .../src/components/chat/ChatTextArea.tsx | 12 +- .../src/components/chat/QueuedMessages.tsx | 72 +++-- .../chat/__tests__/ChatView.spec.tsx | 255 +++++++++++++++++- webview-ui/src/i18n/locales/en/chat.json | 7 +- 4 files changed, 298 insertions(+), 48 deletions(-) diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index e387732197..49488a7708 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -26,7 +26,7 @@ import ModeSelector from "./ModeSelector" import { ApiConfigSelector } from "./ApiConfigSelector" import { MAX_IMAGES_PER_MESSAGE } from "./ChatView" import ContextMenu from "./ContextMenu" -import { VolumeX, Image, WandSparkles, SendHorizontal } from "lucide-react" +import { VolumeX, Image, WandSparkles, SendHorizontal, ListPlus } from "lucide-react" import { IndexingStatusBadge } from "./IndexingStatusBadge" import { cn } from "@/lib/utils" import { usePromptHistory } from "./hooks/usePromptHistory" @@ -1047,9 +1047,9 @@ const ChatTextArea = forwardRef( {!isEditMode && (
- +
diff --git a/webview-ui/src/components/chat/QueuedMessages.tsx b/webview-ui/src/components/chat/QueuedMessages.tsx index cd3ee6d896..4fc7cccc4b 100644 --- a/webview-ui/src/components/chat/QueuedMessages.tsx +++ b/webview-ui/src/components/chat/QueuedMessages.tsx @@ -1,9 +1,8 @@ import React, { useState } from "react" import { useTranslation } from "react-i18next" -import Thumbnails from "../common/Thumbnails" import { QueuedMessage } from "@roo-code/types" -import { Mention } from "./Mention" import { Button } from "@src/components/ui" +import { X, Edit2 } from "lucide-react" interface QueuedMessagesProps { queue: QueuedMessage[] @@ -35,19 +34,29 @@ const QueuedMessages: React.FC = ({ queue, onRemove, onUpda setEditState(messageId, false) } + // Helper function to truncate text with ellipsis + const truncateText = (text: string, maxLength: number = 50) => { + if (text.length <= maxLength) return text + return text.substring(0, maxLength).trim() + "..." + } + return ( -
-
{t("queuedMessages.title")}
-
+
+
+
+ {t("chat:queuedMessages.title", { count: queue.length })} +
+
+
{queue.map((message, index) => { const editState = getEditState(message.id, message.text) return (
-
-
+ className="bg-vscode-list-hoverBackground border border-vscode-panel-border rounded p-2 overflow-hidden flex-shrink-0 transition-all hover:border-vscode-focusBorder"> +
+
{editState.isEditing ? (