diff --git a/webview-ui/src/components/chat/Announcement.tsx b/webview-ui/src/components/chat/Announcement.tsx index 0d93d9da0c..058c8ab656 100644 --- a/webview-ui/src/components/chat/Announcement.tsx +++ b/webview-ui/src/components/chat/Announcement.tsx @@ -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 @@ -34,8 +35,8 @@ const Announcement = ({ hideAnnouncement }: AnnouncementProps) => { }}> - {t("chat:announcement.title")} - {t("chat:announcement.description")} + {t("chat:announcement.title", { version })} + {t("chat:announcement.description", { version })}

{t("chat:announcement.whatsNew")}

diff --git a/webview-ui/src/components/chat/__tests__/Announcement.test.tsx b/webview-ui/src/components/chat/__tests__/Announcement.test.tsx new file mode 100644 index 0000000000..d06a25906a --- /dev/null +++ b/webview-ui/src/components/chat/__tests__/Announcement.test.tsx @@ -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 }) =>
{children}
, + DialogContent: ({ children }: { children: React.ReactNode }) =>
{children}
, + DialogDescription: ({ children }: { children: React.ReactNode }) =>
{children}
, + DialogHeader: ({ children }: { children: React.ReactNode }) =>
{children}
, + DialogTitle: ({ children }: { children: React.ReactNode }) =>
{children}
, +})) + +// 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() + + // 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() + }) +}) diff --git a/webview-ui/src/i18n/locales/ca/chat.json b/webview-ui/src/i18n/locales/ca/chat.json index 4e9fdbee5d..73c861063a 100644 --- a/webview-ui/src/i18n/locales/ca/chat.json +++ b/webview-ui/src/i18n/locales/ca/chat.json @@ -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": "Emmagatzematge en caché implícit per a Gemini: Les crides a l'API de Gemini ara s'emmagatzemen automàticament en caché, reduint els costos d'API", "feature2": "Selecció de mode més intel·ligent: Les definicions de mode ara poden incloure orientació sobre quan s'ha d'utilitzar cada mode, permetent una millor orquestració", diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index 435decc88f..388459b0c8 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -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": "Implizites Caching für Gemini: Gemini API-Aufrufe werden jetzt automatisch zwischengespeichert, wodurch API-Kosten reduziert werden", "feature2": "Intelligentere Modusauswahl: Modusdefinitionen können jetzt Hinweise enthalten, wann jeder Modus verwendet werden sollte, was eine bessere Orchestrierung ermöglicht", diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index 80302dfb2c..b984cd8568 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -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 Settings." }, "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": "Implicit Caching for Gemini: Gemini API calls are now automatically cached, reducing API costs", "feature2": "Smarter Mode Selection: Mode definitions can now include guidance on when each mode should be used, enabling better orchestration", diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index ddc817f85d..f632bc188e 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -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": "Caché implícito para Gemini: Las llamadas a la API de Gemini ahora se almacenan automáticamente en caché, reduciendo los costos de API", "feature2": "Selección de modo más inteligente: Las definiciones de modo ahora pueden incluir orientación sobre cuándo debe usarse cada modo, permitiendo una mejor orquestación", diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index 2a116c8bf2..0dee8d706d 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -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": "Mise en cache implicite pour Gemini : Les appels à l'API Gemini sont désormais automatiquement mis en cache, réduisant les coûts d'API", "feature2": "Sélection de mode plus intelligente : Les définitions de mode peuvent maintenant inclure des indications sur quand chaque mode doit être utilisé, permettant une meilleure orchestration", diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index dfa7045b91..730e769d5c 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -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": "Gemini के लिए अंतर्निहित कैशिंग: Gemini API कॉल अब स्वचालित रूप से कैश किए जाते हैं, जिससे API लागत कम होती है", "feature2": "स्मार्ट मोड चयन: मोड परिभाषाओं में अब यह मार्गदर्शन शामिल हो सकता है कि प्रत्येक मोड कब उपयोग किया जाना चाहिए, जिससे बेहतर समन्वय संभव हो", diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index cb46a806fc..eac3f6e4f2 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -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": "Caching implicito per Gemini: Le chiamate API Gemini vengono ora memorizzate automaticamente nella cache, riducendo i costi API", "feature2": "Selezione della modalità più intelligente: Le definizioni delle modalità possono ora includere indicazioni su quando ogni modalità dovrebbe essere utilizzata, permettendo una migliore orchestrazione", diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index 080ea1b3ff..e388075c23 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -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": "Geminiの暗黙的キャッシング: Gemini APIコールが自動的にキャッシュされるようになり、APIコストが削減されます", "feature2": "よりスマートなモード選択: モード定義に各モードをいつ使用すべきかの指針を含めることができるようになり、より優れた調整が可能になります", diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index 4f2e94b73e..86850770a7 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -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": "Gemini용 암시적 캐싱: Gemini API 호출이 이제 자동으로 캐시되어 API 비용이 절감됩니다", "feature2": "더 스마트한 모드 선택: 모드 정의에 각 모드를 언제 사용해야 하는지에 대한 지침을 포함할 수 있어 더 나은 오케스트레이션이 가능해졌습니다", diff --git a/webview-ui/src/i18n/locales/nl/chat.json b/webview-ui/src/i18n/locales/nl/chat.json index 8e30baa57a..6befd41eb8 100644 --- a/webview-ui/src/i18n/locales/nl/chat.json +++ b/webview-ui/src/i18n/locales/nl/chat.json @@ -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 Instellingen." }, "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": "Impliciete caching voor Gemini: Gemini API-aanroepen worden nu automatisch gecachet, waardoor API-kosten worden verlaagd", "feature2": "Slimmere modusselectie: Modusdefinities kunnen nu richtlijnen bevatten over wanneer elke modus moet worden gebruikt, wat betere orchestratie mogelijk maakt", "feature3": "Intelligente contextcompressie: Vat gespreksgeschiedenis intelligent samen wanneer de context vol raakt in plaats van deze af te kappen (inschakelen in Instellingen -> Experimenteel)", diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index 96e48aba8b..29499ed943 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -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": "Niejawne buforowanie dla Gemini: Wywołania API Gemini są teraz automatycznie buforowane, co zmniejsza koszty API", "feature2": "Inteligentniejszy wybór trybu: Definicje trybów mogą teraz zawierać wskazówki dotyczące tego, kiedy każdy tryb powinien być używany, umożliwiając lepszą orkiestrację", diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index a30d191c2e..54da897f72 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -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": "Cache implícito para Gemini: Chamadas de API Gemini agora são automaticamente armazenadas em cache, reduzindo custos de API", "feature2": "Seleção de modo mais inteligente: Definições de modo podem agora incluir orientações sobre quando cada modo deve ser usado, permitindo melhor orquestração", diff --git a/webview-ui/src/i18n/locales/ru/chat.json b/webview-ui/src/i18n/locales/ru/chat.json index 1248cc229f..f61c83a9a6 100644 --- a/webview-ui/src/i18n/locales/ru/chat.json +++ b/webview-ui/src/i18n/locales/ru/chat.json @@ -195,8 +195,8 @@ "description": "Автоодобрение позволяет Roo Code выполнять действия без запроса разрешения. Включайте только для полностью доверенных действий. Более подробная настройка доступна в Настройках." }, "announcement": { - "title": "🎉 Выпущен Roo Code 3.17", - "description": "Roo Code 3.17 приносит мощные новые функции и улучшения на основе ваших отзывов.", + "title": "🎉 Выпущен Roo Code {{version}}", + "description": "Roo Code {{version}} приносит мощные новые функции и улучшения на основе ваших отзывов.", "whatsNew": "Что нового", "feature1": "Неявное кэширование для Gemini: Вызовы API Gemini теперь автоматически кэшируются, сокращая затраты на API", "feature2": "Умнее выбор режимов: Определения режимов теперь могут включать указания о том, когда следует использовать каждый режим, обеспечивая лучшую оркестрацию", diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index a48c8aef86..bb753b0ecd 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -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": "Gemini için Örtük Önbelleğe Alma: Gemini API çağrıları artık otomatik olarak önbelleğe alınıyor, API maliyetlerini azaltıyor", "feature2": "Daha Akıllı Mod Seçimi: Mod tanımları artık her modun ne zaman kullanılması gerektiğine dair rehberlik içerebiliyor, daha iyi orkestrasyon sağlıyor", diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index 5038f55412..31ae044b04 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -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": "Bộ nhớ đệm ngầm cho Gemini: 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": "Lựa chọn chế độ thông minh hơn: Đị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", diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index adffcfb482..048e25c344 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -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": "Gemini 的隐式缓存: Gemini API 调用现在会自动缓存,降低 API 费用", "feature2": "更智能的模式选择: 模式定义现在可以包含何时使用每种模式的指导,实现更好的协调", diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index 2fddadce73..42b8f78347 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -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": "Gemini 的隱式快取: Gemini API 呼叫現在自動快取,降低 API 費用", "feature2": "更智慧的模式選擇: 模式定義現在可以包含何時應使用各個模式的指引,實現更好的協調",