mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-13 04:06:57 +02:00
- Extract toast store to standalone module so notes store can show toasts - Add try/catch to all note mutations with optimistic updates + IDB queue on network error - Wire up startSync/stopSync in layout to enable online/offline event listeners - Reload notes from server after successful sync push to prevent data loss - Connect SyncIndicator to real sync status with Lucide cloud icons - Add 300ms minimum display time for status transitions - Add e2e tests for offline create, edit, trash, and sync-on-reconnect Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.0 KiB
Svelte
39 lines
1.0 KiB
Svelte
<script lang="ts">
|
|
import '../app.css';
|
|
import Header from '$lib/components/Layout/Header.svelte';
|
|
import Sidebar from '$lib/components/Layout/Sidebar.svelte';
|
|
import Toast from '$lib/components/Layout/Toast.svelte';
|
|
import { loadNotes } from '$lib/stores/notes.js';
|
|
import { startSync, stopSync } from '$lib/sync/client.js';
|
|
import { onMount, onDestroy } from 'svelte';
|
|
|
|
let { data, children } = $props();
|
|
let sidebarOpen = $state(false);
|
|
|
|
onMount(() => {
|
|
loadNotes();
|
|
startSync();
|
|
});
|
|
|
|
onDestroy(() => {
|
|
stopSync();
|
|
});
|
|
</script>
|
|
|
|
<div class="flex min-h-screen flex-col bg-[var(--bg-base)] text-[var(--text)]">
|
|
<Header onMenuToggle={() => (sidebarOpen = !sidebarOpen)} />
|
|
<Sidebar open={sidebarOpen} />
|
|
|
|
<main class="flex-1 pt-4 transition-all lg:ml-64">
|
|
<div class="mx-auto max-w-7xl px-4">
|
|
{@render children()}
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="pb-4 pt-8 text-center text-xs text-[var(--text-muted)] lg:ml-64">
|
|
Crumbs by Bretzel v{data.appVersion} — made with 🥨 in Strasbourg
|
|
</footer>
|
|
|
|
<Toast />
|
|
</div>
|