Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions webview-ui/src/components/chat/ChatTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")}
Expand Down
9 changes: 6 additions & 3 deletions webview-ui/src/components/chat/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/ca/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/de/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "Versuch erneut starten"
},
"startNewTask": {
"title": "Neue Aufgabe starten",
"title": "Aufgabe starten",
"tooltip": "Beginne eine neue Aufgabe"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tooltip": "Try the operation again"
},
"startNewTask": {
"title": "Start New Task",
"title": "Start Task",
"tooltip": "Begin a new task"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/es/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/fr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/hi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "ऑपरेशन फिर से प्रयास करें"
},
"startNewTask": {
"title": "नया कार्य शुरू करें",
"title": "कार्य शुरू करें",
"tooltip": "नया कार्य शुरू करें"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/id/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"tooltip": "Coba operasi lagi"
},
"startNewTask": {
"title": "Mulai Tugas Baru",
"title": "Mulai Tugas",
"tooltip": "Mulai tugas baru"
},
"reportBug": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/it/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "Prova di nuovo l'operazione"
},
"startNewTask": {
"title": "Inizia nuova attività",
"title": "Inizia attività",
"tooltip": "Inizia una nuova attività"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/ja/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "操作を再試行"
},
"startNewTask": {
"title": "新しいタスクを開始",
"title": "タスクを開始",
"tooltip": "新しいタスクを開始"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/ko/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "작업 다시 시도"
},
"startNewTask": {
"title": "작업 시작",
"title": "작업 시작",
"tooltip": "새 작업 시작하기"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/nl/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tooltip": "Probeer de bewerking opnieuw"
},
"startNewTask": {
"title": "Nieuwe taak starten",
"title": "Taak starten",
"tooltip": "Begin een nieuwe taak"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/pl/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "Spróbuj ponownie wykonać operację"
},
"startNewTask": {
"title": "Rozpocznij nowe zadanie",
"title": "Rozpocznij zadanie",
"tooltip": "Rozpocznij nowe zadanie"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/pt-BR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/ru/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tooltip": "Попробовать выполнить операцию снова"
},
"startNewTask": {
"title": "Начать новую задачу",
"title": "Начать задачу",
"tooltip": "Начать новую задачу"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/tr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/vi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/zh-CN/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "再次尝试操作"
},
"startNewTask": {
"title": "开始新任务",
"title": "开始任务",
"tooltip": "开始一个新任务"
},
"proceedAnyways": {
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/zh-TW/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tooltip": "再次嘗試操作"
},
"startNewTask": {
"title": "開始新工作",
"title": "開始工作",
"tooltip": "開始一項新工作"
},
"proceedAnyways": {
Expand Down