UX fixes: suggestion-accept chip refresh, showcase endless feed, non-media downloads #48
@@ -41,11 +41,13 @@
|
|||||||
import { toast } from '../../utils/toast.js'
|
import { toast } from '../../utils/toast.js'
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useSuggestionsStore, CATEGORY_LABELS } from '../../stores/suggestions.js'
|
import { useSuggestionsStore, CATEGORY_LABELS } from '../../stores/suggestions.js'
|
||||||
|
import { useModalStore } from '../../stores/modal.js'
|
||||||
import SuggestionsCategoryGroup from './SuggestionsCategoryGroup.vue'
|
import SuggestionsCategoryGroup from './SuggestionsCategoryGroup.vue'
|
||||||
import AliasPickerDialog from './AliasPickerDialog.vue'
|
import AliasPickerDialog from './AliasPickerDialog.vue'
|
||||||
|
|
||||||
const props = defineProps({ imageId: { type: Number, required: true } })
|
const props = defineProps({ imageId: { type: Number, required: true } })
|
||||||
const store = useSuggestionsStore()
|
const store = useSuggestionsStore()
|
||||||
|
const modal = useModalStore()
|
||||||
|
|
||||||
// 'artist' (FC-2d-vii-c) and 'copyright' (2026-06-01) retired as
|
// 'artist' (FC-2d-vii-c) and 'copyright' (2026-06-01) retired as
|
||||||
// suggestion categories. Only 'character' remains as a people-style
|
// suggestion categories. Only 'character' remains as a people-style
|
||||||
@@ -59,9 +61,20 @@ const isEmpty = computed(() =>
|
|||||||
|
|
||||||
watch(() => props.imageId, (id) => { if (id != null) store.load(id) }, { immediate: true })
|
watch(() => props.imageId, (id) => { if (id != null) store.load(id) }, { immediate: true })
|
||||||
|
|
||||||
|
// After a successful accept/alias-accept, refresh the modal's current
|
||||||
|
// tag list so TagPanel's chip rail reflects the newly-attached tag.
|
||||||
|
// Operator-flagged 2026-06-01: the suggestion store dropped the
|
||||||
|
// suggestion (correct) but didn't propagate the new tag back into the
|
||||||
|
// modal store, so the chip rail looked unchanged even though the
|
||||||
|
// backend had recorded the application. Mirrors the addExistingTag /
|
||||||
|
// createAndAdd flows which already call reloadTags() after applying.
|
||||||
async function onAccept(s) {
|
async function onAccept(s) {
|
||||||
try { await store.accept(s) }
|
try {
|
||||||
catch (e) { toast({ text: `Accept failed: ${e.message}`, type: 'error' }) }
|
await store.accept(s)
|
||||||
|
await modal.reloadTags()
|
||||||
|
} catch (e) {
|
||||||
|
toast({ text: `Accept failed: ${e.message}`, type: 'error' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const aliasDialog = ref(false)
|
const aliasDialog = ref(false)
|
||||||
@@ -71,6 +84,7 @@ async function onAliasConfirm(canonicalTagId) {
|
|||||||
try {
|
try {
|
||||||
await store.aliasAccept(aliasTarget.value, canonicalTagId)
|
await store.aliasAccept(aliasTarget.value, canonicalTagId)
|
||||||
aliasDialog.value = false
|
aliasDialog.value = false
|
||||||
|
await modal.reloadTags()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toast({ text: `Alias failed: ${e.message}`, type: 'error' })
|
toast({ text: `Alias failed: ${e.message}`, type: 'error' })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user