mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 05:54:44 +00:00
fix(webui): fix loading skeleton layout mismatches and keep left carousel visible (#485)
* fix(webui): fix loading skeleton layout mismatches and keep left carousel visible * fix(webui): update mobile file list skeleton to match card layout * fix(webui): blur video poster before playback with instant cut on play * docs: consolidate webui changelog entries into single line
This commit is contained in:
@@ -2,46 +2,38 @@ import { Skeleton } from '@/ui/components/ui/skeleton'
|
||||
|
||||
export function ProjectFolderSkeleton() {
|
||||
return (
|
||||
<div className="flex h-screen flex-col bg-background min-h-0">
|
||||
{/* Top navigation/breadcrumbs placeholder */}
|
||||
<div className="flex h-14 items-center justify-between border-b px-6 shrink-0">
|
||||
<div className="flex flex-1 overflow-hidden bg-background min-h-0">
|
||||
{/* Sidebar (Folder tree placeholder) */}
|
||||
<div className="w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-4 w-4 rounded" />
|
||||
<Skeleton className="h-4 w-24" />
|
||||
<span className="text-muted-foreground">/</span>
|
||||
<Skeleton className="h-4 w-32" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-8 w-8 rounded-md" />
|
||||
<Skeleton className="h-8 w-20 rounded-md" />
|
||||
<div className="pl-4 space-y-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-3 w-3 rounded" />
|
||||
<Skeleton className="h-3 w-28" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-3 w-3 rounded" />
|
||||
<Skeleton className="h-3 w-20" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-3 w-3 rounded" />
|
||||
<Skeleton className="h-3 w-24" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-1 overflow-hidden">
|
||||
{/* Sidebar (Folder tree placeholder) */}
|
||||
<div className="w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-4 w-4 rounded" />
|
||||
<Skeleton className="h-4 w-24" />
|
||||
</div>
|
||||
<div className="pl-4 space-y-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-3 w-3 rounded" />
|
||||
<Skeleton className="h-3 w-28" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-3 w-3 rounded" />
|
||||
<Skeleton className="h-3 w-20" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-3 w-3 rounded" />
|
||||
<Skeleton className="h-3 w-24" />
|
||||
</div>
|
||||
</div>
|
||||
{/* Main content area */}
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
{/* Mobile: matches MobileFileBrowserContentSkeleton */}
|
||||
<div className="block md:hidden">
|
||||
<MobileFileBrowserContentSkeleton />
|
||||
</div>
|
||||
|
||||
{/* File Browser area */}
|
||||
<div className="flex-1 p-6 space-y-6 overflow-y-auto">
|
||||
{/* File browser toolbar */}
|
||||
{/* Desktop: file browser toolbar + card grid */}
|
||||
<div className="hidden md:block p-6 space-y-6">
|
||||
<div className="flex items-center justify-between border-b pb-4">
|
||||
<div className="flex items-center gap-4">
|
||||
<Skeleton className="h-5 w-40" />
|
||||
@@ -53,27 +45,7 @@ export function ProjectFolderSkeleton() {
|
||||
<Skeleton className="h-8 w-32 rounded" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Cards Grid */}
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-4 w-24" />
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
|
||||
{Array.from({ length: 10 }).map((_, i) => (
|
||||
<div key={i} className="flex flex-col rounded-lg border bg-card p-3 space-y-3">
|
||||
<Skeleton className="aspect-square w-full rounded-md" />
|
||||
<div className="space-y-2">
|
||||
<Skeleton className="h-4 w-3/4" />
|
||||
<div className="flex justify-between items-center">
|
||||
<Skeleton className="h-3 w-1/4" />
|
||||
<Skeleton className="h-3 w-1/3" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<FileBrowserContentSkeleton />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,54 +54,69 @@ export function ProjectFolderSkeleton() {
|
||||
|
||||
export function FileDetailSkeleton() {
|
||||
return (
|
||||
<div className="h-screen flex flex-col bg-background">
|
||||
{/* Top navigation */}
|
||||
<div className="flex h-14 items-center justify-between border-b px-6 shrink-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-4 w-16" />
|
||||
<span className="text-muted-foreground">/</span>
|
||||
<Skeleton className="h-4 w-28" />
|
||||
<span className="text-muted-foreground">/</span>
|
||||
<Skeleton className="h-4 w-32" />
|
||||
<div className="h-full flex-1 flex flex-col bg-background overflow-hidden">
|
||||
{/* Mobile-only view: matches MobileFileDetail */}
|
||||
<div className="flex md:hidden flex-col h-full w-full overflow-hidden">
|
||||
{/* Mobile File Header placeholder */}
|
||||
<div className="h-14 flex items-center justify-between border-b px-4 shrink-0 bg-card">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-8 w-8 rounded-full" />
|
||||
<Skeleton className="h-4 w-32" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-7 w-7 rounded" />
|
||||
<Skeleton className="h-7 w-7 rounded" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-8 w-20 rounded" />
|
||||
{/* Media area placeholder */}
|
||||
<div className="flex-1 min-h-0 bg-muted/20 flex items-center justify-center relative p-4">
|
||||
<Skeleton className="w-full max-w-sm aspect-video rounded-lg" />
|
||||
</div>
|
||||
{/* Bottom sheet placeholder */}
|
||||
<div className="h-[45%] border-t bg-card rounded-t-xl p-4 flex flex-col gap-3 shrink-0">
|
||||
<div className="flex items-center justify-between border-b pb-2">
|
||||
<div className="flex gap-4">
|
||||
<Skeleton className="h-4 w-16" />
|
||||
<Skeleton className="h-4 w-16" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3 flex-1">
|
||||
<Skeleton className="h-12 w-full rounded" />
|
||||
<Skeleton className="h-12 w-full rounded" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-1 overflow-hidden">
|
||||
{/* Left Pane (Version stack) */}
|
||||
<div className="w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex">
|
||||
<Skeleton className="h-5 w-24" />
|
||||
<div className="space-y-3 flex-1 overflow-y-auto">
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
<div key={i} className="flex gap-3 p-2 rounded border">
|
||||
<Skeleton className="h-12 w-12 rounded bg-muted shrink-0" />
|
||||
<div className="space-y-2 flex-1">
|
||||
<Skeleton className="h-3 w-2/3" />
|
||||
<Skeleton className="h-2 w-1/2" />
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
{/* Desktop view: Left Carousel (96px) + Center Full-Bleed Viewer + Right Sidebar (360px) */}
|
||||
<div className="hidden md:flex h-full flex-1 overflow-hidden">
|
||||
{/* Left Carousel Skeleton (96px / w-24) */}
|
||||
<div className="w-24 bg-gray-100 dark:bg-gray-950 flex flex-col items-center py-4 gap-3 shrink-0 border-r">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<Skeleton key={i} className="w-[52px] h-[52px] rounded-lg shrink-0" />
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Center Pane (Viewer area) */}
|
||||
<div className="flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0">
|
||||
<div className="flex-1 flex items-center justify-center">
|
||||
<Skeleton className="w-full max-w-4xl aspect-video rounded-lg shadow-lg" />
|
||||
{/* Center Viewer Area */}
|
||||
<div className="flex-1 bg-muted/10 relative flex flex-col min-w-0 justify-between">
|
||||
<div className="flex-1 flex items-center justify-center p-8">
|
||||
<Skeleton className="w-full max-w-4xl aspect-video rounded-lg shadow-sm" />
|
||||
</div>
|
||||
<div className="mt-4 flex items-center justify-between shrink-0">
|
||||
<div className="flex items-center gap-4">
|
||||
<Skeleton className="h-8 w-8 rounded-full" />
|
||||
<Skeleton className="h-4 w-32" />
|
||||
{/* Bottom video control bar placeholder */}
|
||||
<div className="h-12 border-t px-4 flex items-center justify-between bg-card shrink-0">
|
||||
<div className="flex items-center gap-3">
|
||||
<Skeleton className="h-6 w-6 rounded" />
|
||||
<Skeleton className="h-4 w-20" />
|
||||
</div>
|
||||
<Skeleton className="h-3 flex-1 mx-6" />
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-6 w-6 rounded" />
|
||||
<Skeleton className="h-6 w-6 rounded" />
|
||||
</div>
|
||||
<Skeleton className="h-4 w-24" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right Pane (Metadata and Comments) */}
|
||||
<div className="w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card">
|
||||
{/* Right Sidebar Skeleton (360px) */}
|
||||
<div className="w-[360px] border-l p-4 hidden lg:flex flex-col gap-6 shrink-0 bg-card">
|
||||
{/* Metadata Section */}
|
||||
<div className="space-y-4">
|
||||
<Skeleton className="h-5 w-32" />
|
||||
@@ -214,18 +201,30 @@ export function FileBrowserContentSkeleton({
|
||||
export function MobileFileBrowserContentSkeleton() {
|
||||
return (
|
||||
<div
|
||||
className="p-3 space-y-3 max-w-lg mx-auto w-full"
|
||||
className="p-3 pb-24 max-w-lg mx-auto w-full"
|
||||
data-testid="mobile-file-browser-loading-skeleton"
|
||||
>
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<div key={i} className="flex items-center gap-3 p-3 rounded-lg border bg-card">
|
||||
<Skeleton className="h-10 w-10 rounded-md shrink-0" />
|
||||
<div className="space-y-2 flex-1">
|
||||
<Skeleton className="h-4 w-3/4" />
|
||||
<Skeleton className="h-3 w-1/3" />
|
||||
<div className="flex items-center gap-2 mb-3">
|
||||
<Skeleton className="h-4 w-4 rounded" />
|
||||
<Skeleton className="h-4 w-28 rounded" />
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-4 w-full">
|
||||
{Array.from({ length: 3 }).map((_, i) => (
|
||||
<div
|
||||
key={i}
|
||||
className="flex flex-col overflow-hidden rounded-xl border border-border bg-card m-1"
|
||||
>
|
||||
<Skeleton className="aspect-square w-full rounded-none" />
|
||||
<div className="p-3 space-y-2">
|
||||
<Skeleton className="h-4 w-3/4" />
|
||||
<div className="flex justify-between items-center pt-1">
|
||||
<Skeleton className="h-3 w-1/3" />
|
||||
<Skeleton className="h-3 w-1/4" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user