Skip to content
Merged
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
1 change: 1 addition & 0 deletions webview-ui/src/__mocks__/lucide-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export const Check = () => React.createElement("div")
export const ChevronsUpDown = () => React.createElement("div")
export const Loader = () => React.createElement("div")
export const X = () => React.createElement("div")
export const Edit = () => React.createElement("div")
export const Database = (props: any) => React.createElement("span", { "data-testid": "database-icon", ...props })
2 changes: 1 addition & 1 deletion webview-ui/src/components/chat/ChatRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ChatRowProps {
isStreaming: boolean
onToggleExpand: () => void
onHeightChange: (isTaller: boolean) => void
onSuggestionClick?: (answer: string) => void
onSuggestionClick?: (answer: string, event?: React.MouseEvent) => void
}

interface ChatRowContentProps extends Omit<ChatRowProps, "onHeightChange"> {}
Expand Down
11 changes: 9 additions & 2 deletions webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,15 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
isLast={index === groupedMessages.length - 1}
onHeightChange={handleRowHeightChange}
isStreaming={isStreaming}
onSuggestionClick={(answer: string) => {
handleSendMessage(answer, [])
onSuggestionClick={(answer: string, event?: React.MouseEvent) => {
if (event?.shiftKey) {
// Always append to existing text, don't overwrite
setInputValue((currentValue) => {
return currentValue !== "" ? `${currentValue} \n${answer}` : answer
})
} else {
handleSendMessage(answer, [])
}
}}
/>
)
Expand Down
30 changes: 24 additions & 6 deletions webview-ui/src/components/chat/FollowUpSuggest.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import { useCallback } from "react"
import { cn } from "../../lib/utils"
import { Button } from "../ui/button"
import { Edit } from "lucide-react"
import { useAppTranslation } from "../../i18n/TranslationContext"

interface FollowUpSuggestProps {
suggestions?: string[]
onSuggestionClick?: (answer: string) => void
onSuggestionClick?: (answer: string, event?: React.MouseEvent) => void
ts: number
}

const FollowUpSuggest = ({ suggestions = [], onSuggestionClick, ts = 1 }: FollowUpSuggestProps) => {
const { t } = useAppTranslation()
const handleSuggestionClick = useCallback(
(suggestion: string) => {
onSuggestionClick?.(suggestion)
(suggestion: string, event: React.MouseEvent) => {
onSuggestionClick?.(suggestion, event)
},
[onSuggestionClick],
)
Expand All @@ -26,14 +29,29 @@ const FollowUpSuggest = ({ suggestions = [], onSuggestionClick, ts = 1 }: Follow
<div className="h-full scrollbar-thin scrollbar-thumb-vscode-scrollbarSlider-background scrollbar-track-transparent">
<div className={cn("flex gap-2.5 pb-2 flex-col h-full")}>
{suggestions.map((suggestion) => (
<div key={`${suggestion}-${ts}`} className="w-full">
<div key={`${suggestion}-${ts}`} className="w-full relative group">
<Button
variant="secondary"
className="w-full text-left whitespace-normal break-words h-auto min-h-[28px] py-2 justify-start"
onClick={() => handleSuggestionClick(suggestion)}
className="w-full text-left whitespace-normal break-words h-auto min-h-[28px] py-2 justify-start pr-8"
onClick={(event) => handleSuggestionClick(suggestion, event)}
aria-label={suggestion}>
<span className="text-left">{suggestion}</span>
</Button>
<div
className="absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity"
onClick={(e) => {
e.stopPropagation()
// Simulate shift-click by directly calling the handler with shiftKey=true
onSuggestionClick?.(suggestion, { ...e, shiftKey: true })
}}
title={t("chat:followUpSuggest.copyToInput")}>
<Button
variant="ghost"
size="icon"
className="h-6 w-6 p-1 hover:bg-vscode-button-hoverBackground">
<Edit className="h-4 w-4" />
</Button>
</div>
</div>
))}
</div>
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/ca/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Pensant",
"seconds": "{{count}}s"
},
"followUpSuggest": {
"copyToInput": "Copiar a l'entrada (o Shift + clic)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 publicat",
"description": "Roo Code 3.10 aporta potents millores de productivitat!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/de/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Denke nach",
"seconds": "{{count}}s"
},
"followUpSuggest": {
"copyToInput": "In Eingabefeld kopieren (oder Shift + Klick)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 veröffentlicht",
"description": "Roo Code 3.10 bringt leistungsstarke Produktivitätsverbesserungen!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@
"thinking": "Thinking",
"seconds": "{{count}}s"
},
"followUpSuggest": {
"copyToInput": "Copy to input (same as shift + click)"
},
"browser": {
"rooWantsToUse": "Roo wants to use the browser:",
"consoleLogs": "Console Logs",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/es/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Pensando",
"seconds": "{{count}}s"
},
"followUpSuggest": {
"copyToInput": "Copiar a la entrada (o Shift + clic)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 publicado",
"description": "¡Roo Code 3.10 trae potentes mejoras de productividad!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/fr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Réflexion",
"seconds": "{{count}}s"
},
"followUpSuggest": {
"copyToInput": "Copier vers l'entrée (ou Shift + clic)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 est sortie",
"description": "Roo Code 3.10 apporte de puissantes améliorations de productivité !",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/hi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "विचार कर रहा है",
"seconds": "{{count}} सेकंड"
},
"followUpSuggest": {
"copyToInput": "इनपुट में कॉपी करें (या Shift + क्लिक)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 रिलीज़ हुआ",
"description": "Roo Code 3.10 शक्तिशाली उत्पादकता सुधार लाता है!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/it/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Sto pensando",
"seconds": "{{count}}s"
},
"followUpSuggest": {
"copyToInput": "Copia nell'input (o Shift + clic)"
},
"announcement": {
"title": "🎉 Rilasciato Roo Code 3.10",
"description": "Roo Code 3.10 porta potenti miglioramenti di produttività!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/ja/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "考え中",
"seconds": "{{count}}秒"
},
"followUpSuggest": {
"copyToInput": "入力欄にコピー(またはShift + クリック)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 リリース",
"description": "Roo Code 3.10は強力な生産性向上機能をもたらします!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/ko/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "생각 중",
"seconds": "{{count}}초"
},
"followUpSuggest": {
"copyToInput": "입력창에 복사 (또는 Shift + 클릭)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 출시",
"description": "Roo Code 3.10이 강력한 생산성 향상 기능을 제공합니다!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/pl/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Myślenie",
"seconds": "{{count}} s"
},
"followUpSuggest": {
"copyToInput": "Kopiuj do pola wprowadzania (lub Shift + kliknięcie)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 wydany",
"description": "Roo Code 3.10 przynosi potężne usprawnienia produktywności!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/pt-BR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Pensando",
"seconds": "{{count}}s"
},
"followUpSuggest": {
"copyToInput": "Copiar para entrada (ou Shift + clique)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 Lançado",
"description": "Roo Code 3.10 traz poderosas melhorias de produtividade!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/tr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Düşünüyor",
"seconds": "{{count}}sn"
},
"followUpSuggest": {
"copyToInput": "Giriş alanına kopyala (veya Shift + tıklama)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 Yayınlandı",
"description": "Roo Code 3.10 güçlü üretkenlik iyileştirmeleri getiriyor!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/vi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "Đang suy nghĩ",
"seconds": "{{count}} giây"
},
"followUpSuggest": {
"copyToInput": "Sao chép vào ô nhập liệu (hoặc Shift + nhấp chuột)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 Đã phát hành",
"description": "Roo Code 3.10 mang đến những cải tiến năng suất mạnh mẽ!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/zh-CN/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "思考中",
"seconds": "{{count}}秒"
},
"followUpSuggest": {
"copyToInput": "复制到输入框(或按住Shift点击)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 已发布",
"description": "Roo Code 3.10带来强大的生产力提升!",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/zh-TW/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
"thinking": "思考中",
"seconds": "{{count}}秒"
},
"followUpSuggest": {
"copyToInput": "複製到輸入框(或按住Shift點擊)"
},
"announcement": {
"title": "🎉 Roo Code 3.10 已發布",
"description": "Roo Code 3.10帶來強大的生產力提升!",
Expand Down
Loading