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
15 changes: 0 additions & 15 deletions webview-ui/src/components/chat/CodeIndexPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
VSCodeDropdown,
VSCodeOption,
VSCodeLink,
VSCodeCheckbox,
} from "@vscode/webview-ui-toolkit/react"
import * as ProgressPrimitive from "@radix-ui/react-progress"
import { vscode } from "@src/utils/vscode"
Expand Down Expand Up @@ -513,20 +512,6 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
</div>

<div className="p-4">
{/* Enable/Disable Toggle */}
<div className="mb-4">
<div className="flex items-center gap-2">
<VSCodeCheckbox
checked={currentSettings.codebaseIndexEnabled}
onChange={(e: any) => updateSetting("codebaseIndexEnabled", e.target.checked)}>
<span className="font-medium">{t("settings:codeIndex.enableLabel")}</span>
</VSCodeCheckbox>
<StandardTooltip content={t("settings:codeIndex.enableDescription")}>
<span className="codicon codicon-info text-xs text-vscode-descriptionForeground cursor-help" />
</StandardTooltip>
</div>
</div>

{/* Status Section */}
<div className="space-y-2">
<h4 className="text-sm font-medium">{t("settings:codeIndex.statusTitle")}</h4>
Expand Down
7 changes: 7 additions & 0 deletions webview-ui/src/components/chat/IndexingStatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { cn } from "@src/lib/utils"
import { vscode } from "@src/utils/vscode"
import { useAppTranslation } from "@/i18n/TranslationContext"
import { useTooltip } from "@/hooks/useTooltip"
import { useExtensionState } from "@src/context/ExtensionStateContext"
import { CodeIndexPopover } from "./CodeIndexPopover"
import type { IndexingStatus, IndexingStatusUpdateMessage } from "@roo/ExtensionMessage"

Expand All @@ -15,6 +16,7 @@ export const IndexingStatusBadge: React.FC<IndexingStatusBadgeProps> = ({ classN
const { t } = useAppTranslation()
const { showTooltip, handleMouseEnter, handleMouseLeave, cleanup } = useTooltip({ delay: 300 })
const [isHovered, setIsHovered] = useState(false)
const { codebaseIndexConfig } = useExtensionState()

const [indexingStatus, setIndexingStatus] = useState<IndexingStatus>({
systemStatus: "Standby",
Expand Down Expand Up @@ -52,6 +54,11 @@ export const IndexingStatusBadge: React.FC<IndexingStatusBadgeProps> = ({ classN
[indexingStatus.processedItems, indexingStatus.totalItems],
)

// Don't render if codebase indexing is disabled
if (!codebaseIndexConfig?.codebaseIndexEnabled) {
return null
}

// Get tooltip text with internationalization
const getTooltipText = () => {
switch (indexingStatus.systemStatus) {
Expand Down
47 changes: 47 additions & 0 deletions webview-ui/src/components/settings/GeneralSettings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from "react"
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
import { useExtensionState } from "@/context/ExtensionStateContext"
import { useAppTranslation } from "@/i18n/TranslationContext"
import { vscode } from "@/utils/vscode"

export const GeneralSettings: React.FC = () => {
const { t } = useAppTranslation()
const { codebaseIndexConfig } = useExtensionState()

const updateSetting = (key: string, value: any) => {
vscode.postMessage({
type: "saveCodeIndexSettingsAtomic",
codeIndexSettings: {
codebaseIndexEnabled: codebaseIndexConfig?.codebaseIndexEnabled ?? true,
codebaseIndexQdrantUrl: codebaseIndexConfig?.codebaseIndexQdrantUrl ?? "",
codebaseIndexEmbedderProvider: codebaseIndexConfig?.codebaseIndexEmbedderProvider ?? "openai",
codebaseIndexEmbedderBaseUrl: codebaseIndexConfig?.codebaseIndexEmbedderBaseUrl,
codebaseIndexEmbedderModelId: codebaseIndexConfig?.codebaseIndexEmbedderModelId ?? "",
codebaseIndexEmbedderModelDimension: codebaseIndexConfig?.codebaseIndexEmbedderModelDimension,
codebaseIndexSearchMaxResults: codebaseIndexConfig?.codebaseIndexSearchMaxResults,
codebaseIndexSearchMinScore: codebaseIndexConfig?.codebaseIndexSearchMinScore,
codebaseIndexOpenAiCompatibleBaseUrl: codebaseIndexConfig?.codebaseIndexOpenAiCompatibleBaseUrl,
...codebaseIndexConfig,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In updateSetting, you list default values then spread codebaseIndexConfig before overriding [key]. This ordering may be fragile if any default is unintentionally overwritten. Consider reordering or add a comment justifying the order.

[key]: value,
},
})
}

return (
<div className="space-y-4">
<div className="space-y-2">
<h3 className="text-lg font-medium text-vscode-foreground">
{t("settings:general.codebaseIndexing.title")}
</h3>
<p className="text-sm text-vscode-descriptionForeground">
{t("settings:general.codebaseIndexing.description")}
</p>
<VSCodeCheckbox
checked={codebaseIndexConfig?.codebaseIndexEnabled ?? true}
onChange={(e: any) => updateSetting("codebaseIndexEnabled", e.target.checked)}>
{t("settings:general.codebaseIndexing.enabled")}
</VSCodeCheckbox>
</div>
</div>
)
}
6 changes: 6 additions & 0 deletions webview-ui/src/components/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { SetCachedStateField, SetExperimentEnabled } from "./types"
import { SectionHeader } from "./SectionHeader"
import ApiConfigManager from "./ApiConfigManager"
import ApiOptions from "./ApiOptions"
import { GeneralSettings } from "./GeneralSettings"
import { AutoApproveSettings } from "./AutoApproveSettings"
import { BrowserSettings } from "./BrowserSettings"
import { CheckpointSettings } from "./CheckpointSettings"
Expand All @@ -79,6 +80,7 @@ export interface SettingsViewRef {
}

const sectionNames = [
"general",
"providers",
"autoApprove",
"browser",
Expand Down Expand Up @@ -392,6 +394,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t

const sections: { id: SectionName; icon: LucideIcon }[] = useMemo(
() => [
{ id: "general", icon: SquareMousePointer },
{ id: "providers", icon: Webhook },
{ id: "autoApprove", icon: CheckCheck },
{ id: "browser", icon: SquareMousePointer },
Expand Down Expand Up @@ -539,6 +542,9 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t

{/* Content area */}
<TabContent className="p-0 flex-1 overflow-auto">
{/* General Section */}
{activeTab === "general" && <GeneralSettings />}

{/* Providers Section */}
{activeTab === "providers" && (
<div>
Expand Down
8 changes: 8 additions & 0 deletions webview-ui/src/i18n/locales/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"discardButton": "Änderungen verwerfen"
},
"sections": {
"general": "Allgemein",
"providers": "Anbieter",
"autoApprove": "Auto-Genehmigung",
"browser": "Computerzugriff",
Expand All @@ -33,6 +34,13 @@
"language": "Sprache",
"about": "Über Roo Code"
},
"general": {
"description": "Konfiguriere allgemeine Roo Code-Einstellungen, die für die gesamte Erweiterung gelten.",
"codebaseIndexing": {
"enable": "Codebase-Indexierung aktivieren",
"description": "Aktiviere die Code-Indizierung für eine verbesserte Suche und ein besseres Kontextverständnis"
}
},
"prompts": {
"description": "Konfiguriere Support-Prompts, die für schnelle Aktionen wie das Verbessern von Prompts, das Erklären von Code und das Beheben von Problemen verwendet werden. Diese Prompts helfen Roo dabei, bessere Unterstützung für häufige Entwicklungsaufgaben zu bieten."
},
Expand Down
8 changes: 8 additions & 0 deletions webview-ui/src/i18n/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"discardButton": "Discard changes"
},
"sections": {
"general": "General",
"providers": "Providers",
"autoApprove": "Auto-Approve",
"browser": "Browser",
Expand All @@ -33,6 +34,13 @@
"language": "Language",
"about": "About Roo Code"
},
"general": {
"description": "Configure general application settings and features.",
"codebaseIndexing": {
"title": "Codebase Indexing",
"description": "Enable semantic search of your project codebase for improved context understanding and code assistance."
}
},
"prompts": {
"description": "Configure support prompts that are used for quick actions like enhancing prompts, explaining code, and fixing issues. These prompts help Roo provide better assistance for common development tasks."
},
Expand Down
8 changes: 8 additions & 0 deletions webview-ui/src/i18n/locales/es/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"discardButton": "Descartar cambios"
},
"sections": {
"general": "General",
"providers": "Proveedores",
"autoApprove": "Auto-aprobación",
"browser": "Acceso al ordenador",
Expand All @@ -33,6 +34,13 @@
"language": "Idioma",
"about": "Acerca de Roo Code"
},
"general": {
"description": "Configura los ajustes generales de Roo Code que se aplican a toda la extensión.",
"codebaseIndexing": {
"enable": "Habilitar indexación de código",
"description": "Habilita la indexación de código para mejorar la búsqueda y la comprensión del contexto"
}
},
"prompts": {
"description": "Configura indicaciones de soporte que se utilizan para acciones rápidas como mejorar indicaciones, explicar código y solucionar problemas. Estas indicaciones ayudan a Roo a brindar mejor asistencia para tareas comunes de desarrollo."
},
Expand Down
8 changes: 8 additions & 0 deletions webview-ui/src/i18n/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"discardButton": "Ignorer les modifications"
},
"sections": {
"general": "Général",
"providers": "Fournisseurs",
"autoApprove": "Auto-approbation",
"browser": "Accès ordinateur",
Expand All @@ -33,6 +34,13 @@
"language": "Langue",
"about": "À propos de Roo Code"
},
"general": {
"description": "Configurez les paramètres généraux de Roo Code qui s'appliquent à l'ensemble de l'extension.",
"codebaseIndexing": {
"enable": "Activer l'indexation de la base de code",
"description": "Activer l'indexation du code pour une recherche et une compréhension du contexte améliorées"
}
},
"prompts": {
"description": "Configurez les invites de support utilisées pour les actions rapides comme l'amélioration des invites, l'explication du code et la résolution des problèmes. Ces invites aident Roo à fournir une meilleure assistance pour les tâches de développement courantes."
},
Expand Down
7 changes: 7 additions & 0 deletions webview-ui/src/i18n/locales/it/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
"language": "Lingua",
"about": "Informazioni su Roo Code"
},
"general": {
"description": "Configura le impostazioni generali di Roo Code che si applicano all'intera estensione.",
"codebaseIndexing": {
"enable": "Abilita indicizzazione codebase",
"description": "Abilita l'indicizzazione del codice per una ricerca migliorata e comprensione del contesto"
}
},
"prompts": {
"description": "Configura i prompt di supporto utilizzati per azioni rapide come il miglioramento dei prompt, la spiegazione del codice e la risoluzione dei problemi. Questi prompt aiutano Roo a fornire una migliore assistenza per le attività di sviluppo comuni."
},
Expand Down
8 changes: 8 additions & 0 deletions webview-ui/src/i18n/locales/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"discardButton": "変更を破棄"
},
"sections": {
"general": "一般",
"providers": "プロバイダー",
"autoApprove": "自動承認",
"browser": "コンピューターアクセス",
Expand All @@ -33,6 +34,13 @@
"language": "言語",
"about": "Roo Codeについて"
},
"general": {
"description": "拡張機能全体に適用されるRoo Codeの一般設定を構成します。",
"codebaseIndexing": {
"enable": "コードベースのインデックス作成を有効化",
"description": "コードのインデックス作成を有効にして、検索とコンテキストの理解を向上させます"
}
},
"prompts": {
"description": "プロンプトの強化、コードの説明、問題の修正などの迅速なアクションに使用されるサポートプロンプトを設定します。これらのプロンプトは、Rooが一般的な開発タスクでより良いサポートを提供するのに役立ちます。"
},
Expand Down
7 changes: 7 additions & 0 deletions webview-ui/src/i18n/locales/nl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
"language": "Taal",
"about": "Over Roo Code"
},
"general": {
"description": "Configureer algemene Roo Code-instellingen die van toepassing zijn op de hele extensie.",
"codebaseIndexing": {
"enable": "Codebase indexering inschakelen",
"description": "Schakel code indexering in voor verbeterde zoekfunctionaliteit en contextbegrip"
}
},
"prompts": {
"description": "Configureer ondersteuningsprompts die worden gebruikt voor snelle acties zoals het verbeteren van prompts, het uitleggen van code en het oplossen van problemen. Deze prompts helpen Roo om betere ondersteuning te bieden voor veelvoorkomende ontwikkelingstaken."
},
Expand Down
7 changes: 7 additions & 0 deletions webview-ui/src/i18n/locales/pt-BR/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
"language": "Idioma",
"about": "Sobre"
},
"general": {
"description": "Configure as configurações gerais do Roo Code que se aplicam a toda a extensão.",
"codebaseIndexing": {
"enable": "Habilitar indexação da base de código",
"description": "Habilite a indexação de código para melhorar a busca e compreensão do contexto"
}
},
"prompts": {
"description": "Configure prompts de suporte usados para ações rápidas como melhorar prompts, explicar código e corrigir problemas. Esses prompts ajudam o Roo a fornecer melhor assistência para tarefas comuns de desenvolvimento."
},
Expand Down
8 changes: 8 additions & 0 deletions webview-ui/src/i18n/locales/ru/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"discardButton": "Отменить изменения"
},
"sections": {
"general": "Общие",
"providers": "Провайдеры",
"autoApprove": "Автоодобрение",
"browser": "Доступ к компьютеру",
Expand All @@ -33,6 +34,13 @@
"language": "Язык",
"about": "О Roo Code"
},
"general": {
"description": "Настройте общие параметры Roo Code, которые применяются ко всему расширению.",
"codebaseIndexing": {
"enable": "Включить индексацию кодовой базы",
"description": "Включите индексацию кода для улучшения поиска и понимания контекста"
}
},
"prompts": {
"description": "Настройте промпты поддержки, используемые для быстрых действий, таких как улучшение промптов, объяснение кода и исправление проблем. Эти промпты помогают Roo обеспечить лучшую поддержку для общих задач разработки."
},
Expand Down
8 changes: 8 additions & 0 deletions webview-ui/src/i18n/locales/zh-CN/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"discardButton": "放弃更改"
},
"sections": {
"general": "常规",
"providers": "提供商",
"autoApprove": "自动批准",
"browser": "计算机交互",
Expand All @@ -33,6 +34,13 @@
"language": "语言",
"about": "关于 Roo Code"
},
"general": {
"description": "配置适用于整个扩展的 Roo Code 常规设置。",
"codebaseIndexing": {
"enable": "启用代码库索引",
"description": "启用代码索引以改进搜索和上下文理解"
}
},
"prompts": {
"description": "配置用于快速操作的支持提示词,如增强提示词、解释代码和修复问题。这些提示词帮助 Roo 为常见开发任务提供更好的支持。"
},
Expand Down
Loading