summaryrefslogtreecommitdiff
path: root/web/src/lib/ui/ConnectionBanner.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/lib/ui/ConnectionBanner.svelte')
-rw-r--r--web/src/lib/ui/ConnectionBanner.svelte20
1 files changed, 20 insertions, 0 deletions
diff --git a/web/src/lib/ui/ConnectionBanner.svelte b/web/src/lib/ui/ConnectionBanner.svelte
new file mode 100644
index 0000000..94bfd43
--- /dev/null
+++ b/web/src/lib/ui/ConnectionBanner.svelte
@@ -0,0 +1,20 @@
+<!--
+ The connection-status banner (PLAN.md Phase 3 "Connection UX"): shown
+ while the client is connecting for the first time or reconnecting after
+ a drop (the connection layer retries with backoff and re-sends `hello`
+ to resync). It is informational — no action is required from the user,
+ and the server overwrites any drifted state on resync.
+-->
+<script lang="ts">
+ import type { ConnectionStatus } from '$lib/protocol/connection';
+ import { t } from '$lib/i18n';
+
+ let { status }: { status: ConnectionStatus } = $props();
+
+ const visible = $derived(status === 'reconnecting' || status === 'connecting');
+ const text = $derived(status === 'reconnecting' ? t('web:reconnecting') : t('connecting'));
+</script>
+
+{#if visible}
+ <div class="banner" role="status">{text}</div>
+{/if}