feat: add per-video reprocess button to status bar
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getVersion } from '@tauri-apps/api/app';
|
import { getVersion } from '@tauri-apps/api/app';
|
||||||
import { session, upgradePreview } from '$lib/stores/videoSession.svelte';
|
import { session, upgradePreview, reprocessCurrentVideo } from '$lib/stores/videoSession.svelte';
|
||||||
|
|
||||||
let { onOpenAbout }: { onOpenAbout?: () => void } = $props();
|
let { onOpenAbout }: { onOpenAbout?: () => void } = $props();
|
||||||
|
|
||||||
@@ -25,6 +25,23 @@
|
|||||||
let isPreviewComplete = $derived(session.previewStatus === 'complete');
|
let isPreviewComplete = $derived(session.previewStatus === 'complete');
|
||||||
let isExportDownloading = $derived(session.exportStatus === 'downloading');
|
let isExportDownloading = $derived(session.exportStatus === 'downloading');
|
||||||
let isExportComplete = $derived(session.exportStatus === 'complete');
|
let isExportComplete = $derived(session.exportStatus === 'complete');
|
||||||
|
|
||||||
|
let canReprocess = $derived(
|
||||||
|
session.status === 'ready' &&
|
||||||
|
session.processingStep === 'done' &&
|
||||||
|
session.activeVideoPath !== null
|
||||||
|
);
|
||||||
|
|
||||||
|
let reprocessing = $state(false);
|
||||||
|
|
||||||
|
async function handleReprocess() {
|
||||||
|
reprocessing = true;
|
||||||
|
try {
|
||||||
|
await reprocessCurrentVideo();
|
||||||
|
} finally {
|
||||||
|
reprocessing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="status-bar">
|
<div class="status-bar">
|
||||||
@@ -53,6 +70,16 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<span class="status-text">Ready</span>
|
<span class="status-text">Ready</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if canReprocess && !isPreviewDownloading}
|
||||||
|
<button
|
||||||
|
class="reprocess-btn"
|
||||||
|
onclick={handleReprocess}
|
||||||
|
disabled={reprocessing}
|
||||||
|
title="Reprocess video (re-extract waveform, thumbnails, keyframes)"
|
||||||
|
>
|
||||||
|
{reprocessing ? '⏳' : '↻'}
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
{#if appVersion}
|
{#if appVersion}
|
||||||
<button class="version-btn" onclick={() => onOpenAbout?.()} title="About GUI Video Clipper">
|
<button class="version-btn" onclick={() => onOpenAbout?.()} title="About GUI Video Clipper">
|
||||||
v{appVersion}
|
v{appVersion}
|
||||||
@@ -108,6 +135,27 @@
|
|||||||
color: var(--bg-primary, #1e1e2e);
|
color: var(--bg-primary, #1e1e2e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.reprocess-btn {
|
||||||
|
background: none;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reprocess-btn:hover {
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.reprocess-btn:disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
.version-btn {
|
.version-btn {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
background: none;
|
background: none;
|
||||||
|
|||||||
Reference in New Issue
Block a user