From de2fce4f6267e04c0796c330ad39f271386df5d3 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 19 Jun 2026 04:15:36 -0700 Subject: [PATCH] [eric] settings-agent: one settingSelectAttrs helper kills the per-row JSON drift + extends select-and-send across the whole General tab (Interface+Agent Defaults+Advanced, 16 fields) --- .../Settings/sections/general/GeneralAdvanced.tsx | 5 +++-- .../sections/general/GeneralAgentDefaults.tsx | 13 +++++++------ .../sections/general/GeneralInterface.tsx | 15 ++++++++------- .../app/pages/Settings/sections/settingSelect.ts | 11 +++++++++++ 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 frontend/src/app/pages/Settings/sections/settingSelect.ts diff --git a/frontend/src/app/pages/Settings/sections/general/GeneralAdvanced.tsx b/frontend/src/app/pages/Settings/sections/general/GeneralAdvanced.tsx index 01ce5b94..9b2ea089 100644 --- a/frontend/src/app/pages/Settings/sections/general/GeneralAdvanced.tsx +++ b/frontend/src/app/pages/Settings/sections/general/GeneralAdvanced.tsx @@ -12,6 +12,7 @@ import { useClaudeTokens } from '@/shared/styles/ThemeContext'; import TrustedFilePatterns from '@/app/components/overlays/TrustedFilePatterns'; import SoftwareUpdateRow from './SoftwareUpdateRow'; import type { SettingsStyles } from '../settingsStyles'; +import { settingSelectAttrs } from '../settingSelect'; const GeneralAdvanced: React.FC<{ form: AppSettings; @@ -38,7 +39,7 @@ const GeneralAdvanced: React.FC<{ <> Advanced - + Developer mode Show transport details, environment variables, raw configs, and other technical metadata throughout the app. @@ -53,7 +54,7 @@ const GeneralAdvanced: React.FC<{ /> - + Experimental updates Receive pre-release builds with new features earlier. These versions may be less stable than normal releases. diff --git a/frontend/src/app/pages/Settings/sections/general/GeneralAgentDefaults.tsx b/frontend/src/app/pages/Settings/sections/general/GeneralAgentDefaults.tsx index 88c663be..d02e9658 100644 --- a/frontend/src/app/pages/Settings/sections/general/GeneralAgentDefaults.tsx +++ b/frontend/src/app/pages/Settings/sections/general/GeneralAgentDefaults.tsx @@ -13,6 +13,7 @@ import { useAppDispatch } from '@/shared/hooks'; import { resetSystemPrompt, AppSettings, DEFAULT_SYSTEM_PROMPT } from '@/shared/state/settingsSlice'; import { useClaudeTokens } from '@/shared/styles/ThemeContext'; import type { SettingsStyles } from '../settingsStyles'; +import { settingSelectAttrs } from '../settingSelect'; type ModelOption = { value: string; label: string }; @@ -34,7 +35,7 @@ const GeneralAgentDefaults: React.FC<{ <> Agent Defaults - + System prompt {form.default_system_prompt !== DEFAULT_SYSTEM_PROMPT && ( @@ -79,7 +80,7 @@ const GeneralAgentDefaults: React.FC<{ /> - + Working directory Default folder agents start in. Modes can override per-mode. @@ -118,7 +119,7 @@ const GeneralAgentDefaults: React.FC<{ - + Model Default model for new sessions. @@ -199,7 +200,7 @@ const GeneralAgentDefaults: React.FC<{ - + Mode Default interaction mode for new sessions. @@ -218,7 +219,7 @@ const GeneralAgentDefaults: React.FC<{ - + Thinking Default thinking level for reasoning-capable models. @@ -239,7 +240,7 @@ const GeneralAgentDefaults: React.FC<{ - + Max turns Auto-stop after this many turns. Empty = unlimited. diff --git a/frontend/src/app/pages/Settings/sections/general/GeneralInterface.tsx b/frontend/src/app/pages/Settings/sections/general/GeneralInterface.tsx index bab1a19c..bf06cae0 100644 --- a/frontend/src/app/pages/Settings/sections/general/GeneralInterface.tsx +++ b/frontend/src/app/pages/Settings/sections/general/GeneralInterface.tsx @@ -13,6 +13,7 @@ import LanguageIcon from '@mui/icons-material/Language'; import { AppSettings } from '@/shared/state/settingsSlice'; import { useClaudeTokens } from '@/shared/styles/ThemeContext'; import type { SettingsStyles } from '../settingsStyles'; +import { settingSelectAttrs } from '../settingSelect'; const GeneralInterface: React.FC<{ form: AppSettings; @@ -27,7 +28,7 @@ const GeneralInterface: React.FC<{ <> Interface - + Theme Application color scheme. @@ -64,7 +65,7 @@ const GeneralInterface: React.FC<{ - + Zoom sensitivity Scroll-to-zoom responsiveness. Lower for trackpads, higher for mouse wheels. @@ -91,7 +92,7 @@ const GeneralInterface: React.FC<{ - + New agent shortcut Keyboard shortcut to create an agent. @@ -149,7 +150,7 @@ const GeneralInterface: React.FC<{ - + Auto-enable element selection Automatically enter element selection mode when creating a new agent. @@ -164,7 +165,7 @@ const GeneralInterface: React.FC<{ /> - + Default agent spawn state in dashboard When enabled, new agents spawn expanded instead of collapsed. @@ -179,7 +180,7 @@ const GeneralInterface: React.FC<{ /> - + Auto-reveal sub-agents on dashboard Automatically show sub-agent cards (from CreateAgent / InvokeAgent) tethered to their parent on the dashboard. @@ -196,7 +197,7 @@ const GeneralInterface: React.FC<{ Browser - + Default homepage URL loaded when opening a new browser card on the dashboard. diff --git a/frontend/src/app/pages/Settings/sections/settingSelect.ts b/frontend/src/app/pages/Settings/sections/settingSelect.ts new file mode 100644 index 00000000..b17e4a4e --- /dev/null +++ b/frontend/src/app/pages/Settings/sections/settingSelect.ts @@ -0,0 +1,11 @@ +// The data-select-* handle that makes a Settings row pointable by the chat +// element-selector. One source for it, spread onto a row's Box, so a row's label +// and its selection metadata can't drift apart (same args) and every section +// opts in the same way instead of copy-pasting the JSON.stringify. +export function settingSelectAttrs(field: string, name: string, category: string, description?: string) { + return { + 'data-select-type': 'settings-option', + 'data-select-id': field, + 'data-select-meta': JSON.stringify({ name, category, fieldName: field, description }), + }; +}