From cc37865c2defa56cd753dfc6bf61e7371fa3f059 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 15 Feb 2026 00:02:01 -0800 Subject: [PATCH] Show push target in Git action progress stages - Include branch-based remote target in push progress text - Update logic and tests for commit+push and force-push flows --- .../web/src/components/GitActionsControl.logic.test.ts | 10 ++++++++-- apps/web/src/components/GitActionsControl.logic.ts | 6 ++++-- apps/web/src/components/GitActionsControl.tsx | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/GitActionsControl.logic.test.ts b/apps/web/src/components/GitActionsControl.logic.test.ts index 25ad553d1deb7d68135908d27e0916c0b6b2dd21..85e020178d40df42759db7331e8323b12800e28a 100644 --- a/apps/web/src/components/GitActionsControl.logic.test.ts +++ b/apps/web/src/components/GitActionsControl.logic.test.ts @@ -604,8 +604,9 @@ describe("buildGitActionProgressStages", () => { hasCustomCommitMessage: false, hasWorkingTreeChanges: true, forcePushOnly: true, + pushTarget: "origin/feature/test", }); - assert.deepEqual(stages, ["Pushing..."]); + assert.deepEqual(stages, ["Pushing to origin/feature/test..."]); }); it("includes commit stages for commit+push when working tree is dirty", () => { @@ -613,8 +614,13 @@ describe("buildGitActionProgressStages", () => { action: "commit_push", hasCustomCommitMessage: false, hasWorkingTreeChanges: true, + pushTarget: "origin/feature/test", }); - assert.deepEqual(stages, ["Generating commit message...", "Committing...", "Pushing..."]); + assert.deepEqual(stages, [ + "Generating commit message...", + "Committing...", + "Pushing to origin/feature/test...", + ]); }); }); diff --git a/apps/web/src/components/GitActionsControl.logic.ts b/apps/web/src/components/GitActionsControl.logic.ts index ebab3cbf5a8ed7921003a8f17a0e60ed1602aeb4..f05db2462c6107b1ef7759d63cf6c609a936a860 100644 --- a/apps/web/src/components/GitActionsControl.logic.ts +++ b/apps/web/src/components/GitActionsControl.logic.ts @@ -48,6 +48,7 @@ export function buildGitActionProgressStages(input: { hasCustomCommitMessage: boolean; hasWorkingTreeChanges: boolean; forcePushOnly?: boolean; + pushTarget?: string; }): string[] { const shouldIncludeCommitStages = !input.forcePushOnly && (input.action === "commit" || input.hasWorkingTreeChanges); @@ -56,13 +57,14 @@ export function buildGitActionProgressStages(input: { : input.hasCustomCommitMessage ? ["Committing..."] : ["Generating commit message...", "Committing..."]; + const pushStage = input.pushTarget ? `Pushing to ${input.pushTarget}...` : "Pushing..."; if (input.action === "commit") { return commitStages; } if (input.action === "commit_push") { - return [...commitStages, "Pushing..."]; + return [...commitStages, pushStage]; } - return [...commitStages, "Pushing...", "Creating PR..."]; + return [...commitStages, pushStage, "Creating PR..."]; } export function summarizeGitResult(result: GitRunStackedActionResult): { diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 8c6b010341fac50db30dd772fff2c7770eab16c1..001559c7c1cd6c4ca4d427e95c56cf6c37f372a2 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -226,11 +226,13 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp if (!confirmed) return; onConfirmed?.(); + const pushTarget = gitStatus?.branch ? `origin/${gitStatus.branch}` : undefined; const progressStages = buildGitActionProgressStages({ action, hasCustomCommitMessage: !!commitMessage?.trim(), hasWorkingTreeChanges: !!gitStatus?.hasWorkingTreeChanges, forcePushOnly: forcePushOnlyProgress, + pushTarget, }); const progressToastId = toastManager.add({ type: "loading", -- 2.54.0