diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 9e35e618e9b1e8575d981e8631e4c81e603b7de6..604736ce741a52b146ba9edaf34e067b7af7cf34 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -103,6 +103,18 @@ function getMenuActionDisabledReason( return "Create PR is currently unavailable."; } +const DIALOG_TITLE_BY_ACTION = { + commit: "Commit changes", + push: "Push branch", + create_pr: "Create pull request", +}; + +const DIALOG_DESCRIPTION_BY_ACTION = { + commit: "Review and confirm your commit. Leave the message blank to auto-generate one.", + push: "Push this branch now.", + create_pr: "Create a pull request using generated title/body content.", +}; + function GitActionItemIcon({ icon }: { icon: GitActionIconName }) { if (icon === "commit") return ; if (icon === "push") return ; @@ -423,19 +435,6 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp [api, gitCwd], ); - const dialogTitle = - activeDialogAction === "commit" - ? "Commit changes" - : activeDialogAction === "push" - ? "Push branch" - : "Create pull request"; - const dialogDescription = - activeDialogAction === "commit" - ? "Review and confirm your commit. Leave the message blank to auto-generate one." - : activeDialogAction === "push" - ? "Push this branch now." - : "Create a pull request using generated title/body content."; - if (!gitCwd) return null; return ( @@ -576,8 +575,10 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp > - {dialogTitle} - {dialogDescription} + {DIALOG_TITLE_BY_ACTION[activeDialogAction ?? "commit"]} + + {DIALOG_DESCRIPTION_BY_ACTION[activeDialogAction ?? "commit"]} +