- Include branch-based remote target in push progress text - Update logic and tests for commit+push and force-push flows
Unified · Split
| @@ -604,8 +604,9 @@ describe("buildGitActionProgressStages", () => { · 603 unmodified lines | ||
| 604 | 604 | hasCustomCommitMessage: false, |
| 605 | 605 | hasWorkingTreeChanges: true, |
| 606 | 606 | forcePushOnly: true, |
| 607 | + pushTarget: "origin/feature/test", | |
| 607 | 608 | }); |
| 608 | − assert.deepEqual(stages, ["Pushing..."]); | |
| 609 | + assert.deepEqual(stages, ["Pushing to origin/feature/test..."]); | |
| 609 | 610 | }); |
| 610 | 611 | |
| 611 | 612 | it("includes commit stages for commit+push when working tree is dirty", () => { |
| @@ -613,8 +614,13 @@ describe("buildGitActionProgressStages", () => { · 1 unmodified line | ||
| 613 | 614 | action: "commit_push", |
| 614 | 615 | hasCustomCommitMessage: false, |
| 615 | 616 | hasWorkingTreeChanges: true, |
| 617 | + pushTarget: "origin/feature/test", | |
| 616 | 618 | }); |
| 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 | + ]); | |
| 618 | 624 | }); |
| 619 | 625 | }); |
| 620 | 626 | |
| @@ -48,6 +48,7 @@ export function buildGitActionProgressStages(input: { · 47 unmodified lines | ||
| 48 | 48 | hasCustomCommitMessage: boolean; |
| 49 | 49 | hasWorkingTreeChanges: boolean; |
| 50 | 50 | forcePushOnly?: boolean; |
| 51 | + pushTarget?: string; | |
| 51 | 52 | }): string[] { |
| 52 | 53 | const shouldIncludeCommitStages = |
| 53 | 54 | !input.forcePushOnly && (input.action === "commit" || input.hasWorkingTreeChanges); |
| @@ -56,13 +57,14 @@ export function buildGitActionProgressStages(input: { · 2 unmodified lines | ||
| 56 | 57 | : input.hasCustomCommitMessage |
| 57 | 58 | ? ["Committing..."] |
| 58 | 59 | : ["Generating commit message...", "Committing..."]; |
| 60 | + const pushStage = input.pushTarget ? `Pushing to ${input.pushTarget}...` : "Pushing..."; | |
| 59 | 61 | if (input.action === "commit") { |
| 60 | 62 | return commitStages; |
| 61 | 63 | } |
| 62 | 64 | if (input.action === "commit_push") { |
| 63 | − return [...commitStages, "Pushing..."]; | |
| 65 | + return [...commitStages, pushStage]; | |
| 64 | 66 | } |
| 65 | − return [...commitStages, "Pushing...", "Creating PR..."]; | |
| 67 | + return [...commitStages, pushStage, "Creating PR..."]; | |
| 66 | 68 | } |
| 67 | 69 | |
| 68 | 70 | export function summarizeGitResult(result: GitRunStackedActionResult): { |
| @@ -226,11 +226,13 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp · 225 unmodified lines | ||
| 226 | 226 | if (!confirmed) return; |
| 227 | 227 | onConfirmed?.(); |
| 228 | 228 | |
| 229 | + const pushTarget = gitStatus?.branch ? `origin/${gitStatus.branch}` : undefined; | |
| 229 | 230 | const progressStages = buildGitActionProgressStages({ |
| 230 | 231 | action, |
| 231 | 232 | hasCustomCommitMessage: !!commitMessage?.trim(), |
| 232 | 233 | hasWorkingTreeChanges: !!gitStatus?.hasWorkingTreeChanges, |
| 233 | 234 | forcePushOnly: forcePushOnlyProgress, |
| 235 | + pushTarget, | |
| 234 | 236 | }); |
| 235 | 237 | const progressToastId = toastManager.add({ |
| 236 | 238 | type: "loading", |