@@ -10,7 +10,8 @@ import { useEvent } from "react-use"
1010import { ExtensionMessage } from "@shared/ExtensionMessage"
1111import BrowserSettingsSection from "./BrowserSettingsSection"
1212import TerminalSettingsSection from "./TerminalSettingsSection"
13-
13+ import { useFeatureFlag } from "@/hooks/useFeatureFlag"
14+ import { FEATURE_FLAGS } from "@shared/services/feature-flags/feature-flags"
1415const { IS_DEV } = process . env
1516
1617type SettingsViewProps = {
@@ -82,16 +83,16 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
8283
8384 // validate as soon as the component is mounted
8485 /*
85- useEffect will use stale values of variables if they are not included in the dependency array.
86- so trying to use useEffect with a dependency array of only one value for example will use any
87- other variables' old values. In most cases you don't want this, and should opt to use react-use
88- hooks.
86+ useEffect will use stale values of variables if they are not included in the dependency array.
87+ so trying to use useEffect with a dependency array of only one value for example will use any
88+ other variables' old values. In most cases you don't want this, and should opt to use react-use
89+ hooks.
8990
90- // uses someVar and anotherVar
91- // eslint-disable-next-line react-hooks/exhaustive-deps
92- }, [someVar])
91+ // uses someVar and anotherVar
92+ // eslint-disable-next-line react-hooks/exhaustive-deps
93+ }, [someVar])
9394 If we only want to run code once on mount we can use react-use's useEffectOnce or useMount
94- */
95+ */
9596
9697 const handleMessage = useCallback (
9798 ( event : MessageEvent ) => {
@@ -145,6 +146,8 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
145146 handleSubmit ( true )
146147 }
147148
149+ const showCustomInstructions = useFeatureFlag ( FEATURE_FLAGS . CUSTOM_INSTRUCTIONS )
150+
148151 return (
149152 < div className = "fixed top-0 left-0 right-0 bottom-0 pt-[10px] pr-0 pb-0 pl-5 flex flex-col overflow-hidden" >
150153 < div className = "flex justify-between items-center mb-[13px] pr-[17px]" >
@@ -183,20 +186,24 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
183186 />
184187 ) }
185188
186- < div className = "mb-[5px]" >
187- < VSCodeTextArea
188- value = { customInstructions ?? "" }
189- className = "w-full"
190- resize = "vertical"
191- rows = { 4 }
192- placeholder = { 'e.g. "Run unit tests at the end", "Use TypeScript with async/await", "Speak in Spanish"' }
193- onInput = { ( e : any ) => setCustomInstructions ( e . target ?. value ?? "" ) } >
194- < span className = "font-medium" > Custom Instructions</ span >
195- </ VSCodeTextArea >
196- < p className = "text-xs mt-[5px] text-[var(--vscode-descriptionForeground)]" >
197- These instructions are added to the end of the system prompt sent with every request.
198- </ p >
199- </ div >
189+ { showCustomInstructions && (
190+ < div className = "mb-[5px]" >
191+ < VSCodeTextArea
192+ value = { customInstructions ?? "" }
193+ className = "w-full"
194+ resize = "vertical"
195+ rows = { 4 }
196+ placeholder = {
197+ 'e.g. "Run unit tests at the end", "Use TypeScript with async/await", "Speak in Spanish"'
198+ }
199+ onInput = { ( e : any ) => setCustomInstructions ( e . target ?. value ?? "" ) } >
200+ < span className = "font-medium" > Custom Instructions</ span >
201+ </ VSCodeTextArea >
202+ < p className = "text-xs mt-[5px] text-[var(--vscode-descriptionForeground)]" >
203+ These instructions are added to the end of the system prompt sent with every request.
204+ </ p >
205+ </ div >
206+ ) }
200207
201208 < div className = "mb-[5px]" >
202209 < VSCodeCheckbox
0 commit comments