feat: show excluded indexing directories in UI

This adds visibility for which directories are excluded from codebase
indexing, addressing the user question about whether node_modules and
dist are indexed (they are not).

Changes:
- Add EXCLUDED_INDEXING_DIRECTORIES constant to @roo-code/types package
- Add collapsible "Excluded Directories" section to CodeIndexPopover
- Add translation keys for the new UI section

This helps users understand what directories are automatically excluded
from indexing without having to look at the source code.
This commit is contained in:
Roo Code 2026-01-06 21:05:42 +00:00
parent 503f40241d
commit ec9fbc7ef6
3 changed files with 76 additions and 2 deletions

View file

@ -14,6 +14,35 @@ export const CODEBASE_INDEX_DEFAULTS = {
SEARCH_SCORE_STEP: 0.05,
} as const
/**
* List of directories that are excluded from codebase indexing.
* These directories are typically large and would slow down indexing.
* The list is shared between the indexer and the UI to provide transparency.
*/
export const EXCLUDED_INDEXING_DIRECTORIES = [
"node_modules",
"__pycache__",
"env",
"venv",
"target/dependency",
"build/dependencies",
"dist",
"out",
"bundle",
"vendor",
"tmp",
"temp",
"deps",
"pkg",
"Pods",
".git",
] as const
/**
* Pattern for hidden directories (directories starting with a dot)
*/
export const EXCLUDED_HIDDEN_DIRECTORY_PATTERN = ".*" as const
/**
* CodebaseIndexConfig
*/

View file

@ -12,7 +12,11 @@ import {
import * as ProgressPrimitive from "@radix-ui/react-progress"
import { AlertTriangle } from "lucide-react"
import { CODEBASE_INDEX_DEFAULTS } from "@roo-code/types"
import {
CODEBASE_INDEX_DEFAULTS,
EXCLUDED_INDEXING_DIRECTORIES,
EXCLUDED_HIDDEN_DIRECTORY_PATTERN,
} from "@roo-code/types"
import type { EmbedderProvider } from "@roo/embeddingModels"
import type { IndexingStatus } from "@roo/ExtensionMessage"
@ -194,6 +198,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
const [open, setOpen] = useState(false)
const [isAdvancedSettingsOpen, setIsAdvancedSettingsOpen] = useState(false)
const [isSetupSettingsOpen, setIsSetupSettingsOpen] = useState(false)
const [isExcludedDirsOpen, setIsExcludedDirsOpen] = useState(false)
const [indexingStatus, setIndexingStatus] = useState<IndexingStatus>(externalIndexingStatus)
@ -1593,6 +1598,41 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
)}
</div>
{/* Excluded Directories Info Section */}
<div className="mt-4">
<button
onClick={() => setIsExcludedDirsOpen(!isExcludedDirsOpen)}
className="flex items-center text-xs text-vscode-foreground hover:text-vscode-textLink-foreground focus:outline-none"
aria-expanded={isExcludedDirsOpen}>
<span
className={`codicon codicon-${isExcludedDirsOpen ? "chevron-down" : "chevron-right"} mr-1`}></span>
<span className="text-base font-semibold">
{t("settings:codeIndex.excludedDirectories.title")}
</span>
</button>
{isExcludedDirsOpen && (
<div className="mt-2 space-y-2">
<p className="text-sm text-vscode-descriptionForeground">
{t("settings:codeIndex.excludedDirectories.description")}
</p>
<div className="flex flex-wrap gap-1">
{EXCLUDED_INDEXING_DIRECTORIES.map((dir) => (
<span
key={dir}
className="inline-flex items-center px-2 py-0.5 rounded text-xs font-mono bg-vscode-badge-background text-vscode-badge-foreground">
{dir}
</span>
))}
</div>
<p className="text-xs text-vscode-descriptionForeground italic">
{t("settings:codeIndex.excludedDirectories.hiddenDirectoriesNote")} (
{EXCLUDED_HIDDEN_DIRECTORY_PATTERN})
</p>
</div>
)}
</div>
{/* Action Buttons */}
<div className="flex items-center justify-between gap-2 pt-6">
<div className="flex gap-2">

View file

@ -179,7 +179,12 @@
"baseUrlRequired": "Base URL is required",
"modelDimensionMinValue": "Model dimension must be greater than 0"
},
"optional": "optional"
"optional": "optional",
"excludedDirectories": {
"title": "Excluded Directories",
"description": "These directories are automatically excluded from indexing to improve performance. Files in these directories will not be indexed or searchable.",
"hiddenDirectoriesNote": "Additionally, all hidden directories (starting with a dot) are excluded."
}
},
"autoApprove": {
"description": "Run these actions without asking for permission. Only enable for actions you fully trust and if you understand the security risks.",