fix(video): refine the sync to playback button

This commit is contained in:
yiling
2026-12-03 21:40:17 +08:00
parent 659ed5dab4
commit 1f95ecf110
3 changed files with 17 additions and 4 deletions
@@ -11,7 +11,7 @@ import { m } from '@/ui/paraglide/messages.js'
import { getLocale } from '@/ui/paraglide/runtime.js'
import type { TranscriptSegment } from '@shumai/dtos'
import { useQuery } from '@tanstack/react-query'
import { ChevronDown, ChevronUp, LocateFixed, Search, X } from 'lucide-react'
import { ChevronDown, ChevronUp, Search, X } from 'lucide-react'
import { memo, useEffect, useLayoutEffect, useMemo, useRef, useState, type RefObject } from 'react'
import { createTranscriptTimeline } from './transcript-timeline'
import { useTranscriptScroll } from './use-transcript-scroll'
@@ -379,13 +379,12 @@ export const TranscriptPanel = memo(function TranscriptPanel({
<Button
size="sm"
variant="outline"
className="pointer-events-auto bg-background shadow-md"
className="pointer-events-auto rounded-full shadow-md dark:bg-background dark:hover:bg-accent"
onClick={() => {
viewportRef.current?.focus({ preventScroll: true })
setFollowing(true)
}}
>
<LocateFixed />
{m.transcript_sync_to_playback()}
</Button>
</div>