diff --git a/apps/chat/apps/web/src/routes/(protected)/+layout.svelte b/apps/chat/apps/web/src/routes/(protected)/+layout.svelte index 4b8497e1b..b334af65b 100644 --- a/apps/chat/apps/web/src/routes/(protected)/+layout.svelte +++ b/apps/chat/apps/web/src/routes/(protected)/+layout.svelte @@ -49,16 +49,18 @@ // Current theme variant label let currentThemeVariantLabel = $derived(THEME_DEFINITIONS[theme.variant].label); - // Navigation items for Chat + // Navigation items for Chat (settings moved to user dropdown) const navItems: PillNavItem[] = [ { href: '/chat', label: 'Chat', icon: 'home' }, { href: '/templates', label: 'Templates', icon: 'document' }, { href: '/spaces', label: 'Spaces', icon: 'building' }, { href: '/documents', label: 'Dokumente', icon: 'archive' }, { href: '/archive', label: 'Archiv', icon: 'list' }, - { href: '/settings', label: 'Einstellungen', icon: 'settings' }, ]; + // User email for user dropdown + let userEmail = $derived(authStore.user?.email); + // Check if current page is a chat page (needs full-width layout) let isChatPage = $derived($page.url.pathname.startsWith('/chat')); @@ -183,6 +185,8 @@ primaryColor="#3b82f6" showAppSwitcher={true} {appItems} + {userEmail} + settingsHref="/settings" /> diff --git a/packages/shared-ui/src/navigation/PillAppDropdown.svelte b/packages/shared-ui/src/navigation/PillAppDropdown.svelte deleted file mode 100644 index 798483c63..000000000 --- a/packages/shared-ui/src/navigation/PillAppDropdown.svelte +++ /dev/null @@ -1,450 +0,0 @@ - - -
- - - - {#if isOpen} - - - - - - {/if} -
- - diff --git a/packages/shared-ui/src/navigation/PillNavigation.svelte b/packages/shared-ui/src/navigation/PillNavigation.svelte index 86cd72d34..5cfcac7c9 100644 --- a/packages/shared-ui/src/navigation/PillNavigation.svelte +++ b/packages/shared-ui/src/navigation/PillNavigation.svelte @@ -3,7 +3,24 @@ import type { PillNavItem, PillDropdownItem, PillNavElement, PillTabGroupConfig, PillAppItem } from './types'; import PillDropdown from './PillDropdown.svelte'; import PillTabGroup from './PillTabGroup.svelte'; - import PillAppDropdown from './PillAppDropdown.svelte'; + + // Convert app items to dropdown items + function appItemsToDropdownItems(apps: PillAppItem[]): PillDropdownItem[] { + return apps.map((app) => ({ + id: app.id, + label: app.name, + onClick: () => { + if (app.isCurrent) { + // Navigate to home route for current app + window.location.href = '/'; + } else if (app.url) { + window.open(app.url, '_blank', 'noopener,noreferrer'); + } + }, + active: app.isCurrent, + disabled: false, + })); + } interface Props { /** Navigation items */ @@ -58,6 +75,10 @@ appItems?: PillAppItem[]; /** Show app switcher dropdown */ showAppSwitcher?: boolean; + /** User email for user dropdown */ + userEmail?: string; + /** Settings page href */ + settingsHref?: string; } let { @@ -87,6 +108,8 @@ onThemeModeChange, appItems = [], showAppSwitcher = false, + userEmail, + settingsHref = '/settings', }: Props = $props(); // Type guards for elements @@ -232,12 +255,11 @@ {#if showAppSwitcher && appItems.length > 0} - {:else} @@ -410,8 +432,33 @@ {/if} - - {#if onLogout && showLogout} + + {#if userEmail} + { + window.location.href = settingsHref; + }, + active: currentPath === settingsHref, + }, + { + id: 'logout', + label: 'Logout', + icon: 'logout', + onClick: () => onLogout?.(), + danger: true, + }, + ]} + direction="down" + label={userEmail} + icon="user" + /> + {:else if onLogout && showLogout} +