From 6b17ae3bda77327e81741d4c22753b93a4bd31d3 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 1 Jul 2025 15:57:43 +0000 Subject: [PATCH] Fixes #5293: Add share button next to send button and shorten 'Start New Task' to 'Start Task' - Added ShareButton component to ChatTextArea bottom toolbar next to send button - Modified ShareButton to support allowNoItem prop for rendering without current task - Updated all 18 translation files to change 'Start New Task' to 'Start Task' - ShareButton is disabled when send is disabled to maintain consistent UX - Reuses existing share functionality for improved discoverability --- webview-ui/src/components/chat/ChatTextArea.tsx | 2 ++ webview-ui/src/components/chat/ShareButton.tsx | 9 ++++++--- webview-ui/src/i18n/locales/ca/chat.json | 2 +- webview-ui/src/i18n/locales/de/chat.json | 2 +- webview-ui/src/i18n/locales/en/chat.json | 2 +- webview-ui/src/i18n/locales/es/chat.json | 2 +- webview-ui/src/i18n/locales/fr/chat.json | 2 +- webview-ui/src/i18n/locales/hi/chat.json | 2 +- webview-ui/src/i18n/locales/id/chat.json | 2 +- webview-ui/src/i18n/locales/it/chat.json | 2 +- webview-ui/src/i18n/locales/ja/chat.json | 2 +- webview-ui/src/i18n/locales/ko/chat.json | 2 +- webview-ui/src/i18n/locales/nl/chat.json | 2 +- webview-ui/src/i18n/locales/pl/chat.json | 2 +- webview-ui/src/i18n/locales/pt-BR/chat.json | 2 +- webview-ui/src/i18n/locales/ru/chat.json | 2 +- webview-ui/src/i18n/locales/tr/chat.json | 2 +- webview-ui/src/i18n/locales/vi/chat.json | 2 +- webview-ui/src/i18n/locales/zh-CN/chat.json | 2 +- webview-ui/src/i18n/locales/zh-TW/chat.json | 2 +- 20 files changed, 26 insertions(+), 21 deletions(-) diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index dc077640770..f2c755e0db6 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -30,6 +30,7 @@ import { IconButton } from "./IconButton" import { IndexingStatusDot } from "./IndexingStatusBadge" import { cn } from "@/lib/utils" import { usePromptHistory } from "./hooks/usePromptHistory" +import { ShareButton } from "./ShareButton" interface ChatTextAreaProps { inputValue: string @@ -1147,6 +1148,7 @@ const ChatTextArea = forwardRef( disabled={shouldDisableImages} onClick={onSelectImages} /> + { +export const ShareButton = ({ item, disabled = false, allowNoItem = false }: ShareButtonProps) => { const [shareDropdownOpen, setShareDropdownOpen] = useState(false) const [connectModalOpen, setConnectModalOpen] = useState(false) const [shareSuccess, setShareSuccess] = useState<{ visibility: ShareVisibility; url: string } | null>(null) @@ -81,6 +82,8 @@ export const ShareButton = ({ item, disabled = false }: ShareButtonProps) => { telemetryClient.capture(TelemetryEventName.SHARE_PUBLIC_CLICKED) } + // If there's no current task but allowNoItem is true, we still try to share + // The extension will handle this case appropriately vscode.postMessage({ type: "shareCurrentTask", visibility, @@ -135,8 +138,8 @@ export const ShareButton = ({ item, disabled = false }: ShareButtonProps) => { const shareButtonState = getShareButtonState() - // Don't render if no item ID - if (!item?.id) { + // Don't render if no item ID unless allowNoItem is true + if (!item?.id && !allowNoItem) { return null } diff --git a/webview-ui/src/i18n/locales/ca/chat.json b/webview-ui/src/i18n/locales/ca/chat.json index 4db48e40f33..089ad4cdcaa 100644 --- a/webview-ui/src/i18n/locales/ca/chat.json +++ b/webview-ui/src/i18n/locales/ca/chat.json @@ -35,7 +35,7 @@ "tooltip": "Torna a provar l'operació" }, "startNewTask": { - "title": "Començar una nova tasca", + "title": "Començar tasca", "tooltip": "Comença una nova tasca" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index 3ee69f9ae4f..c0d0b7b5be8 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -35,7 +35,7 @@ "tooltip": "Versuch erneut starten" }, "startNewTask": { - "title": "Neue Aufgabe starten", + "title": "Aufgabe starten", "tooltip": "Beginne eine neue Aufgabe" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index 9ee8e167bd8..58752545310 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -30,7 +30,7 @@ "tooltip": "Try the operation again" }, "startNewTask": { - "title": "Start New Task", + "title": "Start Task", "tooltip": "Begin a new task" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index 7072d0ea165..18d97ae79c8 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -30,7 +30,7 @@ "tooltip": "Intenta la operación de nuevo" }, "startNewTask": { - "title": "Iniciar nueva tarea", + "title": "Iniciar tarea", "tooltip": "Comienza una nueva tarea" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index 25d5074f450..3eb09c0ad17 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -35,7 +35,7 @@ "tooltip": "Tenter à nouveau l'opération" }, "startNewTask": { - "title": "Commencer une nouvelle tâche", + "title": "Commencer tâche", "tooltip": "Démarrer une nouvelle tâche" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index e67068d090e..de3ca45bff3 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -35,7 +35,7 @@ "tooltip": "ऑपरेशन फिर से प्रयास करें" }, "startNewTask": { - "title": "नया कार्य शुरू करें", + "title": "कार्य शुरू करें", "tooltip": "नया कार्य शुरू करें" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/id/chat.json b/webview-ui/src/i18n/locales/id/chat.json index 259665a4067..d60f534a13c 100644 --- a/webview-ui/src/i18n/locales/id/chat.json +++ b/webview-ui/src/i18n/locales/id/chat.json @@ -33,7 +33,7 @@ "tooltip": "Coba operasi lagi" }, "startNewTask": { - "title": "Mulai Tugas Baru", + "title": "Mulai Tugas", "tooltip": "Mulai tugas baru" }, "reportBug": { diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index bbf8c8be6a2..84e90b54682 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -35,7 +35,7 @@ "tooltip": "Prova di nuovo l'operazione" }, "startNewTask": { - "title": "Inizia nuova attività", + "title": "Inizia attività", "tooltip": "Inizia una nuova attività" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index 0278edd4b60..601e19cd6e9 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -35,7 +35,7 @@ "tooltip": "操作を再試行" }, "startNewTask": { - "title": "新しいタスクを開始", + "title": "タスクを開始", "tooltip": "新しいタスクを開始" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index 53738314269..b29ad534fbc 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -35,7 +35,7 @@ "tooltip": "작업 다시 시도" }, "startNewTask": { - "title": "새 작업 시작", + "title": "작업 시작", "tooltip": "새 작업 시작하기" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/nl/chat.json b/webview-ui/src/i18n/locales/nl/chat.json index 2dc60da09e5..eed07be3752 100644 --- a/webview-ui/src/i18n/locales/nl/chat.json +++ b/webview-ui/src/i18n/locales/nl/chat.json @@ -30,7 +30,7 @@ "tooltip": "Probeer de bewerking opnieuw" }, "startNewTask": { - "title": "Nieuwe taak starten", + "title": "Taak starten", "tooltip": "Begin een nieuwe taak" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index 0af70c595bc..5f3965ca62a 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -35,7 +35,7 @@ "tooltip": "Spróbuj ponownie wykonać operację" }, "startNewTask": { - "title": "Rozpocznij nowe zadanie", + "title": "Rozpocznij zadanie", "tooltip": "Rozpocznij nowe zadanie" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index a09f8174f60..bfb5348989e 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -35,7 +35,7 @@ "tooltip": "Tentar a operação novamente" }, "startNewTask": { - "title": "Iniciar nova tarefa", + "title": "Iniciar tarefa", "tooltip": "Começar uma nova tarefa" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/ru/chat.json b/webview-ui/src/i18n/locales/ru/chat.json index 89d35f322a8..89b1ccd15c8 100644 --- a/webview-ui/src/i18n/locales/ru/chat.json +++ b/webview-ui/src/i18n/locales/ru/chat.json @@ -30,7 +30,7 @@ "tooltip": "Попробовать выполнить операцию снова" }, "startNewTask": { - "title": "Начать новую задачу", + "title": "Начать задачу", "tooltip": "Начать новую задачу" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index f12fa62bbb8..94d806c1594 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -35,7 +35,7 @@ "tooltip": "İşlemi tekrar dene" }, "startNewTask": { - "title": "Yeni Görev Başlat", + "title": "Görev Başlat", "tooltip": "Yeni bir görev başlat" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index c2338e33aa5..28424151324 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -35,7 +35,7 @@ "tooltip": "Thử lại thao tác" }, "startNewTask": { - "title": "Bắt đầu nhiệm vụ mới", + "title": "Bắt đầu nhiệm vụ", "tooltip": "Bắt đầu một nhiệm vụ mới" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index f3fb857f067..bf2ba893ee2 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -35,7 +35,7 @@ "tooltip": "再次尝试操作" }, "startNewTask": { - "title": "开始新任务", + "title": "开始任务", "tooltip": "开始一个新任务" }, "proceedAnyways": { diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index 9a20f129a34..a343b1de50d 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -35,7 +35,7 @@ "tooltip": "再次嘗試操作" }, "startNewTask": { - "title": "開始新工作", + "title": "開始工作", "tooltip": "開始一項新工作" }, "proceedAnyways": {