fix(subs): stop the lock/reload on source actions + regroup the row buttons
Lock/reload: every inline source action (check / backfill / recover / toggle / remove) ended by refetching the WHOLE subscription list (store.loadAll / refresh), which blocked the UI and re-rendered the table — collapsing the expanded row, which read as "locks then resets." The action APIs already return the updated source, so the store now patches that one row in place (_patchSource / _dropSource); the post-action loadAll/refresh calls are gone. Toggling enabled, starting/stopping a backfill, recovering, and removing are now instant and leave the expansion intact. Button regroup (operator-flagged: tiny, mis-clickable, not grouped by function): - New shared SourceActions.vue used by desktop SourceRow + mobile SourceCard. - Frequent actions stay as size="small" buttons: Check, Backfill/Stop. - Low-frequency / destructive actions move into a labelled overflow (⋮) menu — Preview backfill, Recover dropped near-duplicates, Remove source — so they can't be fat-fingered, and the labels spell out recover-vs-backfill. - Edit moves next to the source URL (its identity), out of the action cluster where it sat beside Remove. - Single-source Remove now confirms (it had no guard before). Tests: store patches/drops in place without dropping the cache. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -491,13 +491,26 @@ function openEditSource(source) {
|
||||
}
|
||||
|
||||
async function removeSource(source) {
|
||||
await store.remove(source.id, source.artist_id)
|
||||
await refresh()
|
||||
// Confirm — Remove moved into the overflow menu, but a destructive action
|
||||
// still deserves a guard (single-source removal had none before).
|
||||
if (!globalThis.window?.confirm(
|
||||
`Remove this ${source.platform} source?\n${source.url}\n\nThe artist and already-downloaded images stay.`,
|
||||
)) return
|
||||
try {
|
||||
// store._dropSource patches the cache in place — no full reload, so the
|
||||
// table + expansion don't reset (operator-flagged lock/reload, 2026-06-07).
|
||||
await store.remove(source.id, source.artist_id)
|
||||
} catch (e) {
|
||||
toast({ text: `Remove failed: ${e?.body?.detail || e?.message || e}`, type: 'error' })
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleSourceEnabled({ source, enabled }) {
|
||||
await store.update(source.id, { enabled }, source.artist_id)
|
||||
await refresh()
|
||||
try {
|
||||
await store.update(source.id, { enabled }, source.artist_id)
|
||||
} catch (e) {
|
||||
toast({ text: `Update failed: ${e?.body?.detail || e?.message || e}`, type: 'error' })
|
||||
}
|
||||
}
|
||||
|
||||
async function onSourceSaved() {
|
||||
@@ -557,7 +570,7 @@ async function onBackfill(source) {
|
||||
await store.startBackfill(source.id, source.artist_id)
|
||||
toast({ text: `Backfill started for ${source.artist_name}`, type: 'success' })
|
||||
}
|
||||
await store.loadAll()
|
||||
// startBackfill/stopBackfill patch the source in place — no full reload.
|
||||
} catch (e) {
|
||||
toast({
|
||||
text: `Backfill ${running ? 'stop' : 'start'} failed: ${e?.body?.detail || e?.message || e}`,
|
||||
@@ -573,7 +586,7 @@ async function onRecover(source) {
|
||||
try {
|
||||
await store.recoverSource(source.id, source.artist_id)
|
||||
toast({ text: `Recovery started for ${source.artist_name}`, type: 'success' })
|
||||
await store.loadAll()
|
||||
// recoverSource patches the source in place — no full reload.
|
||||
} catch (e) {
|
||||
toast({
|
||||
text: `Recovery start failed: ${e?.body?.detail || e?.message || e}`,
|
||||
|
||||
Reference in New Issue
Block a user