authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-15 00:02:01-08:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-15 00:02:01-08:00
logcc37865c2defa56cd753dfc6bf61e7371fa3f059
tree89f8c39c331f690f800b59b1b89d6247ce498a0b
parenta6b9ece840989e615e3cfc443524d71f4cac6f42

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

3 files changed, 14 insertions(+), 4 deletions(-)

apps/web/src/components/GitActionsControl.logic.test.ts+8-2
......@@ -604,8 +604,9 @@ describe("buildGitActionProgressStages", () => {
604604 hasCustomCommitMessage: false,
605605 hasWorkingTreeChanges: true,
606606 forcePushOnly: true,
607 pushTarget: "origin/feature/test",
607608 });
608 assert.deepEqual(stages, ["Pushing..."]);
609 assert.deepEqual(stages, ["Pushing to origin/feature/test..."]);
609610 });
610611
611612 it("includes commit stages for commit+push when working tree is dirty", () => {
......@@ -613,8 +614,13 @@ describe("buildGitActionProgressStages", () => {
613614 action: "commit_push",
614615 hasCustomCommitMessage: false,
615616 hasWorkingTreeChanges: true,
617 pushTarget: "origin/feature/test",
616618 });
617 assert.deepEqual(stages, ["Generating commit message...", "Committing...", "Pushing..."]);
619 assert.deepEqual(stages, [
620 "Generating commit message...",
621 "Committing...",
622 "Pushing to origin/feature/test...",
623 ]);
618624 });
619625});
620626
apps/web/src/components/GitActionsControl.logic.ts+4-2
......@@ -48,6 +48,7 @@ export function buildGitActionProgressStages(input: {
4848 hasCustomCommitMessage: boolean;
4949 hasWorkingTreeChanges: boolean;
5050 forcePushOnly?: boolean;
51 pushTarget?: string;
5152}): string[] {
5253 const shouldIncludeCommitStages =
5354 !input.forcePushOnly && (input.action === "commit" || input.hasWorkingTreeChanges);
......@@ -56,13 +57,14 @@ export function buildGitActionProgressStages(input: {
5657 : input.hasCustomCommitMessage
5758 ? ["Committing..."]
5859 : ["Generating commit message...", "Committing..."];
60 const pushStage = input.pushTarget ? `Pushing to ${input.pushTarget}...` : "Pushing...";
5961 if (input.action === "commit") {
6062 return commitStages;
6163 }
6264 if (input.action === "commit_push") {
63 return [...commitStages, "Pushing..."];
65 return [...commitStages, pushStage];
6466 }
65 return [...commitStages, "Pushing...", "Creating PR..."];
67 return [...commitStages, pushStage, "Creating PR..."];
6668}
6769
6870export function summarizeGitResult(result: GitRunStackedActionResult): {
apps/web/src/components/GitActionsControl.tsx+2
......@@ -226,11 +226,13 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
226226 if (!confirmed) return;
227227 onConfirmed?.();
228228
229 const pushTarget = gitStatus?.branch ? `origin/${gitStatus.branch}` : undefined;
229230 const progressStages = buildGitActionProgressStages({
230231 action,
231232 hasCustomCommitMessage: !!commitMessage?.trim(),
232233 hasWorkingTreeChanges: !!gitStatus?.hasWorkingTreeChanges,
233234 forcePushOnly: forcePushOnlyProgress,
235 pushTarget,
234236 });
235237 const progressToastId = toastManager.add({
236238 type: "loading",