The initial LB Sync tab (a7053a60 + df31d42b) rendered cards once
and never updated them as the discovery / sync flow progressed —
phase text stayed "Ready to discover", action button kept saying
"Discover", no progress counts. Tidal's cards by contrast update
phase + button + progress live throughout the entire flow because
Tidal's polling code calls ``updateTidalCardPhase`` /
``updateTidalCardProgress`` at every state transition.
Rather than patch the existing LB polling in sync-services.js with
parallel update hooks at every transition (4–6 injection points
across discovery + sync paths), this commit takes the lighter
route: a single 500ms refresh loop that reads the canonical
``listenbrainzPlaylistStates`` dict the polling code already
owns and updates the on-screen cards from it. The loop only ticks
while the LB tab is the active Sync tab — auto-stops the moment
the user switches away.
- ``_refreshOneLbSyncCard(card)`` — updates phase text + color
(via the shared ``getPhaseText`` / ``getPhaseColor`` helpers),
action button label (via ``getActionButtonText``), and the
per-card progress text in the same shape Tidal uses:
``♪ <total> / ✓ <matched> / ✗ <failed> / <percent>%``. Switches
to the sync-progress payload during syncing / sync_complete.
- ``_startLbSyncCardRefreshLoop`` — idempotent; kicked on tab
activation (in ``initializeSyncPage``) and right after the initial
``renderListenBrainzSyncPlaylists`` render if the tab is already
visible.
- Added the ``.playlist-card-progress`` slot to the LB card
template; hidden initially when phase=fresh, populated by the
refresh loop once discovery/sync begins.