8 Commits

Author SHA1 Message Date
Rankin Zheng
7ebf8014be Refactor InputMessage and MessageContainer to use Redux
- Replace contextsHandlers with Redux actions in InputMessage.tsx.
- Update InputContexts to use useSelector and useDispatch.
- Remove onRefillClick prop and use Redux actions in MessageContainer.tsx.
- Update inputSlice with new actions for context management.
2023-06-08 20:40:05 +08:00
Rankin Zheng
3fc3c21abb Update InputMessage and chatSlice for message handling
- Import selectGenerating, newMessage, and startGenerating in InputMessage.tsx.
- Remove onSendClick prop and use Redux actions instead.
- Add messageUtil calls to chatSlice for sendMessage, regeneration, and stopDevChat.
2023-06-08 20:11:00 +08:00
Rankin Zheng
51a2e66053 Update dependencies and integrate Redux
- Update react-redux to ^8.0.7.
- Add remote-redux-devtools ^0.5.16 and @reduxjs/toolkit ^1.9.5.
- Implement Redux store and inputSlice for managing input state.
- Refactor InputMessage and ChatPanel components to use Redux.
2023-06-08 17:32:57 +08:00
Rankin Zheng
58230455df Add refill prompt action icon to user messages 2023-06-06 18:13:26 +08:00
Rankin Zheng
5786bb1086 Refactor: Sort context menu items in InputMessage component
In this commit, we updated the InputMessage component to sort the context menu items alphabetically, with the exception of the <custom command> item, which is placed at the end of the list. This change improves the user experience by providing a more organized and predictable order for the context menu items. The sorting logic was added to the contextMenusNode constant using the sort() and localeCompare() methods.
2023-06-06 11:31:52 +08:00
Rankin Zheng
011ecb0e81 Refactor: Simplify icon rendering in InputMessage component
In this commit, we simplified the icon rendering logic in the InputMessage component by removing the unnecessary condition for the <custom command> name. This change makes the code more concise and easier to understand.
2023-06-05 21:25:12 +08:00
Rankin Zheng
dd90ced309 Refactor: Simplify width prop handling in ChatPanel components
In this commit, we simplified the width prop handling in the ChatPanel components by directly passing the width value instead of the entire chatContainerRect object. This change makes the code more readable and easier to maintain.
2023-06-05 21:13:06 +08:00
Rankin Zheng
e6f2e926db Refactor: Extract InputMessage component in ChatPanel 2023-06-05 19:21:10 +08:00