mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
优化批量转写的显示效果
This commit is contained in:
@@ -15,6 +15,7 @@ export const BatchTranscribeGlobal: React.FC = () => {
|
||||
showToast,
|
||||
showResult,
|
||||
result,
|
||||
sessionName,
|
||||
setShowToast,
|
||||
setShowResult
|
||||
} = useBatchTranscribeStore()
|
||||
@@ -27,7 +28,7 @@ export const BatchTranscribeGlobal: React.FC = () => {
|
||||
<div className="batch-progress-toast-header">
|
||||
<div className="batch-progress-toast-title">
|
||||
<Loader2 size={14} className="spin" />
|
||||
<span>批量转写中</span>
|
||||
<span>批量转写中{sessionName ? `(${sessionName})` : ''}</span>
|
||||
</div>
|
||||
<button className="batch-progress-toast-close" onClick={() => setShowToast(false)} title="最小化">
|
||||
<X size={14} />
|
||||
|
||||
@@ -1277,7 +1277,7 @@ function ChatPage(_props: ChatPageProps) {
|
||||
const session = sessions.find(s => s.username === currentSessionId)
|
||||
if (!session) return
|
||||
|
||||
startTranscribe(voiceMessages.length)
|
||||
startTranscribe(voiceMessages.length, session.displayName || session.username)
|
||||
|
||||
// 检查模型状态
|
||||
const modelStatus = await window.electronAPI.whisper.getModelStatus()
|
||||
|
||||
@@ -11,9 +11,11 @@ export interface BatchTranscribeState {
|
||||
showResult: boolean
|
||||
/** 转写结果 */
|
||||
result: { success: number; fail: number }
|
||||
/** 当前转写的会话名 */
|
||||
sessionName: string
|
||||
|
||||
// Actions
|
||||
startTranscribe: (total: number) => void
|
||||
startTranscribe: (total: number, sessionName: string) => void
|
||||
updateProgress: (current: number, total: number) => void
|
||||
finishTranscribe: (success: number, fail: number) => void
|
||||
setShowToast: (show: boolean) => void
|
||||
@@ -27,13 +29,15 @@ export const useBatchTranscribeStore = create<BatchTranscribeState>((set) => ({
|
||||
showToast: false,
|
||||
showResult: false,
|
||||
result: { success: 0, fail: 0 },
|
||||
sessionName: '',
|
||||
|
||||
startTranscribe: (total) => set({
|
||||
startTranscribe: (total, sessionName) => set({
|
||||
isBatchTranscribing: true,
|
||||
showToast: true,
|
||||
progress: { current: 0, total },
|
||||
showResult: false,
|
||||
result: { success: 0, fail: 0 }
|
||||
result: { success: 0, fail: 0 },
|
||||
sessionName
|
||||
}),
|
||||
|
||||
updateProgress: (current, total) => set({
|
||||
@@ -55,6 +59,7 @@ export const useBatchTranscribeStore = create<BatchTranscribeState>((set) => ({
|
||||
progress: { current: 0, total: 0 },
|
||||
showToast: false,
|
||||
showResult: false,
|
||||
result: { success: 0, fail: 0 }
|
||||
result: { success: 0, fail: 0 },
|
||||
sessionName: ''
|
||||
})
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user