the sync button exists somewhere again

It moved out to the panel's bar beside Build and Publish, and then the bar was removed — so for the
last few days there was no way to start a media sync from anywhere in this admin. The API route was
fine the whole time; nothing pressed it.

Quieter and worse: `SyncButton` is the only caller of `useMediaSyncFeed`, so with it unmounted the
progress card in Administration was not being polled either. It would have sat there through a running
sync showing nothing.

Back beside the two folders it operates on, which is where it was before and where somebody looking
after the media already is. Under the status line rather than beside it — that line runs to two clauses
and a button sharing the row would move as the counts changed.

Sync, Build and Publish still want a home of their own where all three are to hand without opening
Administration. This is the one that could not wait for it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-03 21:04:32 +01:00
co-authored by Claude Opus 5
parent 4587ce2d39
commit 5da573b219
+18 -5
View File
@@ -1,17 +1,24 @@
import { useEffect } from 'react';
import { CircleAlert } from 'lucide-react';
import { useMediaSync } from './useMediaSync';
import { SyncButton } from './SyncButton';
/**
* What syncing `derived/` is DOING, shown where the two folders are.
*
* ── The button is not here any more ──
* ── The button is back, because the bar it left for no longer exists ──
*
* It moved to the panel's bar, beside Build and Publish — see SyncButton for why. What stayed is
* everything that needs room to read: how far a run has got, which files failed, and the history.
* It moved out to the panel's bar beside Build and Publish, and then the bar was removed — so for a
* while there was no way to start a sync from anywhere in this admin. Worse quietly: `SyncButton` is
* the only caller of `useMediaSyncFeed`, so with it unmounted this card was not being polled either
* and showed a run that was going nowhere.
*
* Both read one `useGlobal` slot, so the button's label and this card cannot disagree about what is
* true. Nothing here fetches: the bar is mounted whenever the plugin is open and does the asking.
* Here is where it was before and where it belongs: beside the two folders it operates on, in the
* section somebody opens to look after the media. Both read one `useGlobal` slot, so the label and
* this card cannot disagree about what is true.
*
* `[open]` Sync, Build and Publish still want a home of their own where all three are to hand without
* opening Administration. This is the one that could not wait for it.
*
* ── Built and skipped are counted separately ──
*
@@ -78,6 +85,12 @@ export const MediaSync = ({ onSettled }: { onSettled?: (settled: boolean) => voi
: 'Web-ready copies of everything in originals.'}
</p>
{/* Under the sentence rather than beside it: the line above can run to two clauses, and a button
sharing that row moves as the counts change. */}
<div>
<SyncButton />
</div>
{running && (
<div className="h-1 w-full overflow-hidden rounded-full bg-muted">
{/* Indeterminate until the walk has counted: a bar that starts full and shrinks is worse than