diff --git a/src/views/components/CurrentMessage/index.tsx b/src/views/components/CurrentMessage/index.tsx index 3727846..c5a1abb 100644 --- a/src/views/components/CurrentMessage/index.tsx +++ b/src/views/components/CurrentMessage/index.tsx @@ -84,7 +84,7 @@ const CurrentMessage = observer((props: any) => { whiteSpace: 'break-spaces' }, }}> - + {renderBlocks.length>0?toMarkdown(renderBlocks[0]):''} diff --git a/src/views/components/InputMessage/index.tsx b/src/views/components/InputMessage/index.tsx index 1958040..9872cbc 100644 --- a/src/views/components/InputMessage/index.tsx +++ b/src/views/components/InputMessage/index.tsx @@ -456,7 +456,7 @@ const InputMessage = observer((props: any) => { {modelMenus.map((modelName) => { return ( - changeModel(modelName)}> + changeModel(modelName)}> {getModelShowName(modelName)} ); diff --git a/src/views/components/MessageBody/index.tsx b/src/views/components/MessageBody/index.tsx index e2df021..9b449a9 100644 --- a/src/views/components/MessageBody/index.tsx +++ b/src/views/components/MessageBody/index.tsx @@ -8,7 +8,7 @@ interface IProps { messageType: string, children: string, messageDone?: boolean, - temp?: boolean + activeStep?: boolean } @@ -24,14 +24,14 @@ const useStyles = createStyles((theme, options:any) => ({ })); const MessageBody = observer((props: IProps) => { - const { children, messageType, temp=false ,messageDone} = props; + const { children, messageType, activeStep=false ,messageDone} = props; const { chat } = useMst(); const {classes} = useStyles({ chatPanelWidth:chat.chatPanelWidth }); return ( messageType === 'bot' - ? + ? {children} : { const { chat } = useMst(); - const {language,children,done,index} = props; + const {language,children,status,index} = props; const [opened, { toggle }] = useDisclosure(false); // extract first line with # as button label @@ -85,7 +85,7 @@ const Step = observer((props:StepProps) => { > : } diff --git a/src/views/components/MessageMarkdown/index.tsx b/src/views/components/MessageMarkdown/index.tsx index 4bfcdf7..7aa7f34 100644 --- a/src/views/components/MessageMarkdown/index.tsx +++ b/src/views/components/MessageMarkdown/index.tsx @@ -33,7 +33,7 @@ interface MessageMarkdownProps extends React.ComponentProps { - const { children,temp=false,messageDone } = props; + const { children,activeStep=false,messageDone } = props; const { chat } = useMst(); const [steps, setSteps] = useState([]); const tree = fromMarkdown(children); @@ -177,7 +177,7 @@ Generate a professionally written and formatted release note in markdown with th return (tree) =>{ - let stepCount = 1; + let stepCount = 0; let chatmarkCount = 0; let previousNode:any = null; visit(tree, function (node) { @@ -227,8 +227,8 @@ Generate a professionally written and formatted release note in markdown with th } if (lanugage === 'step' || lanugage === 'Step') { - let done = Number(index) < codes.length? true : lastNode.type !== 'code'; - return {value}; + const status = activeStep && Number(index) === codes.length - 1 && lastNode.type === 'code' ? "running" : "done"; + return {value}; } if (lanugage === 'chatmark' || lanugage === 'ChatMark') { diff --git a/src/views/stores/ChatStore.ts b/src/views/stores/ChatStore.ts index abd0960..4370b72 100644 --- a/src/views/stores/ChatStore.ts +++ b/src/views/stores/ChatStore.ts @@ -322,6 +322,7 @@ Thinking... self.generating = false; self.responsed = false; self.hasDone = hasDone; + self.currentMessage = message; const messagesLength = self.messages.length; if (hasDone) { if (messagesLength > 1) {