diff --git a/ui/src/components/profiles/editor/index.tsx b/ui/src/components/profiles/editor/index.tsx index c356efd9..01fc8b5b 100644 --- a/ui/src/components/profiles/editor/index.tsx +++ b/ui/src/components/profiles/editor/index.tsx @@ -67,6 +67,13 @@ export function ProfileEditor({ profileName, onDelete }: ProfileEditorProps) { setRawJsonEdits(JSON.stringify({ ...currentSettings, env: newEnv }, null, 2)); }; + // Bulk update multiple env vars at once (avoids race conditions) + const updateEnvBulk = (env: Record) => { + const newEnv = { ...(currentSettings?.env || {}), ...env }; + setLocalEdits((prev) => ({ ...prev, ...env })); + setRawJsonEdits(JSON.stringify({ ...currentSettings, env: newEnv }, null, 2)); + }; + const addNewEnvVar = () => { if (!newEnvKey.trim()) return; const key = newEnvKey.trim(); @@ -179,6 +186,7 @@ export function ProfileEditor({ profileName, onDelete }: ProfileEditorProps) { onNewEnvKeyChange={setNewEnvKey} onNewEnvValueChange={setNewEnvValue} onEnvValueChange={updateEnvValue} + onEnvBulkChange={updateEnvBulk} onAddEnvVar={addNewEnvVar} />