diff --git a/webui2/src/lib/apollo.ts b/webui2/src/lib/apollo.ts index 3b0744fa63e98fad5fed4b86f275b26288cf08ef..c1cb3597f62178787f7feea2ddd93db20c73d315 100644 --- a/webui2/src/lib/apollo.ts +++ b/webui2/src/lib/apollo.ts @@ -1,4 +1,5 @@ import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client"; +import { createQueryPreloader } from "@apollo/client/react"; const httpLink = new HttpLink({ uri: "/graphql", @@ -18,3 +19,7 @@ export const client = new ApolloClient({ }, }), }); + +// Preloader for use in TanStack Router loaders. Returns a QueryRef +// that components read with useReadQuery() for suspense-based rendering. +export const preloadQuery = createQueryPreloader(client); diff --git a/webui2/src/pages/BugDetailPage.tsx b/webui2/src/pages/BugDetailPage.tsx deleted file mode 100644 index d4b1999f695c4b7f7aba1fdda4955f46065f8ed0..0000000000000000000000000000000000000000 --- a/webui2/src/pages/BugDetailPage.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import { useParams, Link } from "@tanstack/react-router"; -import { formatDistanceToNow } from "date-fns"; -import { ArrowLeft } from "lucide-react"; - -import { useBugDetailQuery } from "@/__generated__/graphql"; -import { CommentBox } from "@/components/bugs/CommentBox"; -import { LabelEditor } from "@/components/bugs/LabelEditor"; -import { StatusBadge } from "@/components/bugs/StatusBadge"; -import { Timeline } from "@/components/bugs/Timeline"; -import { TitleEditor } from "@/components/bugs/TitleEditor"; -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { Separator } from "@/components/ui/separator"; -import { Skeleton } from "@/components/ui/skeleton"; -import { useRepo } from "@/lib/repo"; - -// Issue detail page (/:repo/issues/:id). Shows title, status, timeline of -// comments and events, and a sidebar with labels and participants. -export function BugDetailPage() { - const { id } = useParams({ strict: false }); - const repo = useRepo(); - const { data, loading, error } = useBugDetailQuery({ - variables: { ref: repo, prefix: id! }, - }); - - if (error) { - return ( -