From 9a1aa14ef730eed787d8c8465766229aa874c40f Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 5 May 2026 20:44:18 +0200 Subject: [PATCH] =?UTF-8?q?Nexo=20P1=20polish=20=E2=80=94=20operator=20chr?= =?UTF-8?q?ome=20out=20of=20user=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shell layout was rendering an operator-style header (Discover / Matches / Profile / Safety / Devtools links + auth slot) on every `/dating/*` route, including login, register, reset and the product pages. That bar reads as a developer dashboard, not as the navigation of a real dating app. Layout (`+layout.svelte`): - The header now mounts only when the route is under `/dating/admin` or `/dating/devtools` — i.e. the moderation / instrumentation surfaces, where operator-grade nav is correct. On every other surface the layout renders the children directly with the App composed and the session probe still running. - Auth pages (login, register, reset, mfa) end up showing only their centered card; product pages (discover, matches, chat, profile, photos) get the full viewport with no chrome above. `_components/AppNav.svelte`: - Bottom-tab navigation for the product surface — Descubre / Matches / Perfil / Seguridad + Salir. Sticky-bottom on mobile, sits as a rounded bar at the foot of the viewport on desktop. Mounted by Discover, Matches and Profile so the user can still cross between top-level sections without the operator bar. Chat keeps its own back-arrow (it's full-screen). Photos returns via the back link in its header. Auth routes need no nav. Gates: 1695 tests + check (0/0) + build + bundle 22.52 KB + aliases — all green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/web/routes/dating/+layout.svelte | 130 +++++++++--------- .../routes/dating/_components/AppNav.svelte | 124 +++++++++++++++++ src/web/routes/dating/discover/+page.svelte | 3 + src/web/routes/dating/matches/+page.svelte | 3 + src/web/routes/dating/profile/+page.svelte | 3 + 5 files changed, 195 insertions(+), 68 deletions(-) create mode 100644 src/web/routes/dating/_components/AppNav.svelte diff --git a/src/web/routes/dating/+layout.svelte b/src/web/routes/dating/+layout.svelte index a40f152..96946b9 100644 --- a/src/web/routes/dating/+layout.svelte +++ b/src/web/routes/dating/+layout.svelte @@ -15,7 +15,7 @@ frontendTarget: () => appRoot }); - const { App, api } = handle; + const { api } = handle; async function refreshSession(): Promise { try { @@ -48,75 +48,70 @@ onDestroy(() => handle.dispose()); - const t = (key: Parameters[0]) => App.lang.t(key); + // Operator-style chrome (the cross-section nav with Discover / + // Matches / Profile / Safety / Devtools links) only makes sense + // once the user is operating an admin / devtools surface. Regular + // user pages own their own navigation context — auth pages render + // a centered card; product pages drive cross-section nav from + // inside their own UI. Activate the chrome only under + // `/dating/admin` and `/dating/devtools`. + const showChrome = $derived( + page.url.pathname.startsWith('/dating/admin') || + page.url.pathname.startsWith('/dating/devtools') + ); - // Plain hrefs (not the typed `resolve(...)`) so the layout compiles - // before each phase has materialised its own `+page.svelte`. The - // links 404 until the route is created — same UX as opening any - // unbuilt section of an SPA. - const navItems = $derived([ - { href: '/dating/discover', label: t('nexo.nav.discover') }, - { href: '/dating/matches', label: t('nexo.nav.matches') }, - { href: '/dating/profile', label: t('nexo.nav.profile') }, - { href: '/dating/safety', label: t('nexo.nav.safety') }, - { href: '/dating/devtools', label: t('nexo.nav.devtools') } - ]); + function isCurrent(href: string): boolean { + return page.url.pathname === href || page.url.pathname.startsWith(`${href}/`); + } const isAuthenticated = $derived(session?.authenticated === true); const userName = $derived( session?.authenticated === true ? session.user.displayName || session.user.email : '' ); - - function isCurrent(href: string): boolean { - return page.url.pathname === href || page.url.pathname.startsWith(`${href}/`); - } - Nexo — {t('nexo.tagline')} + Nexo -
-
- - {t('nexo.title')} - {t('nexo.tagline')} - - - + +
+ {#if isAuthenticated} + {userName} + + {/if} +
+
+ {/if} {#if loadError !== null}
{/if} + +