eef0ef5522
Checkpoint of the in-progress frontend toolchain work (Vite pinned to ^6 after the 7/8 rolldown build break, eslint-plugin-svelte v3 navigation/reactivity fixes, CI/Dockerfile/manifest updates) together with three UI performance optimizations (verified on the Vite 6 build): - Critical CSS: move auth.css/music.css off the global path into their route chunks (login/device/nextcloud-login, music) -- -25% gzipped critical CSS (~5.4 KB) on every non-auth/non-music page load. - relativeTimeAgo: cache the Intl.RelativeTimeFormat (was rebuilt per call, once per row per render) -- 22.7x faster date formatting in large lists. - Virtualize search results and grouped trash (list view) via VirtualList -- DOM rows mounted stay ~constant (~27) instead of O(N) (94.6% fewer for 500 hits). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
21 lines
798 B
Svelte
21 lines
798 B
Svelte
<script lang="ts">
|
|
import { goto } from '$app/navigation';
|
|
import { resolve } from '$app/paths';
|
|
import { onMount } from 'svelte';
|
|
import { session } from '$lib/stores/session.svelte';
|
|
|
|
// The app root redirects by user kind:
|
|
// - external users (magic-link / OIDC-only / OCM recipients) have no
|
|
// personal drive, so they land on Shared-with-me;
|
|
// - internal users go to the files browser, which resolves the default
|
|
// personal drive's root folder via `session.loadHomeFolder()` (post-D0
|
|
// this reads `GET /api/drives` and picks the row whose
|
|
// `default_for_user` matches the caller).
|
|
onMount(() => {
|
|
const target = session.isExternalUser ? '/shared-with-me' : '/files';
|
|
void goto(resolve(target), { replaceState: true });
|
|
});
|
|
</script>
|
|
|
|
<p>Loading…</p>
|