@@ -12,21 +12,25 @@ import { Section } from "./Section"
1212type ContextManagementSettingsProps = HTMLAttributes < HTMLDivElement > & {
1313 terminalOutputLineLimit ?: number
1414 maxOpenTabsContext : number
15+ maxWorkspaceFiles : number
1516 showRooIgnoredFiles ?: boolean
16- setCachedStateField : SetCachedStateField < "terminalOutputLineLimit" | "maxOpenTabsContext" | "showRooIgnoredFiles" >
17+ setCachedStateField : SetCachedStateField <
18+ "terminalOutputLineLimit" | "maxOpenTabsContext" | "maxWorkspaceFiles" | "showRooIgnoredFiles"
19+ >
1720}
1821
1922export const ContextManagementSettings = ( {
2023 terminalOutputLineLimit,
2124 maxOpenTabsContext,
25+ maxWorkspaceFiles,
2226 showRooIgnoredFiles,
2327 setCachedStateField,
2428 className,
2529 ...props
2630} : ContextManagementSettingsProps ) => {
2731 return (
2832 < div className = { cn ( "flex flex-col gap-2" , className ) } { ...props } >
29- < SectionHeader >
33+ < SectionHeader description = "Control what information is included in the AI's context window, affecting token usage and response quality" >
3034 < div className = "flex items-center gap-2" >
3135 < Database className = "w-4" />
3236 < div > Context Management</ div >
@@ -48,6 +52,7 @@ export const ContextManagementSettings = ({
4852 setCachedStateField ( "terminalOutputLineLimit" , parseInt ( e . target . value ) )
4953 }
5054 className = "h-2 focus:outline-0 w-4/5 accent-vscode-button-background"
55+ data-testid = "terminal-output-limit-slider"
5156 />
5257 < span style = { { ...sliderLabelStyle } } > { terminalOutputLineLimit ?? 500 } </ span >
5358 </ div >
@@ -70,6 +75,7 @@ export const ContextManagementSettings = ({
7075 value = { maxOpenTabsContext ?? 20 }
7176 onChange = { ( e ) => setCachedStateField ( "maxOpenTabsContext" , parseInt ( e . target . value ) ) }
7277 className = "h-2 focus:outline-0 w-4/5 accent-vscode-button-background"
78+ data-testid = "open-tabs-limit-slider"
7379 />
7480 < span style = { { ...sliderLabelStyle } } > { maxOpenTabsContext ?? 20 } </ span >
7581 </ div >
@@ -80,12 +86,36 @@ export const ContextManagementSettings = ({
8086 </ p >
8187 </ div >
8288
89+ < div >
90+ < div className = "flex flex-col gap-2" >
91+ < span className = "font-medium" > Workspace files context limit</ span >
92+ < div className = "flex items-center gap-2" >
93+ < input
94+ type = "range"
95+ min = "0"
96+ max = "500"
97+ step = "1"
98+ value = { maxWorkspaceFiles ?? 200 }
99+ onChange = { ( e ) => setCachedStateField ( "maxWorkspaceFiles" , parseInt ( e . target . value ) ) }
100+ className = "h-2 focus:outline-0 w-4/5 accent-vscode-button-background"
101+ data-testid = "workspace-files-limit-slider"
102+ />
103+ < span style = { { ...sliderLabelStyle } } > { maxWorkspaceFiles ?? 200 } </ span >
104+ </ div >
105+ </ div >
106+ < p className = "text-vscode-descriptionForeground text-sm mt-0" >
107+ Maximum number of files to include in current working directory details. Higher values provide
108+ more context but increase token usage.
109+ </ p >
110+ </ div >
111+
83112 < div >
84113 < VSCodeCheckbox
85114 checked = { showRooIgnoredFiles }
86115 onChange = { ( e : any ) => {
87116 setCachedStateField ( "showRooIgnoredFiles" , e . target . checked )
88- } } >
117+ } }
118+ data-testid = "show-rooignored-files-checkbox" >
89119 < span className = "font-medium" > Show .rooignore'd files in lists and searches</ span >
90120 </ VSCodeCheckbox >
91121 < p className = "text-vscode-descriptionForeground text-sm mt-0" >
0 commit comments