diff --git a/apps/app/src/App.tsx b/apps/app/src/App.tsx index 2283307a3..692fd15c8 100644 --- a/apps/app/src/App.tsx +++ b/apps/app/src/App.tsx @@ -20,6 +20,7 @@ import { PROJECT_ARCHIVED_ROUTE_PATH, PROJECTLESS_THREAD_DETAIL_ROUTE_PATH, PROJECT_SETTINGS_ROUTE_PATH, + STANDALONE_APP_ROUTE_PATH, THREAD_DETAIL_ROUTE_PATH, } from "./lib/app-route-paths"; @@ -46,6 +47,11 @@ const InternalReplayListView = lazy(() => default: m.InternalReplayListView, })), ); +const StandaloneAppView = lazy(() => + import("./views/standalone-app/StandaloneAppView").then((m) => ({ + default: m.StandaloneAppView, + })), +); function AppRoutes() { return ( @@ -54,6 +60,10 @@ function AppRoutes() { } /> } /> + } + /> {import.meta.env.DEV ? ( { + if (markdownEntryPath === null) { + return null; + } + return buildAppPublicBaseUrl(applicationId, markdownEntryPath); + }, [applicationId, markdownEntryPath]); + const markdownUrlTransform = useMemo(() => { + if (markdownAssetBaseUrl === null) { + return undefined; + } + return createAssetMarkdownUrlTransform(markdownAssetBaseUrl); + }, [markdownAssetBaseUrl]); + const htmlEntryUrl = useMemo( + () => + buildAppEntryUrl({ + applicationId, + targetThreadId, + reloadToken: appDetail.dataUpdatedAt, + }), + [appDetail.dataUpdatedAt, applicationId, targetThreadId], + ); + + if (appDetail.isError) { + return ( + + ); + } + + if (!appDetail.data) { + return ( + + ); + } + + if (appDetail.data.entry.kind === "html") { + return ( + + ); + } + + if (markdownPreview.isError) { + return ( + + ); + } + + if (!markdownPreview.data) { + return ( + + ); + } + + if (markdownPreview.data.kind !== "text") { + return ( + + ); + } + + if (markdownPreview.data.content.length === 0) { + return ( + + ); + } + + return ( + + ); +} diff --git a/apps/app/src/components/layout/AppLayout.test.tsx b/apps/app/src/components/layout/AppLayout.test.tsx index 093741282..0d9853275 100644 --- a/apps/app/src/components/layout/AppLayout.test.tsx +++ b/apps/app/src/components/layout/AppLayout.test.tsx @@ -351,12 +351,12 @@ describe("AppLayout desktop chrome", () => { await renderAppLayout({ desktopInfo: null, initialEntry: "/projects/proj_sidebar_resize", - children: