diff --git a/apps/todo/apps/web/src/lib/components/CollapsibleSection.svelte b/apps/todo/apps/web/src/lib/components/CollapsibleSection.svelte new file mode 100644 index 000000000..e7ac1bb11 --- /dev/null +++ b/apps/todo/apps/web/src/lib/components/CollapsibleSection.svelte @@ -0,0 +1,133 @@ + + +
+ + + {#if isOpen} +
+ {@render children()} +
+ {/if} +
+ + diff --git a/apps/todo/apps/web/src/lib/stores/tasks.svelte.ts b/apps/todo/apps/web/src/lib/stores/tasks.svelte.ts index 51d19f4e1..4cc2f8348 100644 --- a/apps/todo/apps/web/src/lib/stores/tasks.svelte.ts +++ b/apps/todo/apps/web/src/lib/stores/tasks.svelte.ts @@ -112,6 +112,33 @@ export const tasksStore = { } }, + /** + * Fetch all tasks (incomplete + completed) for unified view + */ + async fetchAllTasks() { + loading = true; + error = null; + try { + // Fetch both incomplete and completed tasks + const [incompleteTasks, completedTasks] = await Promise.all([ + tasksApi.getTasks({ isCompleted: false }), + tasksApi.getTasks({ isCompleted: true }), + ]); + // Deduplicate tasks by ID (in case API returns duplicates) + const allTasks = [...incompleteTasks, ...completedTasks]; + const uniqueTasksMap = new Map(); + for (const task of allTasks) { + uniqueTasksMap.set(task.id, task); + } + tasks = Array.from(uniqueTasksMap.values()); + } catch (e) { + error = e instanceof Error ? e.message : 'Failed to fetch all tasks'; + console.error('Failed to fetch all tasks:', e); + } finally { + loading = false; + } + }, + /** * Get tasks for a specific project */ diff --git a/apps/todo/apps/web/src/routes/(app)/+layout.svelte b/apps/todo/apps/web/src/routes/(app)/+layout.svelte index 1d70aebeb..067a337c9 100644 --- a/apps/todo/apps/web/src/routes/(app)/+layout.svelte +++ b/apps/todo/apps/web/src/routes/(app)/+layout.svelte @@ -65,10 +65,7 @@ // Navigation items for Todo const navItems: PillNavItem[] = [ - { href: '/', label: 'Inbox', icon: 'inbox' }, - { href: '/today', label: 'Heute', icon: 'calendar-day' }, - { href: '/upcoming', label: 'DemnÀchst', icon: 'calendar' }, - { href: '/completed', label: 'Erledigt', icon: 'check-circle' }, + { href: '/', label: 'Aufgaben', icon: 'list' }, { href: '/settings', label: 'Einstellungen', icon: 'settings' }, { href: '/feedback', label: 'Feedback', icon: 'chat' }, ]; diff --git a/apps/todo/apps/web/src/routes/(app)/+page.svelte b/apps/todo/apps/web/src/routes/(app)/+page.svelte index c73389f75..b816ccadb 100644 --- a/apps/todo/apps/web/src/routes/(app)/+page.svelte +++ b/apps/todo/apps/web/src/routes/(app)/+page.svelte @@ -1,38 +1,86 @@ - Inbox | Todo + Todo -
+
-

Inbox

-

Aufgaben ohne Projekt

+

Meine Aufgaben

+

Alle deine Aufgaben auf einen Blick

@@ -47,28 +95,94 @@
{tasksStore.error}
- {:else if tasksStore.incompleteTasks.length === 0} + {:else if allEmpty}
-
đŸ“„
-

Inbox ist leer

-

FĂŒge eine neue Aufgabe hinzu, um loszulegen.

+
+ +
+

Noch keine Aufgaben

+

Erstelle deine erste Aufgabe mit dem Eingabefeld oben.

{:else} - - {/if} +
+ + {#if overdueTasks.length > 0} + + + + {/if} - {#if viewStore.showCompleted && tasksStore.completedTasks.length > 0} -
-

- Erledigt ({tasksStore.completedTasks.length}) -

- + + + {#if todayTasks.length === 0} +
+

Keine Aufgaben fĂŒr heute

+
+ {:else} + + {/if} +
+ + + + {#if upcomingCount === 0} +
+

Keine anstehenden Aufgaben

+
+ {:else} +
+ {#each groupedUpcomingTasks() as group} +
+

+ {group.label} ({group.tasks.length}) +

+ +
+ {/each} +
+ {/if} +
+ + + + {#if completedTasks.length === 0} +
+

Noch keine erledigten Aufgaben

+
+ {:else} + + {/if} +
{/if}
diff --git a/apps/todo/apps/web/src/routes/(app)/completed/+page.svelte b/apps/todo/apps/web/src/routes/(app)/completed/+page.svelte deleted file mode 100644 index acb9b6c03..000000000 --- a/apps/todo/apps/web/src/routes/(app)/completed/+page.svelte +++ /dev/null @@ -1,58 +0,0 @@ - - - - Erledigt | Todo - - -
-
-

Erledigt

-

Erledigte Aufgaben

-
- - {#if isLoading || tasksStore.loading} -
-
-
- {:else if tasksStore.error} -
- {tasksStore.error} -
- {:else if tasksStore.completedTasks.length === 0} -
-
✅
-

Noch nichts erledigt

-

Erledigte Aufgaben werden hier angezeigt.

-
- {:else} - - {/if} -
- - diff --git a/apps/todo/apps/web/src/routes/(app)/settings/+page.svelte b/apps/todo/apps/web/src/routes/(app)/settings/+page.svelte index 95679fd01..0d4e0209f 100644 --- a/apps/todo/apps/web/src/routes/(app)/settings/+page.svelte +++ b/apps/todo/apps/web/src/routes/(app)/settings/+page.svelte @@ -2,75 +2,215 @@ import { onMount } from 'svelte'; import { goto } from '$app/navigation'; import { authStore } from '$lib/stores/auth.svelte'; + import { theme } from '$lib/stores/theme'; + import { userSettings } from '$lib/stores/user-settings.svelte'; + import { THEME_DEFINITIONS } from '@manacore/shared-theme'; + import { ThemeColorPreview } from '@manacore/shared-theme-ui'; + import { + SettingsPage, + SettingsSection, + SettingsCard, + SettingsRow, + SettingsToggle, + SettingsDangerZone, + SettingsDangerButton, + GlobalSettingsSection, + } from '@manacore/shared-ui'; - onMount(() => { + onMount(async () => { if (!authStore.isAuthenticated) { goto('/login'); + return; } + + // Load user settings from server + await userSettings.load(); }); + + function toggleDarkMode() { + theme.toggleMode(); + } + + async function handleLogout() { + await authStore.signOut(); + goto('/login'); + } Einstellungen | Todo -
-
-

Einstellungen

-
+ + + + {#snippet icon()} + + + + {/snippet} -
- -
-

Konto

+ + + {#snippet icon()} + + + + {/snippet} + -
-
-
-

E-Mail

-

- {authStore.user?.email || 'Nicht angemeldet'} -

-
-
+ + {#snippet icon()} + + + + {/snippet} + + Aktiv + + + + -
- + + + {#snippet icon()} + + + + {/snippet} + + + + {#snippet icon()} + + + + {/snippet} + + + goto('/themes')} + > + {#snippet icon()} + + + + {/snippet} + + Themes wÀhlen + + + +
+

Farbvorschau

+

+ So sieht die App mit dem aktuellen Theme aus +

+
+
-
+ + - -
-

Erscheinungsbild

+ + -

- Theme-Einstellungen sind in der Navigation verfĂŒgbar. -

-
+ + + {#snippet icon()} + + + + {/snippet} - -
-

Über

+ + + {#snippet icon()} + + + + {/snippet} + 1.0.0 + + + -
-

Todo App v1.0.0

-

Teil des ManaCore Ökosystems

-
-
-
-
- - + + + + {#snippet icon()} + + + + {/snippet} + + + diff --git a/apps/todo/apps/web/src/routes/(app)/today/+page.svelte b/apps/todo/apps/web/src/routes/(app)/today/+page.svelte deleted file mode 100644 index 78a19b03d..000000000 --- a/apps/todo/apps/web/src/routes/(app)/today/+page.svelte +++ /dev/null @@ -1,91 +0,0 @@ - - - - Heute | Todo - - -
-
-

Heute

-

FĂ€llige Aufgaben fĂŒr heute

-
- - - - {#if isLoading || tasksStore.loading} -
-
-
- {:else if tasksStore.error} -
- {tasksStore.error} -
- {:else} - {#if overdueTasks.length > 0} -
-

- - - - ÜberfĂ€llig ({overdueTasks.length}) -

- -
- {/if} - - {#if todayTasks.length > 0} -
-

- Heute ({todayTasks.length}) -

- -
- {/if} - - {#if overdueTasks.length === 0 && todayTasks.length === 0} -
-
🎉
-

Alles erledigt!

-

Keine Aufgaben fĂŒr heute.

-
- {/if} - {/if} -
- - diff --git a/apps/todo/apps/web/src/routes/(app)/upcoming/+page.svelte b/apps/todo/apps/web/src/routes/(app)/upcoming/+page.svelte deleted file mode 100644 index 64ffd66f2..000000000 --- a/apps/todo/apps/web/src/routes/(app)/upcoming/+page.svelte +++ /dev/null @@ -1,100 +0,0 @@ - - - - DemnÀchst | Todo - - -
-
-

DemnÀchst

-

Aufgaben der nÀchsten 7 Tage

-
- - {#if isLoading || tasksStore.loading} -
-
-
- {:else if tasksStore.error} -
- {tasksStore.error} -
- {:else if groupedTasks().length === 0} -
-
📅
-

Keine anstehenden Aufgaben

-

Keine Aufgaben in den nÀchsten 7 Tagen geplant.

-
- {:else} -
- {#each groupedTasks() as group} -
-

- {group.label} ({group.tasks.length}) -

- -
- {/each} -
- {/if} -
- -