- Add conditional rendering for confirm button based on 'confirm' prop value
- Update onClick event handlers for 'Yes' and 'No' buttons to call appropriate functions
- Add a `confirm` property to the `Message` model in the `ChatStore.ts` file.
- Add a `devchatAsk` method to create a user message followed by a bot message with the `confirm` property set to `true`.
MessageMarkdown:
- Removed unused imports.
- Modified useEffect() to analyze steps using mdast-util-from-markdown instead of splitting children directly.
- Modified code component to set the 'index' property based on the order of 'code' nodes in the tree.
MessageBody:
- Removed the messageText prop and replaced it with children prop to allow more flexibility in passing content.
- Updated the usage of MessageMarkdown to pass the temp prop as needed.
CurrentMessage:
- Removed unused import for 'mdast'.
- Modified marginTop value to always be '1em' instead of conditionally set based on chat.responsed.
MessageList:
- Updated the usage of MessageBody to pass the messageText as children prop.
MessageMarkdown:
- Updated the code component to determine the 'done' prop based on the index and the presence of 'code' nodes.
Note: The changes in the components involve refactoring and improving the code structure and functionality.
- Import CurrentMessage component from "@/views/components/CurrentMessage".
- Remove unused chatPanelWidth prop.
- Wrap the returned JSX in a Stack component for spacing and margin.
- Add CurrentMessage component at the end of the Stack.
- Adjust styling and layout of components.
- Remove unused code and dependencies.
- Renamed 'width' prop to 'chatPanelWidth' in InputMessage component for clarity.
- Passed 'chatPanelWidth' prop to MessageList component to set its width.
- Added condition to wrap long lines in 'markdown' or 'text' language blocks in MessageMarkdown component.
- Applied 'breakStyles' to inline code blocks in MessageMarkdown component.
- Passed 'chatPanelWidth' to InputMessage component in ChatPanel page.
- Replaced 'Container' components with 'Box' in MessageList/index.tsx and ChatPanel.tsx for better layout control.
- Removed unnecessary 'width' prop from MessageList component and its usage in ChatPanel.tsx.
- Simplified the structure of MessageList by removing the 'props' parameter and its related code.
- Adjusted the layout of the 'Box' component in MessageList/index.tsx to accommodate the removal of the 'width' prop.
- Removed useEffect hook in MessageList that was adding initial messages.
- Added logic in ChatStore to add initial messages when messages length is 0.
- Refactored CurrentMessage component to destructure properties from chat.
- Added useEffect hooks to handle message generation and updating in CurrentMessage.
- Updated MessageList to use useEffect to add initial messages to chat.
- Expanded MessageAvatar props to include avatarType, copyMessage, messageContexts, and deleteHash.
- Updated MessageAvatar to use new props instead of item prop.
- Updated MessageList to pass new props to MessageAvatar.
- Refactored deleteMessage function in ChatStore to accept messageHash instead of item.
- Updated setContexts function in InputStore to accept IChatContext array.
- Renamed CodeBlock component to MessageBody for better clarity.
- Updated all references of CodeBlock to MessageBody in the codebase.
- Moved CodeBlock related files to MessageBody directory.
- Renamed MessageHeader component to MessageAvatar for better clarity.
- Updated all references of MessageHeader to MessageAvatar in the codebase.
- Moved avatar images from MessageHeader directory to MessageAvatar directory.