Skip to content

Commit b37e7ea

Browse files
committed
fix: add skeleton (remove blinking)
1 parent 91cc571 commit b37e7ea

File tree

7 files changed

+47
-29
lines changed

7 files changed

+47
-29
lines changed

frontend/packages/components/src/third-party-providers.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export function initThirdPartyProviders(router: unknown, debug: boolean) {
3636
dsn: config.sentry.dsn,
3737
integrations,
3838
tunnel: getConfig().sentry?.tunnel,
39+
tracePropagationTargets: [
40+
/.*\.rivet\.dev/,
41+
/.*\.rivet\.gg/,
42+
/.*rivet-dev\.vercel\.app/,
43+
/localhost/,
44+
],
3945
});
4046
}
4147
}

frontend/src/app/route-layout.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Outlet } from "@tanstack/react-router";
22
import { useRef, useState } from "react";
33
import type { ImperativePanelHandle } from "react-resizable-panels";
4+
import { H2, Skeleton } from "@/components";
45
import { RootLayoutContextProvider } from "@/components/actors/root-layout-context";
56
import * as Layout from "./layout";
67

@@ -35,3 +36,29 @@ export function RouteLayout({
3536
</Layout.Root>
3637
);
3738
}
39+
40+
export function PendingRouteLayout() {
41+
return (
42+
<RouteLayout>
43+
<div className="bg-card h-full border my-2 mr-2 rounded-lg">
44+
<div className="mt-2 flex justify-between items-center px-6 py-4">
45+
<H2 className="mb-2">
46+
<Skeleton className="w-48 h-8" />
47+
</H2>
48+
</div>
49+
<p className="max-w-5xl mb-6 px-6 text-muted-foreground">
50+
<Skeleton className="w-full h-4" />
51+
</p>
52+
<hr className="mb-4" />
53+
<div className="p-4 px-6 max-w-5xl ">
54+
<Skeleton className="h-8 w-48 mb-4" />
55+
<div className="flex flex-wrap gap-2 my-4">
56+
<Skeleton className="min-w-48 h-auto min-h-28 rounded-md" />
57+
<Skeleton className="min-w-48 h-auto min-h-28 rounded-md" />
58+
<Skeleton className="min-w-48 h-auto min-h-28 rounded-md" />
59+
</div>
60+
</div>
61+
</div>
62+
</RouteLayout>
63+
);
64+
}

frontend/src/routes/_context/_cloud/orgs.$organization/index.tsx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createFileRoute, notFound, redirect } from "@tanstack/react-router";
22
import { match } from "ts-pattern";
33
import CreateProjectFrameContent from "@/app/dialogs/create-project-frame";
44
import { RouteError } from "@/app/route-error";
5-
import { RouteLayout } from "@/app/route-layout";
5+
import { PendingRouteLayout, RouteLayout } from "@/app/route-layout";
66
import { Card, H2, Skeleton } from "@/components";
77

88
export const Route = createFileRoute("/_context/_cloud/orgs/$organization/")({
@@ -37,29 +37,7 @@ export const Route = createFileRoute("/_context/_cloud/orgs/$organization/")({
3737
wrapInSuspense: true,
3838
pendingMinMs: 0,
3939
pendingMs: 0,
40-
pendingComponent: () => (
41-
<RouteLayout>
42-
<div className="bg-card h-full border my-2 mr-2 rounded-lg">
43-
<div className="mt-2 flex justify-between items-center px-6 py-4">
44-
<H2 className="mb-2">
45-
<Skeleton className="w-48 h-8" />
46-
</H2>
47-
</div>
48-
<p className="max-w-5xl mb-6 px-6 text-muted-foreground">
49-
<Skeleton className="w-full h-4" />
50-
</p>
51-
<hr className="mb-4" />
52-
<div className="p-4 px-6 max-w-5xl ">
53-
<Skeleton className="h-8 w-48 mb-4" />
54-
<div className="flex flex-wrap gap-2 my-4">
55-
<Skeleton className="min-w-48 h-auto min-h-28 rounded-md" />
56-
<Skeleton className="min-w-48 h-auto min-h-28 rounded-md" />
57-
<Skeleton className="min-w-48 h-auto min-h-28 rounded-md" />
58-
</div>
59-
</div>
60-
</div>
61-
</RouteLayout>
62-
),
40+
pendingComponent: PendingRouteLayout,
6341
component: RouteComponent,
6442
errorComponent: RouteError,
6543
});

frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createFileRoute, Outlet } from "@tanstack/react-router";
22
import { match } from "ts-pattern";
33
import { createProjectContext } from "@/app/data-providers/cloud-data-provider";
44
import { RouteError } from "@/app/route-error";
5+
import { PendingRouteLayout } from "@/app/route-layout";
56
import { useDialog } from "@/app/use-dialog";
67

78
export const Route = createFileRoute(
@@ -25,6 +26,9 @@ export const Route = createFileRoute(
2526
});
2627
},
2728
errorComponent: RouteError,
29+
pendingMinMs: 0,
30+
pendingMs: 0,
31+
pendingComponent: PendingRouteLayout,
2832
});
2933

3034
function RouteComponent() {

frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project/ns.$namespace.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createFileRoute } from "@tanstack/react-router";
22
import { createNamespaceContext } from "@/app/data-providers/cloud-data-provider";
33
import { NotFoundCard } from "@/app/not-found-card";
4-
import { RouteLayout } from "@/app/route-layout";
4+
import { PendingRouteLayout, RouteLayout } from "@/app/route-layout";
55

66
export const Route = createFileRoute(
77
"/_context/_cloud/orgs/$organization/projects/$project/ns/$namespace",
@@ -30,6 +30,9 @@ export const Route = createFileRoute(
3030
};
3131
},
3232
notFoundComponent: () => <NotFoundCard />,
33+
pendingMinMs: 0,
34+
pendingMs: 0,
35+
pendingComponent: PendingRouteLayout,
3336
});
3437

3538
function RouteComponent() {

frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project/ns.$namespace/connect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ function ProviderDropdown({ children }: { children: React.ReactNode }) {
255255
>
256256
Vercel{" "}
257257
<span className="text-[0.55rem] leading-none absolute right-0 top-[0.1rem] ">
258-
Coming soon!
258+
Soon!
259259
</span>
260260
</DropdownMenuItem>
261261
</DropdownMenuContent>

frontend/turbo.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"tasks": {
55
"build:engine": {
66
"dependsOn": ["^build"],
7-
"env": ["VITE_APP_*"],
7+
"env": ["VITE_APP_*", "DEPLOYMENT_TYPE"],
88
"outputs": ["dist/**"]
99
},
1010
"build:inspector": {
1111
"dependsOn": ["^build"],
12-
"env": ["VITE_APP_*"],
12+
"env": ["VITE_APP_*", "DEPLOYMENT_TYPE"],
1313
"outputs": ["dist/**"]
1414
},
1515
"build:cloud": {
1616
"dependsOn": ["^build"],
17-
"env": ["VITE_APP_*"],
17+
"env": ["VITE_APP_*", "DEPLOYMENT_TYPE"],
1818
"outputs": ["dist/**"]
1919
},
2020
"dev": {

0 commit comments

Comments
 (0)