From d48cf7ce72546a34d6e843d20cf26a2b4fa0d9f0 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Thu, 22 Jan 2026 09:06:23 +0100 Subject: [PATCH] feat: add sync status indicator and warning banner - Add SyncStatusIndicator component showing connection status in TopNav - Add SyncWarningBanner that appears after 30s of backend disconnection - Green dot when synced, amber pulsing when syncing, red when error/offline - Warning banner is dismissible but reappears on next failure Closes #11 --- .../layout/SyncStatusIndicator.svelte | 71 ++++++++ .../src/lib/components/layout/TopNav.svelte | 8 +- .../shared/SyncWarningBanner.svelte | 154 ++++++++++++++++++ frontend/src/routes/+layout.svelte | 4 + 4 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 frontend/src/lib/components/layout/SyncStatusIndicator.svelte create mode 100644 frontend/src/lib/components/shared/SyncWarningBanner.svelte diff --git a/frontend/src/lib/components/layout/SyncStatusIndicator.svelte b/frontend/src/lib/components/layout/SyncStatusIndicator.svelte new file mode 100644 index 0000000..c32ed07 --- /dev/null +++ b/frontend/src/lib/components/layout/SyncStatusIndicator.svelte @@ -0,0 +1,71 @@ + + +
+ + + + + {#if (displayStatus === 'error' || displayStatus === 'offline') && syncState.pendingCount > 0} + + {syncState.pendingCount} + + {/if} +
diff --git a/frontend/src/lib/components/layout/TopNav.svelte b/frontend/src/lib/components/layout/TopNav.svelte index 0e2d86c..812a18a 100644 --- a/frontend/src/lib/components/layout/TopNav.svelte +++ b/frontend/src/lib/components/layout/TopNav.svelte @@ -9,6 +9,7 @@ import ExportDialog from '$lib/components/shared/ExportDialog.svelte'; import ConfirmDialog from '$lib/components/shared/ConfirmDialog.svelte'; import ContextUsageBar from '$lib/components/chat/ContextUsageBar.svelte'; + import SyncStatusIndicator from './SyncStatusIndicator.svelte'; interface Props { /** Slot for the model select dropdown */ @@ -167,8 +168,13 @@ {/if} - +
+ +
+ +
+ +
+ +{/if} + + diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index 9b89824..256c1e6 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -17,6 +17,7 @@ import ModelSelect from '$lib/components/layout/ModelSelect.svelte'; import { ToastContainer, ShortcutsModal } from '$lib/components/shared'; import UpdateBanner from '$lib/components/shared/UpdateBanner.svelte'; + import SyncWarningBanner from '$lib/components/shared/SyncWarningBanner.svelte'; import type { LayoutData } from './$types'; import type { Snippet } from 'svelte'; @@ -184,5 +185,8 @@ + + + (showShortcutsModal = false)} />