From e4df6fcf8e90127764005858878dad7a55ebc8c4 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 2 Mar 2026 19:49:54 -0800 Subject: [PATCH] Scope default-branch PR confirmation to full stack Co-authored-by: codex --- apps/web/src/components/GitActionsControl.logic.test.ts | 4 ++-- apps/web/src/components/GitActionsControl.logic.ts | 2 +- apps/web/src/components/GitActionsControl.tsx | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/GitActionsControl.logic.test.ts b/apps/web/src/components/GitActionsControl.logic.test.ts index 451f496fba283b934cb863b0c5daf001a7e971e6..628f2f359e119eb562b972a2b3b627b2eaa737be 100644 --- a/apps/web/src/components/GitActionsControl.logic.test.ts +++ b/apps/web/src/components/GitActionsControl.logic.test.ts @@ -737,10 +737,10 @@ describe("when: branch has no upstream configured", () => { }); describe("requiresDefaultBranchConfirmation", () => { - it("requires confirmation only for direct push on default branch", () => { + it("requires confirmation for push actions on default branch", () => { assert.isFalse(requiresDefaultBranchConfirmation("commit", true)); assert.isTrue(requiresDefaultBranchConfirmation("commit_push", true)); - assert.isFalse(requiresDefaultBranchConfirmation("commit_push_pr", true)); + assert.isTrue(requiresDefaultBranchConfirmation("commit_push_pr", true)); assert.isFalse(requiresDefaultBranchConfirmation("commit_push", false)); }); }); diff --git a/apps/web/src/components/GitActionsControl.logic.ts b/apps/web/src/components/GitActionsControl.logic.ts index d752a90ce202172db76cb14bd437ecc740f4bdca..9a9476e4cea571851055b7a80693d94c4e0a61cb 100644 --- a/apps/web/src/components/GitActionsControl.logic.ts +++ b/apps/web/src/components/GitActionsControl.logic.ts @@ -282,7 +282,7 @@ export function requiresDefaultBranchConfirmation( isDefaultBranch: boolean, ): boolean { if (!isDefaultBranch) return false; - return action === "commit_push"; + return action === "commit_push" || action === "commit_push_pr"; } export function resolveDefaultBranchActionDialogCopy(input: { diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 216e123c8c644f11cf5a0c8b961537f0a3505d81..f0819bb22e2108381e13f9bee70f69de716d717f 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -347,6 +347,7 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions action: "commit_push", forcePushOnlyProgress: true, onConfirmed: closeResultToast, + featureBranch, }); }, }, @@ -372,6 +373,7 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions void runGitActionWithToast({ action: "commit_push_pr", forcePushOnlyProgress: true, + featureBranch, }); }, }, -- 2.54.0