Skip commit progress stages when no files changed
- Only include commit-related progress steps for stacked actions when there are working tree changes - Prevents showing "Generating commit message"/"Committing" during pure push or PR flows
This commit is contained in:
1 parent
c0bdd46ddd
commit
8bbba3d358
1 file changed
+9
-3
@@ -124,10 +124,14 @@ function GitQuickActionIcon({ quickAction }: { quickAction: GitQuickAction }) {
|
||||
function buildGitActionProgressStages(input: {
|
||||
action: GitStackedAction;
|
||||
hasCustomCommitMessage: boolean;
|
||||
hasWorkingTreeChanges: boolean;
|
||||
}): string[] {
|
||||
const commitStages = input.hasCustomCommitMessage
|
||||
? ["Committing..."]
|
||||
: ["Generating commit message...", "Committing..."];
|
||||
const shouldIncludeCommitStages = input.action === "commit" || input.hasWorkingTreeChanges;
|
||||
const commitStages = !shouldIncludeCommitStages
|
||||
? []
|
||||
: input.hasCustomCommitMessage
|
||||
? ["Committing..."]
|
||||
: ["Generating commit message...", "Committing..."];
|
||||
if (input.action === "commit") {
|
||||
return commitStages;
|
||||
}
|
||||
@@ -229,6 +233,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
|
||||
const progressStages = buildGitActionProgressStages({
|
||||
action,
|
||||
hasCustomCommitMessage: !!commitMessage?.trim(),
|
||||
hasWorkingTreeChanges: !!gitStatus?.hasWorkingTreeChanges,
|
||||
});
|
||||
const progressToastId = toastManager.add({
|
||||
type: "loading",
|
||||
@@ -306,6 +311,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
|
||||
},
|
||||
[
|
||||
api,
|
||||
gitStatus?.hasWorkingTreeChanges,
|
||||
gitStatus?.openPr?.url,
|
||||
maybeConfirmPushToDefaultBranch,
|
||||
runImmediateGitActionMutation,
|
||||
|
||||
Reference in new issue
Block a user