The best way to control Claude Code, Codex and more from any computer or phone
fix(web): Push on the default branch no longer offers a feature branch the server rejects (#29845)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Alex Southwell committed
Nov 15, 2026 at 02:51 UTC
170c1f7e2d3e6b34f4fc61fb4d31cb5f44c71d01
3 files changed
+22
-3
apps/web/src/components/GitActionsControl.logic.test.ts
+12
@@ -4,10 +4,12 @@ import { resolveAutoFeatureBranchName } from "@t3tools/shared/git";
4
import { assert, describe, it } from "vite-plus/test";
5
import {
6
buildMenuItems,
7
+ type DefaultBranchConfirmableAction,
8
hasUsableGitMenuContent,
9
requiresDefaultBranchConfirmation,
10
resolveChangesTotals,
11
resolveDefaultBranchActionDialogCopy,
12
+ resolveFeatureBranchUnavailableReason,
13
resolveLiveThreadBranchUpdate,
14
resolveQuickAction,
15
getMenuActionDisabledReason,
@@ -125,6 +127,16 @@ describe("when: on default ref without open PR", () => {
127
disabled: false,
128
});
129
});
130
+
131
+ it("offers a feature branch only to actions that commit the changes", () => {
132
+ const reason = (action: DefaultBranchConfirmableAction, hasWorkingTreeChanges: boolean) =>
133
+ resolveFeatureBranchUnavailableReason({ action, branchName: "main", hasWorkingTreeChanges });
134
+ assert.isNull(reason("commit_push", true));
135
+ assert.isNull(reason("commit_push_pr", true));
136
+ assert.isNotNull(reason("commit_push", false));
137
+ assert.isNotNull(reason("push", true));
138
+ assert.isNotNull(reason("create_pr", true));
139
+ });
140
});
141
142
describe("when: local changes are behind upstream", () => {
apps/web/src/components/GitActionsControl.logic.ts
+9
-3
@@ -438,13 +438,19 @@ export function resolveDefaultBranchActionDialogCopy(input: {
438
};
439
}
440
441
-/** Clean trees cannot create feature branches because the server derives names from uncommitted changes. */
441
+/** The server names a feature branch from the commit it makes, so the action must commit changes. */
442
export function resolveFeatureBranchUnavailableReason(input: {
443
+ action: DefaultBranchConfirmableAction;
444
branchName: string;
445
hasWorkingTreeChanges: boolean;
446
}): string | null {
446
- if (input.hasWorkingTreeChanges) return null;
447
- return `There are no changes to commit, so a feature branch can't be named. Create a branch yourself or continue on ${input.branchName}.`;
447
+ if (!input.hasWorkingTreeChanges) {
448
+ return `There are no changes to commit, so a feature branch can't be named. Create a branch yourself or continue on ${input.branchName}.`;
449
+ }
450
+ if (input.action === "push" || input.action === "create_pr") {
451
+ return `This action doesn't commit your changes, so a feature branch can't be named. Create a branch yourself or continue on ${input.branchName}.`;
452
+ }
453
+ return null;
454
}
455
456
export function resolveThreadBranchUpdate(
apps/web/src/components/GitActionsControl.tsx
+1
@@ -1184,6 +1184,7 @@ export default function GitActionsControl({
1184
// Keep enabled until live status loads; the server rejects stale requests.
1185
const featureBranchUnavailableReason = pendingDefaultBranchAction
1186
? resolveFeatureBranchUnavailableReason({
1187
+ action: pendingDefaultBranchAction.action,
1188
branchName: pendingDefaultBranchAction.branchName,
1189
hasWorkingTreeChanges: gitStatus?.hasWorkingTreeChanges ?? true,
1190
})