MCPcopy
hub / github.com/MODSetter/SurfSense / ThinkingStepsPart

Function ThinkingStepsPart

surfsense_web/components/assistant-ui/thread.tsx:547–567  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

545 * Custom component to render thinking steps from Context
546 */
547const ThinkingStepsPart: FC = () => {
548 const thinkingStepsMap = useContext(ThinkingStepsContext);
549
550 // Get the current message ID to look up thinking steps
551 const messageId = useAssistantState(({ message }) => message?.id);
552 const thinkingSteps = thinkingStepsMap.get(messageId) || [];
553
554 // Check if this specific message is currently streaming
555 // A message is streaming if: thread is running AND this is the last assistant message
556 const isThreadRunning = useAssistantState(({ thread }) => thread.isRunning);
557 const isLastMessage = useAssistantState(({ message }) => message?.isLast ?? false);
558 const isMessageStreaming = isThreadRunning && isLastMessage;
559
560 if (thinkingSteps.length === 0) return null;
561
562 return (
563 <div className="mb-3">
564 <ThinkingStepsDisplay steps={thinkingSteps} isThreadRunning={isMessageStreaming} />
565 </div>
566 );
567};
568
569const AssistantMessageInner: FC = () => {
570 return (

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected