mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 12:54:55 +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:
@@ -346,6 +346,15 @@ describe('CompareVideoPane', () => {
|
||||
'[data-testid="compare-video-area"] video',
|
||||
) as HTMLVideoElement
|
||||
expect(video.getAttribute('poster')).toBe('https://cdn.example.com/compare-poster.jpg')
|
||||
expect(video.className).toContain('blur-md')
|
||||
expect(video.className).toContain('scale-105')
|
||||
|
||||
act(() => {
|
||||
video.dispatchEvent(new Event('play'))
|
||||
})
|
||||
|
||||
expect(video.className).not.toContain('blur-md')
|
||||
expect(video.className).not.toContain('scale-105')
|
||||
})
|
||||
|
||||
it('shows loading spinner initially, transitions on loadeddata, and blocks play while loading', () => {
|
||||
|
||||
@@ -718,7 +718,7 @@ export const CompareVideoPane = forwardRef<ComparePaneHandle, CompareVideoPanePr
|
||||
{/* Native Video Layer (Hardware-accelerated, full HDR EDR) */}
|
||||
{!isAudio && (
|
||||
<div
|
||||
className="absolute pointer-events-none"
|
||||
className="absolute pointer-events-none overflow-hidden"
|
||||
style={{
|
||||
left: 0,
|
||||
top: 0,
|
||||
@@ -730,7 +730,10 @@ export const CompareVideoPane = forwardRef<ComparePaneHandle, CompareVideoPanePr
|
||||
>
|
||||
<video
|
||||
ref={videoRef}
|
||||
className="w-full h-full block object-contain pointer-events-none"
|
||||
className={cn(
|
||||
'w-full h-full block object-contain pointer-events-none',
|
||||
!hasStartedPlaying && file.preview?.thumbnailUrl && 'blur-md scale-105',
|
||||
)}
|
||||
playsInline
|
||||
preload="auto"
|
||||
poster={file.preview?.thumbnailUrl || undefined}
|
||||
|
||||
@@ -567,7 +567,7 @@ describe('VideoViewer', () => {
|
||||
expect(settingsButton?.textContent).not.toContain('1920p')
|
||||
})
|
||||
|
||||
it('sets poster on video element from file.preview.thumbnailUrl', () => {
|
||||
it('sets poster on video element from file.preview.thumbnailUrl and blurs until playback starts', () => {
|
||||
const videoWithThumb: AssetInfo = {
|
||||
id: 'video-thumb',
|
||||
name: 'thumb.mp4',
|
||||
@@ -597,6 +597,15 @@ describe('VideoViewer', () => {
|
||||
const { container } = render(<VideoViewer file={videoWithThumb} />)
|
||||
const video = container.querySelector('[data-testid="video-area"] video') as HTMLVideoElement
|
||||
expect(video.getAttribute('poster')).toBe('https://cdn.example.com/poster.jpg')
|
||||
expect(video.className).toContain('blur-md')
|
||||
expect(video.className).toContain('scale-105')
|
||||
|
||||
act(() => {
|
||||
video.dispatchEvent(new Event('play'))
|
||||
})
|
||||
|
||||
expect(video.className).not.toContain('blur-md')
|
||||
expect(video.className).not.toContain('scale-105')
|
||||
})
|
||||
|
||||
it('shows loading spinner initially and transitions to play overlay on loadeddata', () => {
|
||||
|
||||
@@ -1018,7 +1018,7 @@ const VideoViewer = React.forwardRef<MediaController, FileViewerProps>(
|
||||
{/* Native Video Layer (Hardware-accelerated, full HDR EDR) */}
|
||||
{!isAudio && (
|
||||
<div
|
||||
className="absolute pointer-events-none"
|
||||
className="absolute pointer-events-none overflow-hidden"
|
||||
style={{
|
||||
left: 0,
|
||||
top: 0,
|
||||
@@ -1030,7 +1030,10 @@ const VideoViewer = React.forwardRef<MediaController, FileViewerProps>(
|
||||
>
|
||||
<video
|
||||
ref={videoRef}
|
||||
className="w-full h-full block object-contain pointer-events-none"
|
||||
className={cn(
|
||||
'w-full h-full block object-contain pointer-events-none',
|
||||
!hasStartedPlaying && data.preview?.thumbnailUrl && 'blur-md scale-105',
|
||||
)}
|
||||
playsInline
|
||||
preload="auto"
|
||||
poster={data.preview?.thumbnailUrl || undefined}
|
||||
|
||||
Reference in New Issue
Block a user