From 6926538589659f41ddf20315697cfa6bcd3d6e8d Mon Sep 17 00:00:00 2001 From: Towsty Date: Mon, 31 Aug 2026 18:50:29 -0500 Subject: [PATCH] Hide the extend last-frame preview by default on xAIGen. Co-authored-by: Cursor --- pages/index.vue | 72 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 4020bb9..c5edd51 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1311,8 +1311,22 @@ -
- Last frame +
+ Last frame +

{{ lastFrameLoading ? 'Reading last frame…' : 'Last frame preview unavailable' }}

@@ -2448,6 +2462,7 @@ const extendPrompt = ref('') const extendDuration = ref(5) const lastFrameUrl = ref('') const lastFrameLoading = ref(false) +const lastFrameRevealed = ref(false) const watchingLibrary = ref(false) let lastFrameObjectUrl = '' let lastFrameGen = 0 @@ -2801,6 +2816,11 @@ const videoModelHint = computed(() => { const frameCount = computed(() => Math.max(5, Math.floor(duration.value * fps.value))) const cfgPct = computed(() => ((cfg.value - CFG_MIN) / (CFG_MAX - CFG_MIN)) * 100) const currentClip = computed(() => clips.value.find(clip => clip.id === currentClipId.value)) +const hideExtendLastFrame = computed(() => ( + showPrivacyToggles.value + && !lastFrameRevealed.value + && (hideInputPreview.value || hideThumbnail.value || currentClip.value?.hideThumbnail === true) +)) const canExtend = computed(() => Boolean( videoUrl.value && !lockedSave.value @@ -3731,6 +3751,12 @@ watch(hideThumbnail, (value) => { } catch { /* ignore */ } }) +watch(hideExtendLastFrame, (hidden) => { + if (hidden || !extendOpen.value) return + const id = currentClipId.value || clipIdFromPlayer() + if (id && !lastFrameUrl.value && !lastFrameLoading.value) void loadLastFrame(id) +}) + watch(withSound, (value) => { try { localStorage.setItem('aigen-generate-sound', String(value)) @@ -5153,6 +5179,7 @@ function concealFromOutsideTap(event: Event) { if (concealEditOutput.value && !editAwaitingReveal.value && !editLockedSave.value && editResultUrl.value) { editAwaitingReveal.value = true } + if (showPrivacyToggles.value) lastFrameRevealed.value = false } function concealAndPause() { @@ -5399,6 +5426,7 @@ function closeExtend() { lastFrameGen += 1 extendOpen.value = false lastFrameLoading.value = false + lastFrameRevealed.value = false if (lastFrameObjectUrl) { URL.revokeObjectURL(lastFrameObjectUrl) lastFrameObjectUrl = '' @@ -5406,6 +5434,29 @@ function closeExtend() { lastFrameUrl.value = '' } +async function loadLastFrame(id: string) { + lastFrameLoading.value = true + const gen = ++lastFrameGen + try { + const blob = await $fetch(`/api/library/clips/${id}/last-frame`, { responseType: 'blob' }) + if (gen !== lastFrameGen) return + if (lastFrameObjectUrl) URL.revokeObjectURL(lastFrameObjectUrl) + lastFrameObjectUrl = URL.createObjectURL(blob) + lastFrameUrl.value = lastFrameObjectUrl + } catch (error: any) { + if (gen !== lastFrameGen) return + toast(error?.data?.statusMessage || 'Could not extract the last frame') + } finally { + if (gen === lastFrameGen) lastFrameLoading.value = false + } +} + +function revealExtendLastFrame() { + lastFrameRevealed.value = true + const id = currentClipId.value || clipIdFromPlayer() + if (id && !lastFrameUrl.value && !lastFrameLoading.value) void loadLastFrame(id) +} + async function openExtend(item?: LibraryClip) { if (item) openClip(item) const id = item?.id || clipIdFromPlayer() @@ -5418,23 +5469,12 @@ async function openExtend(item?: LibraryClip) { extendPrompt.value = clip?.prompt || prompt.value extendDuration.value = clampDuration(duration.value) extendLoraStack.value = readLoraStack(clip) + lastFrameRevealed.value = false extendOpen.value = true - lastFrameLoading.value = true lastFrameUrl.value = '' + lastFrameLoading.value = false player.value?.pause() - const gen = ++lastFrameGen - try { - const blob = await $fetch(`/api/library/clips/${id}/last-frame`, { responseType: 'blob' }) - if (gen !== lastFrameGen) return - if (lastFrameObjectUrl) URL.revokeObjectURL(lastFrameObjectUrl) - lastFrameObjectUrl = URL.createObjectURL(blob) - lastFrameUrl.value = lastFrameObjectUrl - } catch (error: any) { - if (gen !== lastFrameGen) return - toast(error?.data?.statusMessage || 'Could not extract the last frame') - } finally { - if (gen === lastFrameGen) lastFrameLoading.value = false - } + if (!hideExtendLastFrame.value) await loadLastFrame(id) } async function generateExtension() {