TypeScript
feat(web): command palette finds the pull requests and usage pages (#12211)
oliverc0dded88b1fc
diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsxindex 9f993ab86c4..fddd7fa8bd7 100644--- a/apps/web/src/components/CommandPalette.tsx+++ b/apps/web/src/components/CommandPalette.tsx@@ -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",