perf(library): persistent SPA shell, in-memory folder tree caching, and zero-flicker LRU thumbnail caching

This commit is contained in:
2026-10-07 12:05:58 +07:00
parent 3b4c49c41d
commit 1c7be6dfd4
3 changed files with 98 additions and 43 deletions
+25 -2
View File
@@ -37,7 +37,6 @@ function pick(route: string) {
);
}
// Intercept internal link clicks for instant SPA transitions without full page reload
function Shell() {
const [route, setRoute] = useState(() => window.location.pathname + window.location.search);
@@ -64,7 +63,31 @@ function Shell() {
};
}, []);
return pick(route);
const isApp = route.startsWith('/app');
const isLibrary = route.startsWith('/library');
const isOther = !isApp && !isLibrary;
return (
<>
<div style={{ display: isApp ? 'block' : 'none', height: '100%' }}>
<Workspace />
</div>
<div style={{ display: isLibrary ? 'block' : 'none', height: '100%' }}>
<Library />
</div>
{isOther ? (
route.startsWith('/admin') ? (
<Admin />
) : route.startsWith('/photos') ? (
<PhotosPage />
) : route.startsWith('/profile') ? (
<ProfilePage />
) : (
<Landing />
)
) : null}
</>
);
}
const root = document.getElementById('root');