fix: address coderabbit round 3 — reactivity, a11y, user feedback

- Use getter function with until() for Pinia store reactivity (useErrorReport)
- Set alt="" on decorative thumbnail images (MissingMediaLibrarySelect)
- Show toast on unsupported file type instead of silent return
This commit is contained in:
jaeone94
2026-03-26 00:27:11 +09:00
parent 9fed1a40f7
commit ed578d8e93
3 changed files with 11 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ export function useErrorReport(cardSource: MaybeRefOrGetter<ErrorCardData>) {
if (!systemStatsStore.systemStats) {
if (systemStatsStore.isLoading) {
await until(systemStatsStore.isLoading).toBe(false)
await until(() => systemStatsStore.isLoading).toBe(false)
} else {
try {
await systemStatsStore.refetchSystemStats()

View File

@@ -52,7 +52,7 @@
<img
v-if="mediaType === 'image'"
:src="getPreviewUrl(option.value)"
:alt="option.name"
alt=""
class="size-8 shrink-0 rounded-sm object-cover"
loading="lazy"
/>

View File

@@ -138,7 +138,15 @@ export function useMissingMediaInteractions() {
: mediaType === 'video'
? 'video/'
: 'image/'
if (!file.type || !file.type.startsWith(expectedPrefix)) return
if (!file.type || !file.type.startsWith(expectedPrefix)) {
useToastStore().addAlert(
st(
'toastMessages.unsupportedFileType',
'Unsupported file type. Please select a valid file.'
)
)
return
}
store.uploadState[name] = { fileName: file.name, status: 'uploading' }