Skip to content

Commit 16c4cf1

Browse files
committed
chore: Fix page loading issue
Signed-off-by: Jared Scott <[email protected]>
1 parent 1a729b6 commit 16c4cf1

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

js/app/(mainComponents)/NavBar.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { Box, Flex, Link, Tabs } from "@chakra-ui/react";
44
import { useQuery } from "@tanstack/react-query";
5+
import NextLink from "next/link";
56
import { usePathname } from "next/navigation";
67
import React, { Activity, ReactNode, useEffect, useMemo } from "react";
78
import { EnvInfo } from "@/components/app/EnvInfo";
@@ -122,7 +123,9 @@ export default function NavBar() {
122123
disabled={isLoading || isFlagLoading || disable}
123124
hidden={disable}
124125
>
125-
<Link href={path}>{name}</Link>
126+
<Link asChild>
127+
<NextLink href={path}>{name}</NextLink>
128+
</Link>
126129
<Activity mode={name === "Checklist" ? "visible" : "hidden"}>
127130
{ChecklistBadge}
128131
</Activity>

js/app/MainLayout.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function MainLayout({ children, lineage }: MainLayoutProps) {
6161
<TopBar />
6262
<NavBar />
6363
<Main isLineageRoute={isLineageRoute} lineage={lineage}>
64-
<Suspense fallback={<MainContentLoading />}>{children}</Suspense>
64+
{children}
6565
</Main>
6666
{!isLoading &&
6767
!isDemoSite &&
@@ -85,6 +85,7 @@ function Main({ children, lineage, isLineageRoute }: MainProps) {
8585
const pathname = usePathname();
8686

8787
const _isRunResultOpen = isRunResultOpen && !pathname.startsWith("/checks");
88+
console.log("MainLayout Render - isRunResultOpen:", _isRunResultOpen);
8889
const _isHistoryOpen = isHistoryOpen && !pathname.startsWith("/checks");
8990

9091
return (
@@ -101,23 +102,25 @@ function Main({ children, lineage, isLineageRoute }: MainProps) {
101102
gutterSize={_isRunResultOpen ? 5 : 0}
102103
style={{ flex: "1", contain: "size" }}
103104
>
104-
<Box p={0} style={{ contain: "content" }}>
105-
{/*
106-
* Lineage parallel route - always mounted but visibility controlled
107-
* This replaces the old RouteAlwaysMount pattern
108-
*/}
109-
<Box
110-
display={isLineageRoute ? "block" : "none"}
111-
height="100%"
112-
position={isLineageRoute ? "relative" : "absolute"}
113-
inset={0}
114-
>
115-
{lineage}
116-
</Box>
105+
<Suspense fallback={<MainContentLoading />}>
106+
<Box p={0} style={{ contain: "content" }}>
107+
{/*
108+
* Lineage parallel route - always mounted but visibility controlled
109+
* This replaces the old RouteAlwaysMount pattern
110+
*/}
111+
<Box
112+
display={isLineageRoute ? "block" : "none"}
113+
height="100%"
114+
position={isLineageRoute ? "relative" : "absolute"}
115+
inset={0}
116+
>
117+
{lineage}
118+
</Box>
117119

118-
{/* Other route content */}
119-
{!isLineageRoute && children}
120-
</Box>
120+
{/* Other route content */}
121+
{!isLineageRoute && children}
122+
</Box>
123+
</Suspense>
121124
{_isRunResultOpen ? (
122125
<RunResultPane
123126
onClose={closeRunResult}

0 commit comments

Comments
 (0)