@devries-cameron20 / t3code Mirror · read-only / commits / c0bdd46ddd
Fork 0

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

Streamline git action flow and improve changed-files dialog

- Trigger `commit_push` directly from primary Push actions - Simplify push confirmation copy and dialog descriptions - Replace 6-file cap with a scrollable full changed-files list plus totals

Julius Marminge committed Feb 14, 2026 at 23:00 UTC c0bdd46ddd761a176de23c4ea926737e537fcfa9
1 file changed +44 -50
apps/web/src/components/GitActionsControl.tsx
+44 -50
@@ -13,7 +13,6 @@ import {
13 resolveQuickAction,
14 summarizeGitResult,
15 } from "./GitActionsControl.logic";
16 -import { Badge } from "~/components/ui/badge";
16 import { Button } from "~/components/ui/button";
17 import {
18 Dialog,
@@ -27,6 +26,7 @@ import {
26 import { Group, GroupSeparator } from "~/components/ui/group";
27 import { Menu, MenuItem, MenuPopup, MenuTrigger } from "~/components/ui/menu";
28 import { Popover, PopoverPopup, PopoverTrigger } from "~/components/ui/popover";
29 +import { ScrollArea } from "~/components/ui/scroll-area";
30 import { Textarea } from "~/components/ui/textarea";
31 import { toastManager } from "~/components/ui/toast";
32 import {
@@ -103,20 +103,6 @@ function getMenuActionDisabledReason(
103 return "Create PR is currently unavailable.";
104 }
105
106 -function formatUpstreamStatus(input: {
107 - hasUpstream: boolean;
108 - aheadCount: number;
109 - behindCount: number;
110 -}): string {
111 - if (!input.hasUpstream) return "No upstream configured";
112 - if (input.aheadCount === 0 && input.behindCount === 0) return "Up to date";
113 - if (input.aheadCount > 0 && input.behindCount > 0) {
114 - return `Diverged (+${input.aheadCount} / -${input.behindCount})`;
115 - }
116 - if (input.aheadCount > 0) return `Ahead by ${input.aheadCount}`;
117 - return `Behind by ${input.behindCount}`;
118 -}
119 -
106 function GitActionItemIcon({ icon }: { icon: GitActionIconName }) {
107 if (icon === "commit") return <GitCommitIcon />;
108 if (icon === "push") return <CloudUploadIcon />;
@@ -207,7 +193,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
193 return true;
194 }
195 return api.dialogs.confirm(
210 - `Push to default branch "${gitStatus.branch}"? This will update the shared base branch.`,
196 + `You're about to push to the default branch "${gitStatus.branch}". Continue?`,
197 );
198 },
199 [api, gitStatus?.branch, isDefaultBranch],
@@ -290,7 +276,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
276 ? {
277 actionProps: {
278 children: "Push",
293 - onClick: () => setActiveDialogAction("push"),
279 + onClick: () => void runGitActionWithToast({ action: "commit_push" }),
280 },
281 }
282 : shouldOfferOpenPrCta
@@ -371,11 +357,15 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
357 void openExistingPr();
358 return;
359 }
360 + if (item.dialogAction === "push") {
361 + void runGitActionWithToast({ action: "commit_push" });
362 + return;
363 + }
364 if (item.dialogAction) {
365 setActiveDialogAction(item.dialogAction);
366 }
367 },
378 - [openExistingPr],
368 + [openExistingPr, runGitActionWithToast],
369 );
370
371 const runDialogAction = useCallback(() => {
@@ -425,10 +415,8 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
415 activeDialogAction === "commit"
416 ? "Review and confirm your commit. Leave the message blank to auto-generate one."
417 : activeDialogAction === "push"
428 - ? "Push this branch now. If this is the default branch, you'll be asked to confirm."
418 + ? "Push this branch now."
419 : "Create a pull request using generated title/body content.";
430 - const showCompactStatusCard =
431 - !!gitStatus && gitStatus.hasWorkingTreeChanges && !gitStatus.hasUpstream;
420
421 if (!gitCwd) return null;
422
@@ -578,17 +566,19 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
566 <div className="grid grid-cols-[auto_1fr] items-center gap-x-2 gap-y-1">
567 <span className="text-muted-foreground">Branch</span>
568 <span className="font-medium">{gitStatus?.branch ?? "(detached HEAD)"}</span>
581 - {!showCompactStatusCard && (
569 + {activeDialogAction !== "commit" && (
570 <>
571 <span className="text-muted-foreground">Upstream</span>
572 <span className="font-medium">
585 - {gitStatus
586 - ? formatUpstreamStatus({
587 - hasUpstream: gitStatus.hasUpstream,
588 - aheadCount: gitStatus.aheadCount,
589 - behindCount: gitStatus.behindCount,
590 - })
591 - : "unknown"}
573 + {!gitStatus || !gitStatus.hasUpstream
574 + ? "No upstream configured"
575 + : gitStatus.aheadCount === 0 && gitStatus.behindCount === 0
576 + ? "Up to date"
577 + : gitStatus.aheadCount > 0 && gitStatus.behindCount > 0
578 + ? `Diverged (+${gitStatus.aheadCount} / -${gitStatus.behindCount})`
579 + : gitStatus.aheadCount > 0
580 + ? `Ahead by ${gitStatus.aheadCount}`
581 + : `Behind by ${gitStatus.behindCount}`}
582 </span>
583 <span className="text-muted-foreground">Working tree</span>
584 <span className="font-medium">
@@ -618,27 +608,31 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
608 {!gitStatus || gitStatus.workingTree.files.length === 0 ? (
609 <p className="font-medium">none</p>
610 ) : (
621 - <div className="space-y-1">
622 - {gitStatus.workingTree.files.slice(0, 6).map((file) => (
623 - <button
624 - type="button"
625 - key={file.path}
626 - className="flex w-full items-center justify-between gap-3 rounded-md border border-input bg-background px-2 py-1 font-mono text-left transition-colors hover:bg-accent/50"
627 - onClick={() => openChangedFileInEditor(file.path)}
628 - >
629 - <span className="truncate">{file.path}</span>
630 - <span className="shrink-0">
631 - <span className="text-success">+{file.insertions}</span>
632 - <span className="text-muted-foreground"> / </span>
633 - <span className="text-destructive">-{file.deletions}</span>
634 - </span>
635 - </button>
636 - ))}
637 - {gitStatus.workingTree.files.length > 6 && (
638 - <Badge variant="outline" size="sm">
639 - +{gitStatus.workingTree.files.length - 6} more
640 - </Badge>
641 - )}
611 + <div className="space-y-2">
612 + <ScrollArea className="h-44 rounded-md border border-input bg-background">
613 + <div className="space-y-1 p-1">
614 + {gitStatus.workingTree.files.map((file) => (
615 + <button
616 + type="button"
617 + key={file.path}
618 + className="flex w-full items-center justify-between gap-3 rounded-md px-2 py-1 font-mono text-left transition-colors hover:bg-accent/50"
619 + onClick={() => openChangedFileInEditor(file.path)}
620 + >
621 + <span className="truncate">{file.path}</span>
622 + <span className="shrink-0">
623 + <span className="text-success">+{file.insertions}</span>
624 + <span className="text-muted-foreground"> / </span>
625 + <span className="text-destructive">-{file.deletions}</span>
626 + </span>
627 + </button>
628 + ))}
629 + </div>
630 + </ScrollArea>
631 + <div className="flex justify-end font-mono">
632 + <span className="text-success">+{gitStatus.workingTree.insertions}</span>
633 + <span className="text-muted-foreground"> / </span>
634 + <span className="text-destructive">-{gitStatus.workingTree.deletions}</span>
635 + </div>
636 </div>
637 )}
638 </div>