fix(webui): show route-aligned skeletons from first paint (#6303)

This commit is contained in:
chengyongru authored and GitHub committed 2026-10-19 15:57:32 +08:00
1 parent af68da3280
commit 5d886fbb20
43 files changed
+1592 -213

No files matched your search

+10 -13
View File
@@ -1,17 +1,14 @@
import { useTranslation } from "react-i18next";
/** Quiet layout placeholders while the authenticated application starts. */
export function StartupShell({ embedded = false }: { embedded?: boolean }) {
import { readStartupLayout, StartupSkeleton, type StartupSurface } from "./StartupSkeleton";
export function StartupShell({ embedded = false, surface, sidebarExpanded }: {
embedded?: boolean;
surface?: StartupSurface;
sidebarExpanded?: boolean;
}) {
const { t } = useTranslation();
const Root = embedded ? "section" : "main";
return (
<Root className="startup-shell" aria-busy="true">
<div className="startup-header" aria-hidden="true">
<span className="startup-control-shadow" />
<span className="startup-control-shadow" />
</div>
<div className="startup-composer" aria-hidden="true" />
<span className="startup-status" role="status">{t("app.loading.connecting")}</span>
</Root>
);
const layout = readStartupLayout();
return <StartupSkeleton {...layout} embedded={embedded} surface={surface ?? layout.surface}
sidebarExpanded={sidebarExpanded ?? layout.sidebarExpanded} label={t("app.loading.boot")} />;
}