| ... | ... | @@ -103,6 +103,18 @@ function getMenuActionDisabledReason( |
| 103 | 103 | return "Create PR is currently unavailable."; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | const DIALOG_TITLE_BY_ACTION = { |
| 107 | commit: "Commit changes", |
| 108 | push: "Push branch", |
| 109 | create_pr: "Create pull request", |
| 110 | }; |
| 111 | |
| 112 | const DIALOG_DESCRIPTION_BY_ACTION = { |
| 113 | commit: "Review and confirm your commit. Leave the message blank to auto-generate one.", |
| 114 | push: "Push this branch now.", |
| 115 | create_pr: "Create a pull request using generated title/body content.", |
| 116 | }; |
| 117 | |
| 106 | 118 | function GitActionItemIcon({ icon }: { icon: GitActionIconName }) { |
| 107 | 119 | if (icon === "commit") return <GitCommitIcon />; |
| 108 | 120 | if (icon === "push") return <CloudUploadIcon />; |
| ... | ... | @@ -423,19 +435,6 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp |
| 423 | 435 | [api, gitCwd], |
| 424 | 436 | ); |
| 425 | 437 | |
| 426 | | const dialogTitle = |
| 427 | | activeDialogAction === "commit" |
| 428 | | ? "Commit changes" |
| 429 | | : activeDialogAction === "push" |
| 430 | | ? "Push branch" |
| 431 | | : "Create pull request"; |
| 432 | | const dialogDescription = |
| 433 | | activeDialogAction === "commit" |
| 434 | | ? "Review and confirm your commit. Leave the message blank to auto-generate one." |
| 435 | | : activeDialogAction === "push" |
| 436 | | ? "Push this branch now." |
| 437 | | : "Create a pull request using generated title/body content."; |
| 438 | | |
| 439 | 438 | if (!gitCwd) return null; |
| 440 | 439 | |
| 441 | 440 | return ( |
| ... | ... | @@ -576,8 +575,10 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp |
| 576 | 575 | > |
| 577 | 576 | <DialogPopup> |
| 578 | 577 | <DialogHeader> |
| 579 | | <DialogTitle>{dialogTitle}</DialogTitle> |
| 580 | | <DialogDescription>{dialogDescription}</DialogDescription> |
| 578 | <DialogTitle>{DIALOG_TITLE_BY_ACTION[activeDialogAction ?? "commit"]}</DialogTitle> |
| 579 | <DialogDescription> |
| 580 | {DIALOG_DESCRIPTION_BY_ACTION[activeDialogAction ?? "commit"]} |
| 581 | </DialogDescription> |
| 581 | 582 | </DialogHeader> |
| 582 | 583 | <DialogPanel className="space-y-4"> |
| 583 | 584 | <div className="space-y-3 rounded-lg border border-input bg-muted/40 p-3 text-xs"> |