feat(integrity): ImageViewer badge for corrupt/unverified status

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 17:54:25 -04:00
parent d4d8976f29
commit 61b623de48
@@ -11,6 +11,13 @@
<v-icon>mdi-close</v-icon>
</button>
<v-chip
v-if="integrityBadge"
:color="integrityBadge.color"
class="fc-viewer__integrity"
size="x-small" variant="flat"
>{{ integrityBadge.label }}</v-chip>
<button
class="fc-viewer__nav fc-viewer__nav--prev"
:disabled="!modal.canPrev" @click="modal.goPrev()" aria-label="Previous"
@@ -68,6 +75,14 @@ const isVideo = computed(() =>
modal.current?.mime && modal.current.mime.startsWith('video/')
)
const integrityBadge = computed(() => {
const s = modal.current?.integrity_status
if (s === 'corrupt') return { color: 'error', label: 'Corrupt' }
if (s === 'failed_verification')
return { color: 'warning', label: 'Unverified' }
return null
})
let prevBodyOverflow = null
onMounted(async () => {
prevBodyOverflow = document.body.style.overflow
@@ -128,6 +143,9 @@ function isTextEntry(el) {
}
.fc-viewer__nav:disabled { opacity: 0.3; cursor: not-allowed; }
.fc-viewer__close { top: 16px; right: 16px; transform: none; }
.fc-viewer__integrity {
position: absolute; top: 72px; right: 16px; z-index: 3;
}
.fc-viewer__nav--prev { left: 16px; transform: translateY(-50%); }
.fc-viewer__nav--next { right: 16px; transform: translateY(-50%); }
.fc-viewer__body {