The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 08:30 UTC
fix(mobile): fully pushed feature branch offers Create PR (#38182)
Co-authored-by: Grok 4.7 <noreply@x.ai> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Wout Stiens committed
Nov 17, 2026 at 17:30 UTC
ffc5bbffb03d81330acfefed9bfdbc60c87b85b6
2 files changed
+20
packages/client-runtime/src/state/gitActions.test.ts
+10
@@ -78,6 +78,16 @@ describe("git action copy", () => {
78
).toBe("No local commits to include in an MR.");
79
});
80
81
+ it("offers creating a PR after the feature branch has been fully pushed", () => {
82
+ const pushed = status({ aheadCount: 0, behindCount: 0, aheadOfDefaultCount: 1 });
83
+ expect(resolveQuickAction(pushed, false)).toMatchObject({
84
+ disabled: false,
85
+ kind: "run_action",
86
+ action: "create_pr",
87
+ });
88
+ expect(resolveQuickAction({ ...pushed, isDefaultRef: true }, false, true).disabled).toBe(true);
89
+ });
90
+
91
it("names the host's change request in the default-branch dialog", () => {
92
const input = { action: "commit_push_pr", branchName: "main", includesCommit: true } as const;
93
expect(
packages/client-runtime/src/state/gitActions.ts
+10
@@ -138,6 +138,7 @@ export function resolveQuickAction(
138
const hasChanges = gitStatus.hasWorkingTreeChanges;
139
const hasOpenPr = gitStatus.pr?.state === "open";
140
const isAhead = gitStatus.aheadCount > 0;
141
+ const hasDefaultBranchDelta = (gitStatus.aheadOfDefaultCount ?? gitStatus.aheadCount) > 0;
142
const isBehind = gitStatus.behindCount > 0;
143
const isDiverged = isAhead && isBehind;
144
const terminology = changeRequestTerminologyFor(gitStatus);
@@ -243,6 +244,15 @@ export function resolveQuickAction(
244
return { label: `View ${terminology.shortLabel}`, disabled: false, kind: "open_pr" };
245
}
246
247
+ if (hasDefaultBranchDelta && !isDefaultBranch) {
248
+ return {
249
+ label: `Create ${terminology.shortLabel}`,
250
+ disabled: false,
251
+ kind: "run_action",
252
+ action: "create_pr",
253
+ };
254
+ }
255
+
256
return {
257
label: "Commit",
258
disabled: true,