Compare commits

...
Author SHA1 Message Date
Cursor AgentandJulius Marminge 993571a491 Add React Scan root shell recordings
Co-authored-by: Julius Marminge <[email protected]>
2026-05-21 16:24:45 +00:00
Cursor AgentandJulius Marminge 4b87dbf7d7 Stabilize root app shell renders
Co-authored-by: Julius Marminge <[email protected]>
2026-05-21 16:23:00 +00:00
3 changed files with 22 additions and 18 deletions

No files matched your search

+22 -18
View File
@@ -99,19 +99,20 @@ export const Route = createRootRouteWithContext<{
}),
});
const APP_SHELL = (
<CommandPalette>
<AppSidebarLayout>
<Outlet />
</AppSidebarLayout>
</CommandPalette>
);
function RootRouteView() {
const pathname = useLocation({ select: (location) => location.pathname });
const { authGateState } = Route.useRouteContext();
const primaryEnvironmentAuthenticated = authGateState.status === "authenticated";
useEffect(() => {
const frame = window.requestAnimationFrame(() => {
syncBrowserChromeTheme();
});
return () => {
window.cancelAnimationFrame(frame);
};
}, [pathname]);
useBrowserChromeThemeSync(pathname);
if (pathname === "/pair") {
return <Outlet />;
@@ -121,14 +122,6 @@ function RootRouteView() {
return <Outlet />;
}
const appShell = (
<CommandPalette>
<AppSidebarLayout>
<Outlet />
</AppSidebarLayout>
</CommandPalette>
);
return (
<ToastProvider>
<AnchoredToastProvider>
@@ -142,15 +135,26 @@ function RootRouteView() {
{primaryEnvironmentAuthenticated ? <WebSocketConnectionCoordinator /> : null}
{primaryEnvironmentAuthenticated ? <SlowRpcAckToastCoordinator /> : null}
{primaryEnvironmentAuthenticated ? (
<WebSocketConnectionSurface>{appShell}</WebSocketConnectionSurface>
<WebSocketConnectionSurface>{APP_SHELL}</WebSocketConnectionSurface>
) : (
appShell
APP_SHELL
)}
</AnchoredToastProvider>
</ToastProvider>
);
}
function useBrowserChromeThemeSync(pathname: string) {
useEffect(() => {
const frame = window.requestAnimationFrame(() => {
syncBrowserChromeTheme();
});
return () => {
window.cancelAnimationFrame(frame);
};
}, [pathname]);
}
function HostedStaticEnvironmentBootstrap() {
const savedEnvironmentCount = useSavedEnvironmentRegistryStore(
(state) => Object.keys(state.byId).length,