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
This commit is contained in:
Roo Code 2025-07-01 15:57:43 +00:00
parent 3a8ba27615
commit 6b17ae3bda
20 changed files with 26 additions and 21 deletions

View file

@ -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<HTMLTextAreaElement, ChatTextAreaProps>(
disabled={shouldDisableImages}
onClick={onSelectImages}
/>
<ShareButton allowNoItem={true} disabled={sendingDisabled} />
<IconButton
iconClass="codicon-send"
title={t("chat:sendMessage")}

View file

@ -26,9 +26,10 @@ import {
interface ShareButtonProps {
item?: HistoryItem
disabled?: boolean
allowNoItem?: boolean // Allow sharing even when there's no current task
}
export const ShareButton = ({ item, disabled = false }: ShareButtonProps) => {
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
}

View file

@ -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": {

View file

@ -35,7 +35,7 @@
"tooltip": "Versuch erneut starten"
},
"startNewTask": {
"title": "Neue Aufgabe starten",
"title": "Aufgabe starten",
"tooltip": "Beginne eine neue Aufgabe"
},
"proceedAnyways": {

View file

@ -30,7 +30,7 @@
"tooltip": "Try the operation again"
},
"startNewTask": {
"title": "Start New Task",
"title": "Start Task",
"tooltip": "Begin a new task"
},
"proceedAnyways": {

View file

@ -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": {

View file

@ -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": {

View file

@ -35,7 +35,7 @@
"tooltip": "ऑपरेशन फिर से प्रयास करें"
},
"startNewTask": {
"title": "नया कार्य शुरू करें",
"title": "कार्य शुरू करें",
"tooltip": "नया कार्य शुरू करें"
},
"proceedAnyways": {

View file

@ -33,7 +33,7 @@
"tooltip": "Coba operasi lagi"
},
"startNewTask": {
"title": "Mulai Tugas Baru",
"title": "Mulai Tugas",
"tooltip": "Mulai tugas baru"
},
"reportBug": {

View file

@ -35,7 +35,7 @@
"tooltip": "Prova di nuovo l'operazione"
},
"startNewTask": {
"title": "Inizia nuova attività",
"title": "Inizia attività",
"tooltip": "Inizia una nuova attività"
},
"proceedAnyways": {

View file

@ -35,7 +35,7 @@
"tooltip": "操作を再試行"
},
"startNewTask": {
"title": "新しいタスクを開始",
"title": "タスクを開始",
"tooltip": "新しいタスクを開始"
},
"proceedAnyways": {

View file

@ -35,7 +35,7 @@
"tooltip": "작업 다시 시도"
},
"startNewTask": {
"title": "작업 시작",
"title": "작업 시작",
"tooltip": "새 작업 시작하기"
},
"proceedAnyways": {

View file

@ -30,7 +30,7 @@
"tooltip": "Probeer de bewerking opnieuw"
},
"startNewTask": {
"title": "Nieuwe taak starten",
"title": "Taak starten",
"tooltip": "Begin een nieuwe taak"
},
"proceedAnyways": {

View file

@ -35,7 +35,7 @@
"tooltip": "Spróbuj ponownie wykonać operację"
},
"startNewTask": {
"title": "Rozpocznij nowe zadanie",
"title": "Rozpocznij zadanie",
"tooltip": "Rozpocznij nowe zadanie"
},
"proceedAnyways": {

View file

@ -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": {

View file

@ -30,7 +30,7 @@
"tooltip": "Попробовать выполнить операцию снова"
},
"startNewTask": {
"title": "Начать новую задачу",
"title": "Начать задачу",
"tooltip": "Начать новую задачу"
},
"proceedAnyways": {

View file

@ -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": {

View file

@ -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": {

View file

@ -35,7 +35,7 @@
"tooltip": "再次尝试操作"
},
"startNewTask": {
"title": "开始任务",
"title": "开始任务",
"tooltip": "开始一个新任务"
},
"proceedAnyways": {

View file

@ -35,7 +35,7 @@
"tooltip": "再次嘗試操作"
},
"startNewTask": {
"title": "開始工作",
"title": "開始工作",
"tooltip": "開始一項新工作"
},
"proceedAnyways": {