feat(video): resize transcripts and follow playback earlier

This commit is contained in:
yiling
2026-12-03 16:30:53 +08:00
parent 543862ff9b
commit ce4ae6e33e
10 changed files with 236 additions and 30 deletions
@@ -7,7 +7,7 @@ import { FileViewer } from '@/ui/components/file-viewer'
import { FileViewerLeftSidebar } from '@/ui/components/file-viewer-left-sidebar'
import { FileViewerRightSidebar } from '@/ui/components/file-viewer-right-sidebar'
import { MobileFileDetail } from '@/ui/components/file-viewer/mobile-file-detail'
import { TranscriptPanel } from '@/ui/components/file-viewer/transcript-panel'
import { ResizableTranscriptPanel } from '@/ui/components/file-viewer/resizable-transcript-panel'
import { FileDetailSkeleton } from '@/ui/components/loading-skeletons'
import { ResizeHandle } from '@/ui/components/resize-handle'
import { ShareLinkCreatedDialog } from '@/ui/components/share-link-created-dialog'
@@ -83,6 +83,7 @@ function FileViewPage() {
} = useShareLinkActions({ projectId, enabled: canEdit })
const { teamId, ensureTeamIdForProject } = useTeamContextStore()
const [rightSidebarWidth, setRightSidebarWidth] = useState(360)
const [transcriptWidthPercent, setTranscriptWidthPercent] = useState(30)
const [annotations, setAnnotations] = useState<Annotation[]>([])
const { fileViewRightSidebarCollapsed } = useUiStore()
const { isChatbotOpen } = useChatbotStore()
@@ -822,7 +823,7 @@ function FileViewPage() {
return (
<div className="h-full flex flex-1 flex-col bg-background">
<div className="h-full flex flex-1 overflow-hidden">
<div className="flex-1 relative">
<div className="relative min-w-0 flex-1">
{isFetching && !isCompareMode && (
<div className="absolute inset-0 z-10 flex items-center justify-center bg-background/50">
<Loader2 className="h-8 w-8 animate-spin text-foreground" />
@@ -859,11 +860,12 @@ function FileViewPage() {
transcriptToggle={transcript?.toggle}
>
{transcript?.panel && (
<TranscriptPanel
<ResizableTranscriptPanel
key={transcript.panel.assetId}
{...transcript.panel}
mediaControllerRef={mediaControllerRef}
className="w-[30vw] max-w-[48%] border-r border-border"
widthPercent={transcriptWidthPercent}
setWidthPercent={setTranscriptWidthPercent}
/>
)}
<div className={transcript?.panel ? 'hidden' : 'contents'}>