feat(shared-auth-ui): add GuestWelcomeModal for guest onboarding

Add a unified welcome modal for guest mode that displays:
- App icon, name, and description from shared-branding
- Feature list of what guests can do (localized DE/EN)
- Warning about local-only data storage
- Login, Register, Help, and "Continue as Guest" buttons

New files:
- GuestWelcomeModal.svelte - The modal component
- guestWelcome.ts - localStorage utilities for tracking seen state

Integrated into: contacts, chat, todo, calendar, and clock apps
This commit is contained in:
Till-JS 2026-01-27 16:57:14 +01:00
parent 6402f287e8
commit 14c83cb4bd
10 changed files with 873 additions and 7 deletions

View file

@ -70,6 +70,7 @@
import { eventContextMenuStore } from '$lib/stores/eventContextMenu.svelte';
import { heatmapStore } from '$lib/stores/heatmap.svelte';
import { sessionEventsStore } from '$lib/stores/session-events.svelte';
import { GuestWelcomeModal, shouldShowGuestWelcome } from '@manacore/shared-auth-ui';
import type { CalendarViewType } from '@calendar/shared';
// App switcher items
@ -567,6 +568,9 @@
let showAuthGateModal = $state(false);
let authGateAction = $state<'save' | 'sync' | 'feature'>('save');
// Guest welcome modal state
let showGuestWelcome = $state(false);
// Show auth gate modal (can be called from child components)
function showAuthGate(action: 'save' | 'sync' | 'feature' = 'save') {
authGateAction = action;
@ -587,6 +591,11 @@
// Initialize session events for guest mode
sessionEventsStore.initialize();
// Show guest welcome modal for unauthenticated users
if (!authStore.isAuthenticated && shouldShowGuestWelcome('calendar')) {
showGuestWelcome = true;
}
// Load calendars and tags (works in both guest and authenticated mode)
await calendarsStore.fetchCalendars();
@ -839,6 +848,23 @@
action={authGateAction}
/>
<!-- Guest Welcome Modal -->
<GuestWelcomeModal
appId="calendar"
visible={showGuestWelcome}
onClose={() => (showGuestWelcome = false)}
onLogin={() => {
showGuestWelcome = false;
goto('/login');
}}
onRegister={() => {
showGuestWelcome = false;
goto('/register');
}}
helpHref="/help"
locale={currentLocale === 'en' ? 'en' : 'de'}
/>
<style>
.layout-container {
display: flex;