diff --git a/src/components/chat/AgentWorkspace.test.tsx b/src/components/chat/AgentWorkspace.test.tsx
index 134d6ac..a135fdf 100644
--- a/src/components/chat/AgentWorkspace.test.tsx
+++ b/src/components/chat/AgentWorkspace.test.tsx
@@ -34,10 +34,6 @@ jest.mock("framer-motion", () => ({
},
}));
-jest.mock("./GlobalChatbox.parts", () => ({
- TypingIndicator: () =>
typing
,
-}));
-
jest.mock("./AgentTurn", () => ({
AgentTurn: ({ message, isStreaming }: { message: Message; isStreaming: boolean }) => {
React.useEffect(() => {
diff --git a/src/components/chat/AgentWorkspace.tsx b/src/components/chat/AgentWorkspace.tsx
index 00a63a0..2833b7e 100644
--- a/src/components/chat/AgentWorkspace.tsx
+++ b/src/components/chat/AgentWorkspace.tsx
@@ -10,7 +10,6 @@ import TroubleshootRounded from "@mui/icons-material/TroubleshootRounded";
import MapRounded from "@mui/icons-material/MapRounded";
import { AgentTurn } from "./AgentTurn";
-import { TypingIndicator } from "./GlobalChatbox.parts";
import type { PermissionReply } from "@/lib/chatStream";
import type {
Message,
@@ -39,7 +38,7 @@ type AgentWorkspaceProps = {
type TurnListProps = {
messages: Message[];
- isStreaming: boolean;
+ isAssistantStreaming: boolean;
streamingMessageId: string | null;
speakingMessageId: string | null;
speechState: SpeechState;
@@ -65,7 +64,7 @@ const TurnItem = React.memo(AgentTurn);
const TurnListInner = ({
messages,
- isStreaming,
+ isAssistantStreaming,
streamingMessageId,
speakingMessageId,
speechState,
@@ -85,7 +84,7 @@ const TurnListInner = ({
sameMessages(prevProps.messages, nextProps.messages) &&
- prevProps.isStreaming === nextProps.isStreaming &&
+ prevProps.isAssistantStreaming === nextProps.isAssistantStreaming &&
prevProps.streamingMessageId === nextProps.streamingMessageId &&
prevProps.speakingMessageId === nextProps.speakingMessageId &&
prevProps.speechState === nextProps.speechState &&
@@ -318,19 +317,10 @@ export const AgentWorkspace = ({
onReplyQuestion,
onRejectQuestion,
}: AgentWorkspaceProps) => {
- const theme = useTheme();
- const latestAssistant = [...messages]
- .reverse()
- .find((message) => message.role === "assistant");
- const showTypingIndicator =
- isStreaming &&
- (!latestAssistant ||
- (latestAssistant.content.trim().length === 0 &&
- !(latestAssistant.artifacts?.length)));
- const streamingMessage =
+ const streamingMessageId =
isStreaming && messages.at(-1)?.role === "assistant"
- ? messages.at(-1)
- : undefined;
+ ? messages.at(-1)?.id ?? null
+ : null;
const handleScroll = React.useCallback(
(event: React.UIEvent) => {
if (!onScrollStateChange) return;
@@ -372,8 +362,8 @@ export const AgentWorkspace = ({
)}
- {!isLoadingSession && showTypingIndicator ? (
-
-
-
-
-
- ) : null}
-
{
- return (
-
- {[0, 1, 2].map((i) => (
-
-
-
- ))}
-
- );
-};
export const Blob = ({
color,