File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,12 +303,7 @@ export function ReviewPage() {
303303 </ div >
304304
305305 < ResizablePanelGroup direction = "horizontal" className = "flex-1" >
306- < ResizablePanel
307- defaultSize = { 20 }
308- minSize = { 12 }
309- maxSize = { 40 }
310- className = "border-r"
311- >
306+ < ResizablePanel defaultSize = { 20 } minSize = { 12 } maxSize = { 40 } >
312307 < div className = "flex h-full flex-col" >
313308 < div className = "px-3 py-2" >
314309 < div className = "relative flex items-center rounded-md border bg-surface-0 px-2.5 py-1.5" >
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export function getRouter() {
1616 scrollRestoration : true ,
1717 defaultPreload : "intent" ,
1818 defaultPreloadStaleTime : 0 ,
19+ defaultPendingMs : 0 ,
1920 Wrap : ( { children } ) => (
2021 < AppQueryClientProvider queryClient = { queryClient } >
2122 { children }
Original file line number Diff line number Diff line change 11import { createFileRoute } from "@tanstack/react-router" ;
22import { PullDetailPage } from "#/components/pulls/detail/pull-detail-page" ;
3- import { githubPullPageQueryOptions } from "#/lib/github.query" ;
3+ import {
4+ githubPullPageQueryOptions ,
5+ githubViewerQueryOptions ,
6+ } from "#/lib/github.query" ;
47import { buildSeo , formatPageTitle , summarizeText } from "#/lib/seo" ;
58
69export const Route = createFileRoute ( "/_protected/$owner/$repo/pull/$pullId" ) ( {
@@ -15,10 +18,15 @@ export const Route = createFileRoute("/_protected/$owner/$repo/pull/$pullId")({
1518
1619 const cachedData = context . queryClient . getQueryData ( pageOptions . queryKey ) ;
1720 if ( cachedData !== undefined ) {
21+ void context . queryClient . ensureQueryData ( githubViewerQueryOptions ( scope ) ) ;
1822 return cachedData ;
1923 }
2024
21- return context . queryClient . ensureQueryData ( pageOptions ) ;
25+ const [ pageData ] = await Promise . all ( [
26+ context . queryClient . ensureQueryData ( pageOptions ) ,
27+ context . queryClient . ensureQueryData ( githubViewerQueryOptions ( scope ) ) ,
28+ ] ) ;
29+ return pageData ;
2230 } ,
2331 head : ( { loaderData, match, params } ) => {
2432 const pull = loaderData ?. detail ;
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ import { useHasMounted } from "#/lib/use-has-mounted";
1414export const Route = createFileRoute ( "/_protected/" ) ( {
1515 loader : async ( { context } ) => {
1616 const scope = { userId : context . user . id } ;
17-
1817 await Promise . all ( [
1918 context . queryClient . ensureQueryData ( githubMyPullsQueryOptions ( scope ) ) ,
2019 context . queryClient . ensureQueryData ( githubMyIssuesQueryOptions ( scope ) ) ,
2120 ] ) ;
2221 } ,
22+ pendingComponent : DashboardContentLoading ,
2323 head : ( { match } ) =>
2424 buildSeo ( {
2525 path : match . pathname ,
@@ -110,11 +110,7 @@ function OverviewPage() {
110110 ) ;
111111 }
112112
113- if ( hasMounted && ( pullsQuery . isPending || issuesQuery . isPending ) ) {
114- return < DashboardContentLoading /> ;
115- }
116-
117- return null ;
113+ return < DashboardContentLoading /> ;
118114}
119115
120116type MetricCardProps = {
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const Route = createFileRoute("/_protected/issues")({
2323 githubMyIssuesQueryOptions ( scope ) ,
2424 ) ;
2525 } ,
26+ pendingComponent : DashboardContentLoading ,
2627 head : ( { match } ) =>
2728 buildSeo ( {
2829 path : match . pathname ,
@@ -113,11 +114,7 @@ function IssuesPage() {
113114 </ div >
114115 ) ;
115116 }
116- if ( hasMounted && query . isPending ) {
117- return < DashboardContentLoading /> ;
118- }
119-
120- return null ;
117+ return < DashboardContentLoading /> ;
121118}
122119
123120type IssueGroupData = {
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export const Route = createFileRoute("/_protected/pulls")({
2727 const scope = { userId : context . user . id } ;
2828 await context . queryClient . ensureQueryData ( githubMyPullsQueryOptions ( scope ) ) ;
2929 } ,
30+ pendingComponent : DashboardContentLoading ,
3031 head : ( { match } ) =>
3132 buildSeo ( {
3233 path : match . pathname ,
@@ -135,11 +136,7 @@ function PullRequestsPage() {
135136 </ div >
136137 ) ;
137138 }
138- if ( hasMounted && query . isPending ) {
139- return < DashboardContentLoading /> ;
140- }
141-
142- return null ;
139+ return < DashboardContentLoading /> ;
143140}
144141
145142type PullGroupData = {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export const Route = createFileRoute("/_protected/reviews")({
1313 const scope = { userId : context . user . id } ;
1414 await context . queryClient . ensureQueryData ( githubMyPullsQueryOptions ( scope ) ) ;
1515 } ,
16+ pendingComponent : DashboardContentLoading ,
1617 head : ( { match } ) =>
1718 buildSeo ( {
1819 path : match . pathname ,
@@ -80,9 +81,5 @@ function ReviewsPage() {
8081 </ div >
8182 ) ;
8283 }
83- if ( hasMounted && query . isPending ) {
84- return < DashboardContentLoading /> ;
85- }
86-
87- return null ;
84+ return < DashboardContentLoading /> ;
8885}
You can’t perform that action at this time.
0 commit comments