fix(video): refine transcript viewing and generation

This commit is contained in:
yiling
2026-12-03 16:00:41 +08:00
parent 5daa2a8f92
commit 543862ff9b
8 changed files with 67 additions and 25 deletions
@@ -74,10 +74,7 @@ const SegmentRow = memo(function SegmentRow({
<button
type="button"
aria-current={active ? 'true' : undefined}
className={cn(
'block w-full cursor-pointer select-text rounded-md px-3 py-2 text-start hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:outline-none',
active && 'bg-primary/10 font-medium text-foreground',
)}
className="block w-full cursor-pointer select-text rounded-md px-3 py-2 text-start hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:outline-none"
onClick={(event) => {
const selection = window.getSelection()
if (
@@ -95,7 +92,10 @@ const SegmentRow = memo(function SegmentRow({
{formatTranscriptTime(segment.startMs)} – {formatTranscriptTime(segment.endMs)}
</span>
<span
className="block text-sm leading-relaxed whitespace-pre-wrap wrap-anywhere"
className={cn(
'block text-sm leading-relaxed whitespace-pre-wrap wrap-anywhere',
active && 'font-bold text-primary',
)}
dir="auto"
>
{matches?.map((match) => {
@@ -108,7 +108,7 @@ const SegmentRow = memo(function SegmentRow({
<mark
data-current-match={selected ? '' : undefined}
className={cn(
'rounded-sm bg-primary/15 text-foreground',
'rounded-sm bg-primary/15 px-px text-foreground',
selected && 'bg-primary text-primary-foreground',
)}
>