Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Hide PR CTAs on default branch and make git invalidation non-blocking

Julius Marminge1fe3cf53a7ea
diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx
index 27d9bb68c..c9c84f41b 100644
--- a/apps/web/src/components/GitActionsControl.tsx
+++ b/apps/web/src/components/GitActionsControl.tsx
@@ -272,9 +272,9 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
const prUrl = result.pr.url ?? gitStatus?.openPr?.url;
const shouldOfferPushCta = action === "commit" && result.commit.status === "created";
const shouldOfferOpenPrCta =
- (action === "commit_push" || action === "commit_push_pr") && !!prUrl;
+ (action === "commit_push" || action === "commit_push_pr") && !!prUrl && !isDefaultBranch;
const shouldOfferCreatePrCta =
- action === "commit_push" && !prUrl && result.push.status === "pushed";
+ action === "commit_push" && !prUrl && result.push.status === "pushed" && !isDefaultBranch;
const closeResultToast = () => {
toastManager.close(progressToastId);
};
@@ -329,6 +329,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
api,
gitStatus?.hasWorkingTreeChanges,
gitStatus?.openPr?.url,
+ isDefaultBranch,
maybeConfirmPushToDefaultBranch,
runImmediateGitActionMutation,
setActiveDialogAction,
@@ -449,7 +450,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
render={
<Button
aria-disabled="true"
- className="cursor-not-allowed opacity-64"
+ className="cursor-not-allowed rounded-e-none border-e-0 opacity-64 before:rounded-e-none"
size="xs"
variant="outline"
/>
diff --git a/apps/web/src/lib/gitReactQuery.ts b/apps/web/src/lib/gitReactQuery.ts
index aef487654..1d9fd23f9 100644
--- a/apps/web/src/lib/gitReactQuery.ts
+++ b/apps/web/src/lib/gitReactQuery.ts
@@ -108,8 +108,8 @@ export function gitRunStackedActionMutationOptions(input: {
...(commitMessage ? { commitMessage } : {}),
});
},
- onSuccess: async () => {
- await invalidateGitQueries(input.queryClient);
+ onSuccess: () => {
+ void invalidateGitQueries(input.queryClient);
},
});
}
@@ -124,8 +124,8 @@ export function gitPullMutationOptions(input: {
if (!input.api || !input.cwd) throw new Error("Git pull is unavailable.");
return input.api.git.pull({ cwd: input.cwd });
},
- onSuccess: async () => {
- await invalidateGitQueries(input.queryClient);
+ onSuccess: () => {
+ void invalidateGitQueries(input.queryClient);
},
});
}