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 25, 18:30 UTC
Hide PR CTAs on default branch and make git invalidation non-blocking
- Only show open/create PR actions after push on non-default branches - Fire git query invalidation without awaiting mutation success handlers - Tweak disabled button classes to keep split-button borders/radii aligned
Julius Marminge committed
Feb 14, 2026 at 23:53 UTC
1fe3cf53a7ea192bc1b440dfeb5c6a3b3a75b12d
2 files changed
+8
-7
apps/web/src/components/GitActionsControl.tsx
+4
-3
@@ -272,9 +272,9 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
272
const prUrl = result.pr.url ?? gitStatus?.openPr?.url;
273
const shouldOfferPushCta = action === "commit" && result.commit.status === "created";
274
const shouldOfferOpenPrCta =
275
- (action === "commit_push" || action === "commit_push_pr") && !!prUrl;
275
+ (action === "commit_push" || action === "commit_push_pr") && !!prUrl && !isDefaultBranch;
276
const shouldOfferCreatePrCta =
277
- action === "commit_push" && !prUrl && result.push.status === "pushed";
277
+ action === "commit_push" && !prUrl && result.push.status === "pushed" && !isDefaultBranch;
278
const closeResultToast = () => {
279
toastManager.close(progressToastId);
280
};
@@ -329,6 +329,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
329
api,
330
gitStatus?.hasWorkingTreeChanges,
331
gitStatus?.openPr?.url,
332
+ isDefaultBranch,
333
maybeConfirmPushToDefaultBranch,
334
runImmediateGitActionMutation,
335
setActiveDialogAction,
@@ -449,7 +450,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
450
render={
451
<Button
452
aria-disabled="true"
452
- className="cursor-not-allowed opacity-64"
453
+ className="cursor-not-allowed rounded-e-none border-e-0 opacity-64 before:rounded-e-none"
454
size="xs"
455
variant="outline"
456
/>
apps/web/src/lib/gitReactQuery.ts
+4
-4
@@ -108,8 +108,8 @@ export function gitRunStackedActionMutationOptions(input: {
108
...(commitMessage ? { commitMessage } : {}),
109
});
110
},
111
- onSuccess: async () => {
112
- await invalidateGitQueries(input.queryClient);
111
+ onSuccess: () => {
112
+ void invalidateGitQueries(input.queryClient);
113
},
114
});
115
}
@@ -124,8 +124,8 @@ export function gitPullMutationOptions(input: {
124
if (!input.api || !input.cwd) throw new Error("Git pull is unavailable.");
125
return input.api.git.pull({ cwd: input.cwd });
126
},
127
- onSuccess: async () => {
128
- await invalidateGitQueries(input.queryClient);
127
+ onSuccess: () => {
128
+ void invalidateGitQueries(input.queryClient);
129
},
130
});
131
}