Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1ea6ff5
send speech
qbc2016 Dec 10, 2025
060b174
add volume and playbackrate
qbc2016 Dec 11, 2025
841b3d9
refine
qbc2016 Dec 12, 2025
f18d7db
format
qbc2016 Dec 12, 2025
6576e77
Merge remote-tracking branch 'upstream/main' into client_speech_lsd
yuluo1007 Dec 24, 2025
5881776
fix: Speech
yuluo1007 Dec 24, 2025
db09a09
fix: isStreaming
yuluo1007 Dec 24, 2025
b51f0a7
fix: coder format
yuluo1007 Dec 24, 2025
000ee33
fix: audio continue
yuluo1007 Dec 24, 2025
079209d
fix: Speech Auto-play setplaybackRate setvolume
yuluo1007 Jan 6, 2026
53adfd4
fix: compatible FridayPage chat
yuluo1007 Jan 6, 2026
c851a70
fix: 流语音 setSpeechStates 优化
yuluo1007 Jan 7, 2026
eb51d16
fix: Speech setting
yuluo1007 Jan 7, 2026
8f67681
fix: stop currentPlayingReplyId
yuluo1007 Jan 7, 2026
ea9eba4
fix: auto play next speech
yuluo1007 Jan 8, 2026
bab6cfc
fix: speech
yuluo1007 Jan 9, 2026
bf205bd
fix: speech
yuluo1007 Jan 12, 2026
f0b9550
fix: showSpeechBar
yuluo1007 Jan 14, 2026
bac3c87
fix
yuluo1007 Jan 14, 2026
aebe950
fix: speech
yuluo1007 Jan 14, 2026
49f57eb
fix: add speech duration
yuluo1007 Jan 14, 2026
1f97180
fix: formatTime
yuluo1007 Jan 14, 2026
cee7500
fix
yuluo1007 Jan 14, 2026
750aa56
Merge remote-tracking branch 'upstream/main' into client_speech_lsd
yuluo1007 Jan 19, 2026
ace449b
Merge remote-tracking branch 'upstream/main' into client_speech_lsd
yuluo1007 Jan 20, 2026
bca841e
Merge remote-tracking branch 'upstream/main' into client_speech_lsd
yuluo1007 Jan 21, 2026
444db27
fix: speeh setSpeechStates
yuluo1007 Jan 26, 2026
498672b
Merge remote-tracking branch 'upstream/main' into client_speech_lsd
yuluo1007 Jan 27, 2026
a24fc68
Merge remote-tracking branch 'upstream/main' into client_speech_lsd
yuluo1007 Jan 28, 2026
48619bd
fix: SpeechBar
yuluo1007 Jan 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion packages/client/src/components/chat/AsChat/bubble.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
import { memo, ReactNode } from 'react';
import { memo, ReactNode, useMemo } from 'react';
import { ContentType, Reply, TextBlock } from '@shared/types';
import BubbleBlock, {
CollapsibleBlockDiv,
} from '@/components/chat/bubbles/BubbleBlock';
import SpeechBar from '@/components/chat/bubbles/SpeechBar';
import { CircleAlertIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { ReplySpeechState } from '@/context/RunRoomContext';

interface Props {
/** The reply data to display */
reply: Reply;
/** Avatar component to display */
avatar: ReactNode;
/** Whether to render content as markdown */
markdown: boolean;
/** Callback when bubble is clicked */
onClick: (reply: Reply) => void;
/** Whether to display user avatar on the right side */
userAvatarRight: boolean;
/** Speech state for this reply */
speechState?: ReplySpeechState;
/** Callback to play speech audio */
onPlaySpeech?: () => void;
/** Callback to pause speech audio */
onPauseSpeech?: () => void;
}

const AsBubble = ({
Expand All @@ -20,6 +33,9 @@ const AsBubble = ({
markdown,
onClick,
userAvatarRight = false,
speechState,
onPlaySpeech,
onPauseSpeech,
}: Props) => {
const { t } = useTranslation();

Expand All @@ -45,6 +61,14 @@ const AsBubble = ({
));
};

const showSpeechBar = useMemo(() => {
if (!speechState) return false;
return (
speechState.isStreaming ||
(speechState.fullAudioData?.length ?? 0) > 0
);
}, [speechState]);

return (
<div className="flex flex-col w-full max-w-full">
<div
Expand Down Expand Up @@ -86,6 +110,15 @@ const AsBubble = ({
</div>
</div>
</div>
{/* Speech bar - shown below the message content */}
{showSpeechBar && onPlaySpeech && onPauseSpeech && (
<SpeechBar
isPlaying={speechState?.isPlaying || false}
isStreaming={speechState?.isStreaming || false}
onPlay={onPlaySpeech}
onPause={onPauseSpeech}
/>
)}
</div>
);
};
Expand Down
Loading
Loading