From aff56c22972dd2e20002d4c9ed38a23b7a21af67 Mon Sep 17 00:00:00 2001 From: dotta Date: Sun, 5 Apr 2026 07:39:38 -0500 Subject: [PATCH] Copy inherited config as default when unchecking inherit checkbox When unchecking the "Inherit project workspace runtime config" checkbox, if the runtime config field is empty, automatically populate it with the inherited config value so the user has a starting point to edit from. Existing values are preserved and never overwritten. Co-Authored-By: Paperclip --- ui/src/pages/ExecutionWorkspaceDetail.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ui/src/pages/ExecutionWorkspaceDetail.tsx b/ui/src/pages/ExecutionWorkspaceDetail.tsx index a031ed84..b166e432 100644 --- a/ui/src/pages/ExecutionWorkspaceDetail.tsx +++ b/ui/src/pages/ExecutionWorkspaceDetail.tsx @@ -547,9 +547,17 @@ export function ExecutionWorkspaceDetail() { id="inherit-runtime-config" type="checkbox" checked={form.inheritRuntime} - onChange={(event) => - setForm((current) => current ? { ...current, inheritRuntime: event.target.checked } : current) - } + onChange={(event) => { + const checked = event.target.checked; + setForm((current) => { + if (!current) return current; + // When unchecking "inherit" and the field is empty, copy inherited config as a starting point + if (!checked && !current.workspaceRuntime.trim() && inheritedRuntimeConfig) { + return { ...current, inheritRuntime: checked, workspaceRuntime: formatJson(inheritedRuntimeConfig) }; + } + return { ...current, inheritRuntime: checked }; + }); + }} />