fix(home): preview reflects what's on the frame, not what's queued
CI / test (push) Has been cancelled

Both the backend preview endpoint and the frontend cache-buster were
preferring lockedImage over currentImage. Locking is a queued override
that doesn't take effect until the device's next poll, so showing it on
Home before the device has actually pulled it lied about the frame's
state. Always use currentImage now.

Also: add a primary "+ Add Photo" button at the top of the Library page
so users can upload without bouncing back to Home; updates the empty-
state copy to point at the new button.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-06 19:15:14 -04:00
parent 328ad632d3
commit 2cd558bac3
17 changed files with 125 additions and 21 deletions
+6 -2
View File
@@ -177,9 +177,13 @@ function nextSyncLabel(device: Device): string | null {
return `next sync in ${Math.round(fromNow / 3_600_000)}h`
}
// Home shows what's actually on the frame right now — the last image the
// device pulled. Lock/queue state is intentionally ignored; the preview
// won't change until the frame next polls and switches to the locked image.
function previewUrl(device: Device): string | undefined {
const imageId = device.lockedImageId ?? device.currentImageId
return imageId ? `/api/devices/${device.id}/preview?v=${imageId}` : undefined
return device.currentImageId
? `/api/devices/${device.id}/preview?v=${device.currentImageId}`
: undefined
}
import FrameCard from '@/components/FrameCard.vue'
import BaseBottomSheet from '@/components/BaseBottomSheet.vue'