feat(pill-nav): show Anmelden pill for guests next to menu icon

Before: guests had to open the user-menu dropdown to find the login
button. Now the login CTA renders as a visible primary pill immediately
right of the (icon-only) user-menu trigger, so signing in is one click.
Removed the duplicate Anmelden entry from userMenuBarItems — theme,
mode toggle, and language stay in the bar for signed-out users.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-23 15:36:09 +02:00
parent eb8fac23ec
commit 700861f682

View file

@ -528,23 +528,11 @@
}
// User-menu bar — rendered when barMode is active. Short list: settings,
// light/dark/system toggle, theme button.
// light/dark/system toggle, theme button. For guests the "Anmelden"
// CTA lives as a visible pill in the nav row itself (see below), so
// we don't duplicate it inside the opened bar.
const userMenuBarItems = $derived.by<PillDropdownItem[]>(() => {
const out: PillDropdownItem[] = [];
// Guest → put "Anmelden" first. Everything else in the menu
// (settings, theme, logout) is a user-only action or a trivial
// toggle, so the login entry should be the obvious call-to-action
// at the top of the bar.
if (!userEmail && loginHref) {
out.push({
id: 'login',
label: 'Anmelden',
icon: 'login',
onClick: () => {
window.location.href = loginHref;
},
});
}
if (onThemeModeChange) {
out.push(
{
@ -770,6 +758,13 @@
{:else if onLogout && showLogout}
<Pill size="sm" icon="logout" label="Logout" danger onclick={onLogout} title="Logout" />
{/if}
<!-- Guest CTA: visible "Anmelden" pill right next to the user
menu icon, so signing in doesn't require opening the menu
first. Kept out of the menu's bar to avoid duplication. -->
{#if !userEmail && loginHref}
<Pill size="sm" href={loginHref} icon="login" label="Anmelden" primary />
{/if}
</div>
</nav>
{/if}