diff --git a/frontend/src/lib/api/placeholders.ts b/frontend/src/lib/api/placeholders.ts new file mode 100644 index 0000000..5fad80e --- /dev/null +++ b/frontend/src/lib/api/placeholders.ts @@ -0,0 +1,60 @@ +import type { + CompletedPayload, + DashboardFoldersPayload, + DashboardSummaryPayload, + HostsPayload, + QueueLane +} from './types'; + +const emptyQueueLane: QueueLane = { + running: [], + queued: [], + pending_review: [], + running_count: 0, + queued_count: 0, + pending_review_count: 0 +}; + +export const initialDashboard: DashboardSummaryPayload = { + folders_preview: [], + library_colors: {}, + scan_job: null, + calibration_queue: { + sample: emptyQueueLane, + full: emptyQueueLane, + active_count: 0 + }, + encode_queue: { + running_count: 0, + queued_count: 0, + running: [], + queued: [], + state: { is_paused: false, stop_requested: false, scheduler_summary: 'loading' } + }, + catalog_empty: false, + folder_cache_key: 'loading', + metric_support: { vmaf: false, xpsnr: false, ssim: false }, + metric_status_copy: 'loading' +}; + +export const initialFoldersPayload: DashboardFoldersPayload = { + folders: [], + series_folders: [], + folder_cache_key: 'loading', + catalog_empty: false +}; + +export const initialHosts: HostsPayload = { compact: true, hosts: [] }; + +export const initialCompleted: CompletedPayload = { + folders: [], + completed_count: 0, + folders_with_backups_count: 0, + archive_cleanup: { + archive_root: '', + file_count: 0, + total_size_bytes: 0, + has_cleanup: false + }, + history: [] +}; diff --git a/frontend/src/lib/components/workstation/HomeWorkbenchView.svelte b/frontend/src/lib/components/workstation/HomeWorkbenchView.svelte index 368244a..7bdfdc0 100644 --- a/frontend/src/lib/components/workstation/HomeWorkbenchView.svelte +++ b/frontend/src/lib/components/workstation/HomeWorkbenchView.svelte @@ -184,20 +184,22 @@ isFolderIndex ? `Matching ${folderScopeLabel.toLowerCase()}` : 'Workflow lanes' ); const visibleScopeSummary = $derived( - foldersPending && !isFolderIndex - ? 'Loading work folders' + foldersPending + ? isFolderIndex + ? `Loading ${folderScopeLabel.toLowerCase()}` + : 'Loading work folders' : `${visibleFolders.length.toLocaleString('en-US')} / ${folders.length.toLocaleString( 'en-US' )} ${isFolderIndex ? folderScopeLabel.toLowerCase() : 'folders'}` ); const visibleFoldersCopy = $derived( - foldersPending && !isFolderIndex ? 'loading' : visibleFolders.length.toLocaleString('en-US') + foldersPending ? 'loading' : visibleFolders.length.toLocaleString('en-US') ); const visiblePendingCopy = $derived( - foldersPending && !isFolderIndex ? 'loading' : visiblePendingItems.toLocaleString('en-US') + foldersPending ? 'loading' : visiblePendingItems.toLocaleString('en-US') ); const visibleReclaimCopy = $derived( - foldersPending && !isFolderIndex ? 'loading' : formatBytes(visibleProjectedReclaim) + foldersPending ? 'loading' : formatBytes(visibleProjectedReclaim) ); type LibraryOption = { @@ -742,7 +744,9 @@ {/each} {:else if foldersPending}