diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 92c89579ada04f50669ebdde141db20ace0be1a5..01940d8ba8070ab394d0c148d5a2f78ba2afa51f 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -350,6 +350,20 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp }); }, [api, gitStatus?.openPr?.url]); + const openPrFromResult = useCallback(() => { + if (!api) { + setGitModalError("Link opening is unavailable."); + return; + } + + const prUrl = gitModalResult?.pr.url ?? null; + if (!prUrl) return; + + void api.shell.openExternal(prUrl).catch((error) => { + setGitModalError(error instanceof Error ? error.message : "Unable to open PR link."); + }); + }, [api, gitModalResult?.pr.url]); + const runGitAction = useCallback(async () => { if (!api || !gitCwd || !isGitModalOpen) return; if (!selectedGitModalActionOption || selectedGitModalActionOption.disabled) return; @@ -398,12 +412,12 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp if (includeGeneratedCommitMessage) { if (commitRun.commit.status === "created") { + if (commitRun.commit.subject) { + setGitModalCommitMessage(commitRun.commit.subject); + } updateStep( "generate", "completed", - commitRun.commit.subject - ? `Generated: ${commitRun.commit.subject}` - : "Generated commit message.", ); } else { updateStep("generate", "skipped", "No local changes to commit."); @@ -694,15 +708,20 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp const borderClass = index < gitModalActionOptions.length - 1 ? "border-b border-border/70" : ""; const selected = option.action === gitModalSelectedAction && !option.disabled; + const disabled = option.disabled || isGitActionRunning; return ( @@ -731,9 +756,7 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp const statusTextClass = step.status === "failed" ? "text-rose-500 dark:text-rose-300" - : step.status === "completed" - ? "text-emerald-600 dark:text-emerald-300" - : "text-muted-foreground/70"; + : "text-muted-foreground/70"; return (