diff --git a/qwen3-tts-frontend/src/components/ChapterPlayer.tsx b/qwen3-tts-frontend/src/components/ChapterPlayer.tsx
index 1d35066..9c7444b 100644
--- a/qwen3-tts-frontend/src/components/ChapterPlayer.tsx
+++ b/qwen3-tts-frontend/src/components/ChapterPlayer.tsx
@@ -3,7 +3,6 @@ import { useTheme } from '@/contexts/ThemeContext'
import WaveformPlayer from '@arraypress/waveform-player'
import '@arraypress/waveform-player/dist/waveform-player.css'
import { Button } from '@/components/ui/button'
-import { Badge } from '@/components/ui/badge'
import { X, Loader2 } from 'lucide-react'
import apiClient from '@/lib/api'
import { audiobookApi, type AudiobookSegment } from '@/lib/api/audiobook'
@@ -187,11 +186,9 @@ const ChapterPlayer = memo(({
{currentSeg && (
-
-
- {currentSeg.character_name || '未知角色'}
-
-
{currentSeg.text}
+
+ {currentSeg.character_name || '旁白'}
+ {currentSeg.text}
)}
>
diff --git a/qwen3-tts-frontend/src/pages/Audiobook.tsx b/qwen3-tts-frontend/src/pages/Audiobook.tsx
index 54d939c..fd0c584 100644
--- a/qwen3-tts-frontend/src/pages/Audiobook.tsx
+++ b/qwen3-tts-frontend/src/pages/Audiobook.tsx
@@ -1447,6 +1447,7 @@ function ChaptersPanel({
const [chapterPlayerChIdx, setChapterPlayerChIdx] = useState
(null)
const prevSegStatusRef = useRef>({})
const initialExpandDoneRef = useRef(false)
+ const segRefs = useRef>({})
useEffect(() => {
if (!scrollToChapterId) return
@@ -1457,6 +1458,17 @@ function ChaptersPanel({
onScrollToChapterDone()
}, [scrollToChapterId, onScrollToChapterDone])
+ useEffect(() => {
+ if (sequentialPlayingId === null || !detail) return
+ const seg = segments.find(s => s.id === sequentialPlayingId)
+ if (!seg) return
+ const ch = detail.chapters.find(c => c.chapter_index === seg.chapter_index)
+ if (ch) setExpandedChapters(prev => { const n = new Set(prev); n.add(ch.id); return n })
+ setTimeout(() => {
+ segRefs.current[sequentialPlayingId]?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
+ }, 50)
+ }, [sequentialPlayingId, detail, segments])
+
useEffect(() => {
const bumps: Record = {}
segments.forEach(seg => {
@@ -1712,6 +1724,7 @@ function ChaptersPanel({
return (
{ segRefs.current[seg.id] = el }}
className={`rounded-lg border overflow-hidden ${sequentialPlayingId === seg.id ? 'border-primary/40 bg-primary/5' : 'bg-card'}`}
>
{/* Card header */}