| ... | @@ -103,6 +103,18 @@ function getMenuActionDisabledReason( | ... | @@ -103,6 +103,18 @@ function getMenuActionDisabledReason( |
| 103 | return "Create PR is currently unavailable."; | 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 | function GitActionItemIcon({ icon }: { icon: GitActionIconName }) { | 118 | function GitActionItemIcon({ icon }: { icon: GitActionIconName }) { |
| 107 | if (icon === "commit") return <GitCommitIcon />; | 119 | if (icon === "commit") return <GitCommitIcon />; |
| 108 | if (icon === "push") return <CloudUploadIcon />; | 120 | if (icon === "push") return <CloudUploadIcon />; |
| ... | @@ -423,19 +435,6 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp | ... | @@ -423,19 +435,6 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp |
| 423 | [api, gitCwd], | 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 | if (!gitCwd) return null; | 438 | if (!gitCwd) return null; |
| 440 | | 439 | |
| 441 | return ( | 440 | return ( |
| ... | @@ -576,8 +575,10 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp | ... | @@ -576,8 +575,10 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp |
| 576 | > | 575 | > |
| 577 | <DialogPopup> | 576 | <DialogPopup> |
| 578 | <DialogHeader> | 577 | <DialogHeader> |
| 579 | <DialogTitle>{dialogTitle}</DialogTitle> | 578 | <DialogTitle>{DIALOG_TITLE_BY_ACTION[activeDialogAction ?? "commit"]}</DialogTitle> |
| 580 | <DialogDescription>{dialogDescription}</DialogDescription> | 579 | <DialogDescription> |
| | 580 | {DIALOG_DESCRIPTION_BY_ACTION[activeDialogAction ?? "commit"]} |
| | 581 | </DialogDescription> |
| 581 | </DialogHeader> | 582 | </DialogHeader> |
| 582 | <DialogPanel className="space-y-4"> | 583 | <DialogPanel className="space-y-4"> |
| 583 | <div className="space-y-3 rounded-lg border border-input bg-muted/40 p-3 text-xs"> | 584 | <div className="space-y-3 rounded-lg border border-input bg-muted/40 p-3 text-xs"> |