File tree Expand file tree Collapse file tree
ui/src/components/editor/panel/ContextUtilisation
vscode/src/views/panel/frontend/Main/MainView Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import cn from 'classnames'
44type Props = {
55 current_context_size : number
66 context_size_warning_threshold : number
7+ is_context_disabled ?: boolean
78}
89
910const format_tokens = ( tokens : number ) : string => {
@@ -15,6 +16,17 @@ const format_tokens = (tokens: number): string => {
1516}
1617
1718export const ContextUtilisation : React . FC < Props > = ( props ) => {
19+ if ( props . is_context_disabled ) {
20+ return (
21+ < div className = { styles . container } >
22+ < div className = { styles . bar } />
23+ < span className = { styles . label } style = { { fontStyle : 'italic' } } >
24+ Context disabled
25+ </ span >
26+ </ div >
27+ )
28+ }
29+
1830 const is_above_threshold =
1931 props . current_context_size > props . context_size_warning_threshold
2032 const progress = Math . min (
Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ export const MainView: React.FC<Props> = (props) => {
108108 ( props . mode == MODE . WEB && props . web_prompt_type == 'edit-context' ) ||
109109 ( props . mode == MODE . API && props . api_prompt_type == 'edit-context' )
110110
111+ const is_in_no_context_prompt_type =
112+ props . mode == MODE . WEB && props . web_prompt_type == 'no-context'
113+
111114 const handle_input_change = ( value : string ) => {
112115 props . set_instructions ( value )
113116 }
@@ -229,6 +232,7 @@ export const MainView: React.FC<Props> = (props) => {
229232 context_size_warning_threshold = {
230233 props . context_size_warning_threshold
231234 }
235+ is_context_disabled = { is_in_no_context_prompt_type }
232236 />
233237 </ div >
234238
You can’t perform that action at this time.
0 commit comments