From 1a66cc99a031f62315638fead9c3c94a1feb52fa Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Thu, 7 May 2026 19:35:13 -0700 Subject: [PATCH] ui(orca-yaml): differentiate first-time vs re-prompt trust dialogs (#1556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The orca.yaml trust dialog now adapts copy and layout based on whether this is a first-time approval or a re-prompt after the script changed. Re-prompts lead with ''s setup script changed — run the new version?' so users understand why they're being asked again. Restyles the 'always trust' checkbox as a card and threads a previouslyApproved flag from ensureHooksConfirmed into the dialog. Co-authored-by: Orca --- .../sidebar/OrcaYamlTrustDialog.tsx | 35 ++++++++++++++----- .../src/lib/ensure-hooks-confirmed.test.ts | 6 +++- .../src/lib/ensure-hooks-confirmed.ts | 4 +++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/components/sidebar/OrcaYamlTrustDialog.tsx b/src/renderer/src/components/sidebar/OrcaYamlTrustDialog.tsx index 07480ee77..f8c7eef4e 100644 --- a/src/renderer/src/components/sidebar/OrcaYamlTrustDialog.tsx +++ b/src/renderer/src/components/sidebar/OrcaYamlTrustDialog.tsx @@ -45,6 +45,7 @@ const OrcaYamlTrustDialog = React.memo(function OrcaYamlTrustDialog() { : 'setup' const scriptContent = typeof modalData.scriptContent === 'string' ? modalData.scriptContent : '' const contentHash = typeof modalData.contentHash === 'string' ? modalData.contentHash : '' + const previouslyApproved = modalData.previouslyApproved === true const onResolve = typeof modalData.onResolve === 'function' ? (modalData.onResolve as (decision: 'run' | 'skip') => void) @@ -94,19 +95,29 @@ const OrcaYamlTrustDialog = React.memo(function OrcaYamlTrustDialog() { - Run {SCRIPT_KIND_LABEL[scriptKind]} from {repoName}? + {previouslyApproved + ? `${repoName}'s ${SCRIPT_KIND_LABEL[scriptKind]} changed — run the new version?` + : `Run ${SCRIPT_KIND_LABEL[scriptKind]} from ${repoName}?`} - This repository's orca.yaml defines a {SCRIPT_KIND_LABEL[scriptKind]}{' '} - that will execute on your machine {SCRIPT_KIND_TRIGGER[scriptKind]}. Only run it if you - trust the contents of this repository. + {previouslyApproved ? ( + <> + orca.yaml changed since you last approved. Re-review before it runs{' '} + {SCRIPT_KIND_TRIGGER[scriptKind]}. + + ) : ( + <> + This repository's orca.yaml runs on your machine{' '} + {SCRIPT_KIND_TRIGGER[scriptKind]}. Only run if you trust {repoName}. + + )} {scriptContent && (
- {scriptKind} script + {previouslyApproved ? `New ${scriptKind} script` : `${scriptKind} script`}
               {scriptContent}
@@ -114,15 +125,21 @@ const OrcaYamlTrustDialog = React.memo(function OrcaYamlTrustDialog() {
           
)} -