fix(webui): restore full width bottom bar spanning across carousel in file viewer

This commit is contained in:
yiling
2026-08-25 21:27:20 +08:00
parent 59e641ccb3
commit 49f3fc0be5
6 changed files with 205 additions and 151 deletions
+13 -3
View File
@@ -5,15 +5,25 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
import { FileViewer } from './file-viewer'
import type { AssetInfo } from '@shumai/dtos'
const MockViewer = React.forwardRef<unknown, { file: AssetInfo; children?: React.ReactNode }>(
({ file, children }, ref) => {
React.useImperativeHandle(ref, () => ({}))
return (
<div>
<div data-testid={`viewer-${file.id}`}>{file.name}</div>
{children}
</div>
)
},
)
// Mock registry so getViewerForFile returns a simple test viewer
vi.mock('./viewers/registry', () => ({
getViewerForFile: () => ({
id: 'test-viewer',
name: 'Test Viewer',
match: () => true,
viewer: React.forwardRef<unknown, { file: AssetInfo }>(({ file }) => (
<div data-testid={`viewer-${file.id}`}>{file.name}</div>
)),
viewer: MockViewer,
}),
}))