mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-14 12:28:18 +02:00
feat: click sync indicator to trigger manual sync
Change sync indicator from div to button that calls sync() on click, with hover feedback and updated tooltip. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
51a832b3b9
commit
196d265635
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount, onDestroy } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
import { getSyncStatus, onSyncStatusChange, type SyncStatus } from '$lib/sync/client.js';
|
import { getSyncStatus, onSyncStatusChange, sync, type SyncStatus } from '$lib/sync/client.js';
|
||||||
import CloudCheck from 'lucide-svelte/icons/cloud-check';
|
import CloudCheck from 'lucide-svelte/icons/cloud-check';
|
||||||
import CloudSync from 'lucide-svelte/icons/cloud-sync';
|
import CloudSync from 'lucide-svelte/icons/cloud-sync';
|
||||||
import CloudOff from 'lucide-svelte/icons/cloud-off';
|
import CloudOff from 'lucide-svelte/icons/cloud-off';
|
||||||
@@ -44,7 +44,12 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex items-center" title="Sync status: {status}" data-testid="sync-indicator">
|
<button
|
||||||
|
class="flex cursor-pointer items-center rounded-sm p-1 transition-colors hover:bg-[var(--border-subtle)]/50"
|
||||||
|
title="Sync status: {status} — click to sync"
|
||||||
|
onclick={() => sync()}
|
||||||
|
data-testid="sync-indicator"
|
||||||
|
>
|
||||||
{#if displayStatus === 'synced'}
|
{#if displayStatus === 'synced'}
|
||||||
<CloudCheck class="h-5 w-5 text-[var(--primary)]" />
|
<CloudCheck class="h-5 w-5 text-[var(--primary)]" />
|
||||||
{:else if displayStatus === 'syncing'}
|
{:else if displayStatus === 'syncing'}
|
||||||
@@ -54,4 +59,4 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<CloudAlert class="h-5 w-5 text-[var(--destructive)]" />
|
<CloudAlert class="h-5 w-5 text-[var(--destructive)]" />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user