improvement(sync): reflect deep backfill as active in the header status

The header status only considered recent-sync pending, so it read "all synced"
while the scheduler was still backfilling full history — directly contradicting
the adjacent "N without full history" notice. Add an active "fetching history"
state (spinner) shown when recent sync is done but deep backfill is still
pending, so "all synced" appears only when nothing is pending at all. The admin
pause button now also shows during deep backfill (it's pausable work). Trilingual.
This commit is contained in:
npeter83 2026-06-15 04:30:27 +02:00
parent 5fba327d24
commit cb35b0e86e
4 changed files with 14 additions and 3 deletions

View file

@ -57,6 +57,13 @@ export default function SyncStatus({
<Loader2 className="w-3.5 h-3.5 animate-spin" />
{t("header.sync.syncing", { count: syncing })}
</span>
) : notFull > 0 ? (
// Recent uploads are in, but the scheduler is still backfilling full history —
// so "all synced" would be misleading. Reflect the deep work as active.
<span className="flex items-center gap-1">
<Loader2 className="w-3.5 h-3.5 animate-spin" />
{t("header.sync.backfillingHistory")}
</span>
) : (
<span>{t("header.sync.allSynced")}</span>
)}
@ -74,9 +81,10 @@ export default function SyncStatus({
</Tooltip>
</>
)}
{/* Pause only makes sense when there's work to pause; Resume must always show
while paused so it can be lifted. Hidden entirely when idle and not paused. */}
{isAdmin && (data.paused || syncing > 0) && (
{/* Pause only makes sense when there's work to pause (recent OR deep backfill);
Resume must always show while paused so it can be lifted. Hidden entirely when
idle and not paused. */}
{isAdmin && (data.paused || syncing > 0 || notFull > 0) && (
<button
onClick={() => toggle.mutate()}
disabled={toggle.isPending}