8 Commits

Author SHA1 Message Date
Rankin Zheng
8258d7e01a Implement delete message functionality
- Added a new `deleteMessage` function in `chatSlice.ts` to handle message deletion.
- Modified `MessageContainer.tsx` and `MessageHeader.tsx` to pass the entire message item instead of individual properties.
- Updated the `showDelete` prop in `MessageContainer.tsx` to only show the delete icon for the second last message.
- Dispatch the `deleteMessage` action when the delete icon is clicked in `MessageHeader.tsx`.
- Updated the message structure in `chatSlice.ts` to include `date` and `hash` properties.
- Added a case for `deleteMessage.fulfilled` in `chatSlice.ts` to remove the deleted message from the state.
2023-07-17 21:07:42 +08:00
Rankin Zheng
ac1d9705ec Refactor MessageHeader into a separate component
- Extracted MessageHeader from MessageContainer.tsx into its own file MessageHeader.tsx.
- Removed unused imports from MessageContainer.tsx.
- Added necessary imports to MessageHeader.tsx.
- Updated MessageContainer.tsx to import MessageHeader from the new file.
2023-07-17 20:31:01 +08:00
Rankin Zheng
b573dff2cf Enhance message copying and refilling in MessageContainer
- Imported CopyButton and Icon360 from respective libraries for improved functionality.
- Replaced the refill prompt icon with a 360 icon for better user understanding.
- Added a copy message functionality for bot messages with a tooltip indicating the copy status.
- Changed the state variable name from 'refilled' to 'done' for better context understanding.
2023-07-06 06:22:04 +08:00
Rankin Zheng
cb3a2cbc29 Refactor chat message handling and UI components
- Extracted current message handling logic into a new component, CurrentMessage.tsx.
- Removed redundant code and imports from ChatPanel.tsx.
- Removed MessageBlink component from MessageContainer.tsx as it's now part of CurrentMessage.tsx.
- Added import for CurrentMessage in ChatPanel.tsx.
- Removed unused selectors from ChatPanel.tsx.
- Simplified useEffect hooks in ChatPanel.tsx by moving some logic to CurrentMessage.tsx.
2023-07-05 15:00:20 +08:00
Rankin Zheng
767afa4278 Differentiate code block rendering based on message type
- Added messageType prop to CodeBlock component in CodeBlock.tsx.
- CodeBlock now renders differently for 'bot' and other message types.
- Updated MessageContainer.tsx to pass messageType to CodeBlock.
2023-06-28 17:09:27 +08:00
Rankin Zheng
799c87abcf Remove default message and simplify MessageContainer
- Remove DefaultMessage component and its usage.
- Simplify MessageContainer by directly mapping messages to components.
- Adjust styling and layout for better readability.
2023-06-15 20:43:52 +08:00
Rankin Zheng
bcdc78d65f Update import paths with alias
- Replace relative import paths with '@/...' alias in multiple files.
- Update tsconfig.json to include paths configuration.
- Add alias configuration to webpack.config.js.
2023-06-13 17:03:48 +08:00
Rankin Zheng
7f25e426b2 Refactor directory structure 2023-06-13 09:20:12 +08:00