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
5 changes: 3 additions & 2 deletions webview-ui/src/components/chat/Announcement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"

import { useAppTranslation } from "@src/i18n/TranslationContext"
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@src/components/ui"
import { version } from "../../../../package.json"

interface AnnouncementProps {
hideAnnouncement: () => void
Expand Down Expand Up @@ -34,8 +35,8 @@ const Announcement = ({ hideAnnouncement }: AnnouncementProps) => {
}}>
<DialogContent className="max-w-96">
<DialogHeader>
<DialogTitle>{t("chat:announcement.title")}</DialogTitle>
<DialogDescription>{t("chat:announcement.description")}</DialogDescription>
<DialogTitle>{t("chat:announcement.title", { version })}</DialogTitle>
<DialogDescription>{t("chat:announcement.description", { version })}</DialogDescription>
</DialogHeader>
<div>
<h3>{t("chat:announcement.whatsNew")}</h3>
Expand Down
47 changes: 47 additions & 0 deletions webview-ui/src/components/chat/__tests__/Announcement.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { render, screen } from "@testing-library/react"
import { jest } from "@jest/globals" // Or 'jest' if using Jest
import { version } from "../../../../../package.json"

import Announcement from "../Announcement"

// Mock the components from @src/components/ui
jest.mock("@src/components/ui", () => ({
Dialog: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
DialogContent: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
DialogDescription: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
DialogHeader: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
DialogTitle: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
}))

// Mock the useAppTranslation hook
jest.mock("@src/i18n/TranslationContext", () => ({
useAppTranslation: () => ({
t: (key: string, options?: { version: string }) => {
if (key === "chat:announcement.title") {
return `🎉 Roo Code ${options?.version} Released`
}
if (key === "chat:announcement.description") {
return `Roo Code ${options?.version} brings powerful new features and improvements based on your feedback.`
}
// Return key for other translations not relevant to this test
return key
},
}),
}))

describe("Announcement", () => {
const mockHideAnnouncement = jest.fn()
const expectedVersion = version

it("renders the announcement with the version number from package.json", () => {
render(<Announcement hideAnnouncement={mockHideAnnouncement} />)

// Check if the mocked version number is present in the title and description
expect(screen.getByText(`🎉 Roo Code ${expectedVersion} Released`)).toBeInTheDocument()
expect(
screen.getByText(
`Roo Code ${expectedVersion} brings powerful new features and improvements based on your feedback.`,
),
).toBeInTheDocument()
})
})
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/ca/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Copiar a l'entrada (o Shift + clic)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 publicat",
"description": "Roo Code 3.17 porta noves funcionalitats potents i millores basades en els teus comentaris.",
"title": "🎉 Roo Code {{version}} publicat",
"description": "Roo Code {{version}} porta noves funcionalitats potents i millores basades en els teus comentaris.",
"whatsNew": "Novetats",
"feature1": "<bold>Emmagatzematge en caché implícit per a Gemini</bold>: Les crides a l'API de Gemini ara s'emmagatzemen automàticament en caché, reduint els costos d'API",
"feature2": "<bold>Selecció de mode més intel·ligent</bold>: Les definicions de mode ara poden incloure orientació sobre quan s'ha d'utilitzar cada mode, permetent una millor orquestració",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/de/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "In Eingabefeld kopieren (oder Shift + Klick)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 veröffentlicht",
"description": "Roo Code 3.17 bringt leistungsstarke neue Funktionen und Verbesserungen basierend auf deinem Feedback.",
"title": "🎉 Roo Code {{version}} veröffentlicht",
"description": "Roo Code {{version}} bringt leistungsstarke neue Funktionen und Verbesserungen basierend auf deinem Feedback.",
"whatsNew": "Was ist neu",
"feature1": "<bold>Implizites Caching für Gemini</bold>: Gemini API-Aufrufe werden jetzt automatisch zwischengespeichert, wodurch API-Kosten reduziert werden",
"feature2": "<bold>Intelligentere Modusauswahl</bold>: Modusdefinitionen können jetzt Hinweise enthalten, wann jeder Modus verwendet werden sollte, was eine bessere Orchestrierung ermöglicht",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@
"description": "Auto-approve allows Roo Code to perform actions without asking for permission. Only enable for actions you fully trust. More detailed configuration available in <settingsLink>Settings</settingsLink>."
},
"announcement": {
"title": "🎉 Roo Code 3.17 Released",
"description": "Roo Code 3.17 brings powerful new features and improvements based on your feedback.",
"title": "🎉 Roo Code {{version}} Released",
"description": "Roo Code {{version}} brings powerful new features and improvements based on your feedback.",
"whatsNew": "What's New",
"feature1": "<bold>Implicit Caching for Gemini</bold>: Gemini API calls are now automatically cached, reducing API costs",
"feature2": "<bold>Smarter Mode Selection</bold>: Mode definitions can now include guidance on when each mode should be used, enabling better orchestration",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/es/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Copiar a la entrada (o Shift + clic)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 publicado",
"description": "Roo Code 3.17 trae potentes nuevas funcionalidades y mejoras basadas en tus comentarios.",
"title": "🎉 Roo Code {{version}} publicado",
"description": "Roo Code {{version}} trae potentes nuevas funcionalidades y mejoras basadas en tus comentarios.",
"whatsNew": "Novedades",
"feature1": "<bold>Caché implícito para Gemini</bold>: Las llamadas a la API de Gemini ahora se almacenan automáticamente en caché, reduciendo los costos de API",
"feature2": "<bold>Selección de modo más inteligente</bold>: Las definiciones de modo ahora pueden incluir orientación sobre cuándo debe usarse cada modo, permitiendo una mejor orquestación",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/fr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Copier vers l'entrée (ou Shift + clic)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 est sortie",
"description": "Roo Code 3.17 apporte de puissantes nouvelles fonctionnalités et améliorations basées sur vos retours.",
"title": "🎉 Roo Code {{version}} est sortie",
"description": "Roo Code {{version}} apporte de puissantes nouvelles fonctionnalités et améliorations basées sur vos retours.",
"whatsNew": "Quoi de neuf",
"feature1": "<bold>Mise en cache implicite pour Gemini</bold> : Les appels à l'API Gemini sont désormais automatiquement mis en cache, réduisant les coûts d'API",
"feature2": "<bold>Sélection de mode plus intelligente</bold> : Les définitions de mode peuvent maintenant inclure des indications sur quand chaque mode doit être utilisé, permettant une meilleure orchestration",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/hi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "इनपुट में कॉपी करें (या Shift + क्लिक)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 रिलीज़ हुआ",
"description": "Roo Code 3.17 आपके फीडबैक के आधार पर शक्तिशाली नई सुविधाएँ और सुधार लाता है।",
"title": "🎉 Roo Code {{version}} रिलीज़ हुआ",
"description": "Roo Code {{version}} आपके फीडबैक के आधार पर शक्तिशाली नई सुविधाएँ और सुधार लाता है।",
"whatsNew": "नई सुविधाएँ",
"feature1": "<bold>Gemini के लिए अंतर्निहित कैशिंग</bold>: Gemini API कॉल अब स्वचालित रूप से कैश किए जाते हैं, जिससे API लागत कम होती है",
"feature2": "<bold>स्मार्ट मोड चयन</bold>: मोड परिभाषाओं में अब यह मार्गदर्शन शामिल हो सकता है कि प्रत्येक मोड कब उपयोग किया जाना चाहिए, जिससे बेहतर समन्वय संभव हो",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/it/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Copia nell'input (o Shift + clic)"
},
"announcement": {
"title": "🎉 Rilasciato Roo Code 3.17",
"description": "Roo Code 3.17 introduce potenti nuove funzionalità e miglioramenti basati sui tuoi feedback.",
"title": "🎉 Rilasciato Roo Code {{version}}",
"description": "Roo Code {{version}} introduce potenti nuove funzionalità e miglioramenti basati sui tuoi feedback.",
"whatsNew": "Novità",
"feature1": "<bold>Caching implicito per Gemini</bold>: Le chiamate API Gemini vengono ora memorizzate automaticamente nella cache, riducendo i costi API",
"feature2": "<bold>Selezione della modalità più intelligente</bold>: Le definizioni delle modalità possono ora includere indicazioni su quando ogni modalità dovrebbe essere utilizzata, permettendo una migliore orchestrazione",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/ja/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "入力欄にコピー(またはShift + クリック)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 リリース",
"description": "Roo Code 3.17は、あなたのフィードバックに基づく強力な新機能と改善をもたらします。",
"title": "🎉 Roo Code {{version}} リリース",
"description": "Roo Code {{version}}は、あなたのフィードバックに基づく強力な新機能と改善をもたらします。",
"whatsNew": "新機能",
"feature1": "<bold>Geminiの暗黙的キャッシング</bold>: Gemini APIコールが自動的にキャッシュされるようになり、APIコストが削減されます",
"feature2": "<bold>よりスマートなモード選択</bold>: モード定義に各モードをいつ使用すべきかの指針を含めることができるようになり、より優れた調整が可能になります",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/ko/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "입력창에 복사 (또는 Shift + 클릭)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 출시",
"description": "Roo Code 3.17은 사용자 피드백을 기반으로 강력한 새로운 기능과 개선사항을 제공합니다.",
"title": "🎉 Roo Code {{version}} 출시",
"description": "Roo Code {{version}}은 사용자 피드백을 기반으로 강력한 새로운 기능과 개선사항을 제공합니다.",
"whatsNew": "새로운 기능",
"feature1": "<bold>Gemini용 암시적 캐싱</bold>: Gemini API 호출이 이제 자동으로 캐시되어 API 비용이 절감됩니다",
"feature2": "<bold>더 스마트한 모드 선택</bold>: 모드 정의에 각 모드를 언제 사용해야 하는지에 대한 지침을 포함할 수 있어 더 나은 오케스트레이션이 가능해졌습니다",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/nl/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
"description": "Met automatisch goedkeuren kan Roo Code acties uitvoeren zonder om toestemming te vragen. Schakel dit alleen in voor acties die je volledig vertrouwt. Meer gedetailleerde configuratie beschikbaar in de <settingsLink>Instellingen</settingsLink>."
},
"announcement": {
"title": "🎉 Roo Code 3.17 uitgebracht",
"description": "Roo Code 3.17 brengt krachtige nieuwe functies en verbeteringen op basis van jouw feedback.",
"title": "🎉 Roo Code {{version}} uitgebracht",
"description": "Roo Code {{version}} brengt krachtige nieuwe functies en verbeteringen op basis van jouw feedback.",
"feature1": "<bold>Impliciete caching voor Gemini</bold>: Gemini API-aanroepen worden nu automatisch gecachet, waardoor API-kosten worden verlaagd",
"feature2": "<bold>Slimmere modusselectie</bold>: Modusdefinities kunnen nu richtlijnen bevatten over wanneer elke modus moet worden gebruikt, wat betere orchestratie mogelijk maakt",
"feature3": "<bold>Intelligente contextcompressie</bold>: Vat gespreksgeschiedenis intelligent samen wanneer de context vol raakt in plaats van deze af te kappen (inschakelen in Instellingen -> Experimenteel)",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/pl/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Kopiuj do pola wprowadzania (lub Shift + kliknięcie)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 wydany",
"description": "Roo Code 3.17 przynosi potężne nowe funkcje i ulepszenia na podstawie Twoich opinii.",
"title": "🎉 Roo Code {{version}} wydany",
"description": "Roo Code {{version}} przynosi potężne nowe funkcje i ulepszenia na podstawie Twoich opinii.",
"whatsNew": "Co nowego",
"feature1": "<bold>Niejawne buforowanie dla Gemini</bold>: Wywołania API Gemini są teraz automatycznie buforowane, co zmniejsza koszty API",
"feature2": "<bold>Inteligentniejszy wybór trybu</bold>: Definicje trybów mogą teraz zawierać wskazówki dotyczące tego, kiedy każdy tryb powinien być używany, umożliwiając lepszą orkiestrację",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/pt-BR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Copiar para entrada (ou Shift + clique)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 Lançado",
"description": "Roo Code 3.17 traz poderosos novos recursos e melhorias baseados no seu feedback.",
"title": "🎉 Roo Code {{version}} Lançado",
"description": "Roo Code {{version}} traz poderosos novos recursos e melhorias baseados no seu feedback.",
"whatsNew": "O que há de novo",
"feature1": "<bold>Cache implícito para Gemini</bold>: Chamadas de API Gemini agora são automaticamente armazenadas em cache, reduzindo custos de API",
"feature2": "<bold>Seleção de modo mais inteligente</bold>: Definições de modo podem agora incluir orientações sobre quando cada modo deve ser usado, permitindo melhor orquestração",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/ru/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
"description": "Автоодобрение позволяет Roo Code выполнять действия без запроса разрешения. Включайте только для полностью доверенных действий. Более подробная настройка доступна в <settingsLink>Настройках</settingsLink>."
},
"announcement": {
"title": "🎉 Выпущен Roo Code 3.17",
"description": "Roo Code 3.17 приносит мощные новые функции и улучшения на основе ваших отзывов.",
"title": "🎉 Выпущен Roo Code {{version}}",
"description": "Roo Code {{version}} приносит мощные новые функции и улучшения на основе ваших отзывов.",
"whatsNew": "Что нового",
"feature1": "<bold>Неявное кэширование для Gemini</bold>: Вызовы API Gemini теперь автоматически кэшируются, сокращая затраты на API",
"feature2": "<bold>Умнее выбор режимов</bold>: Определения режимов теперь могут включать указания о том, когда следует использовать каждый режим, обеспечивая лучшую оркестрацию",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/tr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Giriş alanına kopyala (veya Shift + tıklama)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 Yayınlandı",
"description": "Roo Code 3.17 geri bildirimlerinize dayalı güçlü yeni özellikler ve iyileştirmeler getiriyor.",
"title": "🎉 Roo Code {{version}} Yayınlandı",
"description": "Roo Code {{version}} geri bildirimlerinize dayalı güçlü yeni özellikler ve iyileştirmeler getiriyor.",
"whatsNew": "Yenilikler",
"feature1": "<bold>Gemini için Örtük Önbelleğe Alma</bold>: Gemini API çağrıları artık otomatik olarak önbelleğe alınıyor, API maliyetlerini azaltıyor",
"feature2": "<bold>Daha Akıllı Mod Seçimi</bold>: Mod tanımları artık her modun ne zaman kullanılması gerektiğine dair rehberlik içerebiliyor, daha iyi orkestrasyon sağlıyor",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/vi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "Sao chép vào ô nhập liệu (hoặc Shift + nhấp chuột)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 Đã phát hành",
"description": "Roo Code 3.17 mang đến các tính năng mạnh mẽ và cải tiến mới dựa trên phản hồi của bạn.",
"title": "🎉 Roo Code {{version}} Đã phát hành",
"description": "Roo Code {{version}} mang đến các tính năng mạnh mẽ và cải tiến mới dựa trên phản hồi của bạn.",
"whatsNew": "Có gì mới",
"feature1": "<bold>Bộ nhớ đệm ngầm cho Gemini</bold>: Các lệnh gọi API Gemini hiện được tự động lưu vào bộ nhớ đệm, giảm chi phí API",
"feature2": "<bold>Lựa chọn chế độ thông minh hơn</bold>: Định nghĩa chế độ giờ đây có thể bao gồm hướng dẫn về thời điểm nên sử dụng mỗi chế độ, cho phép điều phối tốt hơn",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/zh-CN/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "复制到输入框(或按住Shift点击)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 已发布",
"description": "Roo Code 3.17 带来基于您反馈的强大新功能和改进。",
"title": "🎉 Roo Code {{version}} 已发布",
"description": "Roo Code {{version}} 带来基于您反馈的强大新功能和改进。",
"whatsNew": "新特性",
"feature1": "<bold>Gemini 的隐式缓存</bold>: Gemini API 调用现在会自动缓存,降低 API 费用",
"feature2": "<bold>更智能的模式选择</bold>: 模式定义现在可以包含何时使用每种模式的指导,实现更好的协调",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/zh-TW/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
"copyToInput": "複製到輸入框(或按住 Shift 並點選)"
},
"announcement": {
"title": "🎉 Roo Code 3.17 已發布",
"description": "Roo Code 3.17 帶來基於您意見回饋的強大新功能與改進。",
"title": "🎉 Roo Code {{version}} 已發布",
"description": "Roo Code {{version}} 帶來基於您意見回饋的強大新功能與改進。",
"whatsNew": "新功能",
"feature1": "<bold>Gemini 的隱式快取</bold>: Gemini API 呼叫現在自動快取,降低 API 費用",
"feature2": "<bold>更智慧的模式選擇</bold>: 模式定義現在可以包含何時應使用各個模式的指引,實現更好的協調",
Expand Down
Loading