| author | |
| committer | |
| log | 40a7f4b4b1780c24db24a201f5b0860ce9763028 |
| tree | d714c0089879ebbcabbb4a9af5d151cd16a7bf6d |
| parent | cba0f23a9e003a522c0f92f5391f15f0879a98f2 |
| signature | Signed by PGP key B5690EEEBB952194 |
- Update GitActionsControl quick/menu action text for existing pull requests
- Align unavailable-state copy and tests with the new label3 files changed, 14 insertions(+), 14 deletions(-)
apps/web/src/components/GitActionsControl.logic.test.ts+4-4| ... | ... | @@ -42,7 +42,7 @@ describe("when: branch is clean and has an open PR", () => { |
| 42 | 42 | }), |
| 43 | 43 | false, |
| 44 | 44 | ); |
| 45 | assert.deepInclude(quick, { kind: "open_pr", label: "Open PR", disabled: false }); | |
| 45 | assert.deepInclude(quick, { kind: "open_pr", label: "View PR", disabled: false }); | |
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | 48 | it("buildMenuItems disables commit/push and enables open PR", () => { |
| ... | ... | @@ -78,7 +78,7 @@ describe("when: branch is clean and has an open PR", () => { |
| 78 | 78 | }, |
| 79 | 79 | { |
| 80 | 80 | id: "pr", |
| 81 | label: "Open PR", | |
| 81 | label: "View PR", | |
| 82 | 82 | disabled: false, |
| 83 | 83 | icon: "pr", |
| 84 | 84 | kind: "open_pr", |
| ... | ... | @@ -199,7 +199,7 @@ describe("when: branch is clean, ahead, and has an open PR", () => { |
| 199 | 199 | }, |
| 200 | 200 | { |
| 201 | 201 | id: "pr", |
| 202 | label: "Open PR", | |
| 202 | label: "View PR", | |
| 203 | 203 | disabled: false, |
| 204 | 204 | icon: "pr", |
| 205 | 205 | kind: "open_pr", |
| ... | ... | @@ -547,7 +547,7 @@ describe("when: branch has no upstream configured", () => { |
| 547 | 547 | ); |
| 548 | 548 | assert.deepInclude(quick, { |
| 549 | 549 | kind: "open_pr", |
| 550 | label: "Open PR", | |
| 550 | label: "View PR", | |
| 551 | 551 | disabled: false, |
| 552 | 552 | }); |
| 553 | 553 | }); |
apps/web/src/components/GitActionsControl.logic.ts+3-3| ... | ... | @@ -151,7 +151,7 @@ export function buildMenuItems( |
| 151 | 151 | hasOpenPr |
| 152 | 152 | ? { |
| 153 | 153 | id: "pr", |
| 154 | label: "Open PR", | |
| 154 | label: "View PR", | |
| 155 | 155 | disabled: !canOpenPr, |
| 156 | 156 | icon: "pr", |
| 157 | 157 | kind: "open_pr", |
| ... | ... | @@ -216,7 +216,7 @@ export function resolveQuickAction( |
| 216 | 216 | if (!gitStatus.hasUpstream) { |
| 217 | 217 | if (!isAhead) { |
| 218 | 218 | if (hasOpenPr) { |
| 219 | return { label: "Open PR", disabled: false, kind: "open_pr" }; | |
| 219 | return { label: "View PR", disabled: false, kind: "open_pr" }; | |
| 220 | 220 | } |
| 221 | 221 | return { |
| 222 | 222 | label: "Push", |
| ... | ... | @@ -266,7 +266,7 @@ export function resolveQuickAction( |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | if (hasOpenPr && gitStatus.hasUpstream) { |
| 269 | return { label: "Open PR", disabled: false, kind: "open_pr" }; | |
| 269 | return { label: "View PR", disabled: false, kind: "open_pr" }; | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | return { |
apps/web/src/components/GitActionsControl.tsx+7-7| ... | ... | @@ -98,7 +98,7 @@ function getMenuActionDisabledReason( |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if (hasOpenPr) { |
| 101 | return "Open PR is currently unavailable."; | |
| 101 | return "View PR is currently unavailable."; | |
| 102 | 102 | } |
| 103 | 103 | if (!hasBranch) { |
| 104 | 104 | return "Detached HEAD: checkout a branch before creating a PR."; |
| ... | ... | @@ -374,12 +374,12 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions |
| 374 | 374 | }, |
| 375 | 375 | } |
| 376 | 376 | : shouldOfferOpenPrCta |
| 377 | ? { | |
| 378 | actionProps: { | |
| 379 | children: "Open PR", | |
| 380 | onClick: () => { | |
| 381 | const api = readNativeApi(); | |
| 382 | if (!api) return; | |
| 377 | ? { | |
| 378 | actionProps: { | |
| 379 | children: "View PR", | |
| 380 | onClick: () => { | |
| 381 | const api = readNativeApi(); | |
| 382 | if (!api) return; | |
| 383 | 383 | closeResultToast(); |
| 384 | 384 | void api.shell.openExternal(prUrl); |
| 385 | 385 | }, |