feat(web): command palette finds the pull requests and usage pages (#12211)

This commit is contained in:
oliver authored and GitHub committed 2026-09-17 03:17:41 -03:00
1 parent c4ca1b0f94
commit c0dded88b1
1 file changed
+30
@@ -42,6 +42,7 @@ import { useLocation, useNavigate, useParams } from "@tanstack/react-router";
import * as Option from "effect/Option";
import {
ArrowLeftIcon,
ChartNoAxesColumnIcon,
CornerLeftUpIcon,
FileSearchIcon,
FolderIcon,
@@ -193,6 +194,7 @@ import {
} from "../sidebarProjectGrouping";
import type { Project } from "../types";
import { PullRequestGlyph } from "~/components/pullRequest/pullRequestIcons";
import { readPullRequestListPreferences } from "~/components/pullRequest/pullRequestListPreferences";
const EMPTY_BROWSE_ENTRIES: FilesystemBrowseResult["entries"] = [];
@@ -1999,6 +2001,34 @@ function OpenCommandPaletteDialog(props: {
},
});
if (
environments.some(
(environment) => environment.serverConfig?.environment.capabilities.pullRequests === true,
)
) {
actionItems.push({
kind: "action",
value: "action:pull-requests",
searchTerms: ["pull requests", "prs", "pr", "github", "review", "merge", "branch"],
title: "Open pull requests",
icon: <PullRequestGlyph.pullRequest className={ITEM_ICON_CLASS} />,
run: async () => {
await navigate({ to: "/pull-requests", search: readPullRequestListPreferences() });
},
});
}
actionItems.push({
kind: "action",
value: "action:usage",
searchTerms: ["usage", "use", "tokens", "cost", "spend", "limits", "stats", "analytics"],
title: "Open usage",
icon: <ChartNoAxesColumnIcon className={ITEM_ICON_CLASS} />,
run: async () => {
await navigate({ to: "/usage" });
},
});
actionItems.push({
kind: "action",
value: "action:settings",