fix(webui): skip initial route entrance motion

Prevent the top-bar title and main route content from animating during the first authenticated render. This removes first-load flashing while preserving the existing transitions for subsequent navigation.
This commit is contained in:
DrSmoothl committed 2026-07-16 16:06:12 +08:00
1 parent e224a0c6ea
commit f581fab396
2 files changed
+2 -2

No files matched your search

@@ -126,7 +126,7 @@ export function MainLayout({ status, onLogout, children }: MainLayoutProps) {
<main className={cn('flex min-h-0 flex-1 flex-col')}> <main className={cn('flex min-h-0 flex-1 flex-col')}>
<ScrollArea className="flex-1 min-h-0" viewportClassName="[&>div]:!block"> <ScrollArea className="flex-1 min-h-0" viewportClassName="[&>div]:!block">
<div className="mx-auto w-full max-w-7xl px-4 py-5 sm:px-6 sm:py-6 lg:px-8 2xl:max-w-[1600px]"> <div className="mx-auto w-full max-w-7xl px-4 py-5 sm:px-6 sm:py-6 lg:px-8 2xl:max-w-[1600px]">
<AnimatePresence mode="wait"> <AnimatePresence initial={false} mode="wait">
<motion.div <motion.div
key={pathname} key={pathname}
initial={reduce ? false : { opacity: 0, y: 10 }} initial={reduce ? false : { opacity: 0, y: 10 }}
@@ -59,7 +59,7 @@ export function TopBar({
)} )}
{/* Page title */} {/* Page title */}
<AnimatePresence mode="wait"> <AnimatePresence initial={false} mode="wait">
<motion.div <motion.div
key={pathname} key={pathname}
initial={{ opacity: 0, x: -8 }} initial={{ opacity: 0, x: -8 }}