14 Commits

Author SHA1 Message Date
Rankin Zheng
271f4eb55d Fix conditional rendering of Indicator in InputMessage component
- Corrected the placement of the closing brace for the conditional rendering of the Indicator component in the InputMessage component.
2023-08-25 11:35:20 +08:00
Rankin Zheng
824e9ae120 Enhance UI and UX of InputMessage and ChatPanel components
- Refactored InputContexts component to use Drawer for better UX.
- Added an Indicator to show the number of contexts in the InputMessage component.
- Added an ActionIcon to open the Drawer containing the contexts.
- Removed unused imports from InputMessage and ChatPanel components.
- Adjusted the zIndex of the 'scroll to bottom' ActionIcon in ChatPanel.
- Simplified the Accordion.Panel in InputContexts by removing unnecessary ScrollArea.
- Adjusted the styling of the pre tag in InputContexts for better readability.
2023-08-25 11:26:24 +08:00
Rankin Zheng
28f1e186bd Clear input field and scroll to bottom after sending message
- Imported 'useTimeout' hook from '@mantine/hooks' in InputMessage/index.tsx.
- Added a setTimeout function in the handleSendMessage function in InputMessage/index.tsx to scroll to the bottom after clearing the input field.
2023-08-24 11:21:05 +08:00
Rankin Zheng
7830a6d421 Refactor code to improve readability and functionality
- 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.
2023-08-23 21:30:23 +08:00
Rankin Zheng
8b43283566 Add 'help' command to DevChat
- Added a new 'help' command to the command menu in InputStore.ts.
- Modified the behavior of the 'Enter' and 'Tab' keys in InputMessage/index.tsx to display a help message when the 'help' command is selected.
- Refactored ChatStore.ts to include a new 'helpMessage' function that displays a help message.
- Removed redundant code in ChatStore.ts and reorganized the remaining code for better readability.
2023-08-23 19:53:55 +08:00
Rankin Zheng
63694c7306 Add 'path' property to ChatContext model and update components
- Added 'path' property to ChatContext model in InputStore.ts.
- Updated InputMessage and MessageContainer components to use 'path' instead of 'file' for display.
- Updated ChatStore to include 'path' in the context object.
2023-08-18 16:28:43 +08:00
Rankin Zheng
14bb7ba17b Refactor InputMessage component and ChatStore
- Imported the Message model from ChatStore in InputMessage/index.tsx.
- Updated the handleSendClick function to create a new Message object before calling the newMessage action.
- Updated the startGenerating action in ChatStore.ts to accept an array of chat contexts.
- Updated the map function in the loadHistory action to directly use the context field of each item.
2023-08-18 13:00:54 +08:00
Rankin Zheng
6290436bb7 Refactor InputMessage component and InputStore
- Imported the ChatContext model from InputStore in InputMessage/index.tsx.
- Updated the handleSendClick function to create a new ChatContext object before calling the newContext action.
- Updated the newContext action in InputStore.ts to accept an IChatContext object.
2023-08-18 12:21:19 +08:00
Rankin Zheng
1fe45ef5e0 Refactor InputMessage component and ChatStore
- Simplified the handleSendClick function in InputMessage/index.tsx to directly use input.value.
- Made 'contexts' an optional field in the Message model in ChatStore.ts.
- Updated the newMessage and updateLastMessage actions in ChatStore.ts to accept an IMessage object.
2023-08-18 11:48:19 +08:00
Rankin Zheng
b99ab0262a Refactor InputContexts component and related files
- Imported ChatContext from InputStore in InputContexts.tsx.
- Refactored the map function in InputContexts to destructure the context object.
- Updated the display text in the Accordion.Control component to use destructured values.
- Replaced 'context.content' with 'content' in the Accordion.Panel component.
- In InputMessage/index.tsx, updated the newContext method call to use 'context.content'.
- Added 'command' as an optional string to the ChatContext model in InputStore.ts.
2023-08-18 08:47:09 +08:00
Rankin Zheng
5bbe9963b8 Refactor InputMessage and InputContexts components to use MobX
- Replaced Redux hooks with MobX hooks in InputMessage and InputContexts components.
- Removed Redux actions and replaced them with equivalent MobX actions.
- Updated event handlers and useEffect hooks to use MobX actions instead of Redux actions.
- Replaced Redux selectors with equivalent MobX observables.
2023-08-18 00:23:18 +08:00
Rankin Zheng
0bcc339447 Move Icons and avatar images to appropriate folders
- Moved Icons.tsx from views to components/ChatIcons folder.
- Updated import path for Icons in InputMessage/index.tsx.
- Moved avatar_devchat.svg, avatar_spaceman.png, and avatar_user.svg from views to components/MessageHeader folder.
- Updated import paths for avatar images in MessageHeader/index.tsx.
2023-08-03 17:01:12 +08:00
Rankin Zheng
cec95185b3 Move chatSlice and inputSlice to reducers folder
- Moved chatSlice and inputSlice from views to reducers folder.
- Updated import paths for chatSlice and inputSlice in various files.
- Adjusted import paths for chatSlice and inputSlice in store.ts.
2023-08-03 16:49:30 +08:00
Rankin Zheng
b900fe0b8b Move InputMessage and related files to components folder
- Moved InputMessage and InputContexts from views to components folder.
- Updated import paths for InputMessage in ChatPanel.tsx.
- Adjusted import paths for inputSlice and chatSlice in InputMessage and InputContexts.
- Improved code formatting in InputMessage.tsx.
2023-08-03 16:47:26 +08:00