From 8f273b583dbc447425f189674264b8e67b895b68 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Wed, 29 Jul 2026 20:12:31 +0300 Subject: [PATCH] fix: hide system prompt optimization in VS Code Removes the system prompt optimization section from the Behavior page in VS Code runtime. Updates settings search so the hidden option is not shown as available in VS Code. --- .../sections/behavior/BehaviorPage.tsx | 54 ++++++++++--------- packages/ui/src/lib/settings/search.ts | 1 + 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/packages/ui/src/components/sections/behavior/BehaviorPage.tsx b/packages/ui/src/components/sections/behavior/BehaviorPage.tsx index a4f48e0f..d33fefc6 100644 --- a/packages/ui/src/components/sections/behavior/BehaviorPage.tsx +++ b/packages/ui/src/components/sections/behavior/BehaviorPage.tsx @@ -4,6 +4,7 @@ import { Textarea } from '@/components/ui/textarea'; import { toast } from '@/components/ui'; import { useI18n, type I18nKey } from '@/lib/i18n'; import { reportSettingsSaveState } from '@/lib/persistence'; +import { useIsVSCodeRuntime } from '@/hooks/useRuntimeAPIs'; import { Select, SelectContent, @@ -101,6 +102,7 @@ const saveBehaviorSetting = async (settings: Partial, fallbackE export const BehaviorPage: React.FC = () => { const { t } = useI18n(); + const isVSCode = useIsVSCodeRuntime(); const [prompt, setPrompt] = React.useState(''); const [optimizeSystemPrompt, setOptimizeSystemPrompt] = React.useState(false); const [responseStyleEnabled, setResponseStyleEnabled] = React.useState(DEFAULT_BEHAVIOR_SETTINGS.responseStyleEnabled); @@ -291,32 +293,34 @@ export const BehaviorPage: React.FC = () => { description={t('settings.page.behavior.description')} showSaveStatus > - - - - + + + + )} !ctx.isVSCode, }, { id: 'behavior.system-prompt',