Rename Open PR action label to View PR (#467)
- Update GitActionsControl quick/menu action text for existing pull requests - Align unavailable-state copy and tests with the new label
This commit is contained in:
1 parent
cba0f23a9e
commit
40a7f4b4b1
3 files changed
+14
-14
No files matched your search
@@ -42,7 +42,7 @@ describe("when: branch is clean and has an open PR", () => {
|
||||
}),
|
||||
false,
|
||||
);
|
||||
assert.deepInclude(quick, { kind: "open_pr", label: "Open PR", disabled: false });
|
||||
assert.deepInclude(quick, { kind: "open_pr", label: "View PR", disabled: false });
|
||||
});
|
||||
|
||||
it("buildMenuItems disables commit/push and enables open PR", () => {
|
||||
@@ -78,7 +78,7 @@ describe("when: branch is clean and has an open PR", () => {
|
||||
},
|
||||
{
|
||||
id: "pr",
|
||||
label: "Open PR",
|
||||
label: "View PR",
|
||||
disabled: false,
|
||||
icon: "pr",
|
||||
kind: "open_pr",
|
||||
@@ -199,7 +199,7 @@ describe("when: branch is clean, ahead, and has an open PR", () => {
|
||||
},
|
||||
{
|
||||
id: "pr",
|
||||
label: "Open PR",
|
||||
label: "View PR",
|
||||
disabled: false,
|
||||
icon: "pr",
|
||||
kind: "open_pr",
|
||||
@@ -547,7 +547,7 @@ describe("when: branch has no upstream configured", () => {
|
||||
);
|
||||
assert.deepInclude(quick, {
|
||||
kind: "open_pr",
|
||||
label: "Open PR",
|
||||
label: "View PR",
|
||||
disabled: false,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -151,7 +151,7 @@ export function buildMenuItems(
|
||||
hasOpenPr
|
||||
? {
|
||||
id: "pr",
|
||||
label: "Open PR",
|
||||
label: "View PR",
|
||||
disabled: !canOpenPr,
|
||||
icon: "pr",
|
||||
kind: "open_pr",
|
||||
@@ -216,7 +216,7 @@ export function resolveQuickAction(
|
||||
if (!gitStatus.hasUpstream) {
|
||||
if (!isAhead) {
|
||||
if (hasOpenPr) {
|
||||
return { label: "Open PR", disabled: false, kind: "open_pr" };
|
||||
return { label: "View PR", disabled: false, kind: "open_pr" };
|
||||
}
|
||||
return {
|
||||
label: "Push",
|
||||
@@ -266,7 +266,7 @@ export function resolveQuickAction(
|
||||
}
|
||||
|
||||
if (hasOpenPr && gitStatus.hasUpstream) {
|
||||
return { label: "Open PR", disabled: false, kind: "open_pr" };
|
||||
return { label: "View PR", disabled: false, kind: "open_pr" };
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -98,7 +98,7 @@ function getMenuActionDisabledReason(
|
||||
}
|
||||
|
||||
if (hasOpenPr) {
|
||||
return "Open PR is currently unavailable.";
|
||||
return "View PR is currently unavailable.";
|
||||
}
|
||||
if (!hasBranch) {
|
||||
return "Detached HEAD: checkout a branch before creating a PR.";
|
||||
@@ -374,12 +374,12 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions
|
||||
},
|
||||
}
|
||||
: shouldOfferOpenPrCta
|
||||
? {
|
||||
actionProps: {
|
||||
children: "Open PR",
|
||||
onClick: () => {
|
||||
const api = readNativeApi();
|
||||
if (!api) return;
|
||||
? {
|
||||
actionProps: {
|
||||
children: "View PR",
|
||||
onClick: () => {
|
||||
const api = readNativeApi();
|
||||
if (!api) return;
|
||||
closeResultToast();
|
||||
void api.shell.openExternal(prUrl);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user