- Replace generating and responsed props with useSelector.
- Import selectGenerating and selectResponsed from chatSlice.
- Update MessageBlink component to use Redux selectors.
- Create chatSlice with generating, responsed, currentMessage, and errorMessage states.
- Refactor ChatPanel to use Redux selectors and actions from chatSlice.
- Update store.ts to include chatReducer.
- 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.
- Replace '==' with '===' in contextManager.ts and sendMessageBase.ts.
- Add try-catch block in devchat.ts to handle JSON parsing errors.
- Remove unused import in topicManager.ts.
- Use .flat() method for iterating logEntries in topicManager.ts.
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.
In this commit, we updated the ChatPanel component to clear the error message when generating a new response. This change ensures that any previous error messages are removed from the UI, providing a clean slate for the new response. The setHasError('') function call was added to the onClick event handler of the RegenerationButton component.
In this commit, we updated the ChatPanel's MessageContainer component to preserve whitespace in the message content. This change improves the display of code snippets and other content that relies on whitespace formatting. The content is now wrapped in a <pre> tag with the overflowWrap style set to 'normal'.
In this commit, we moved the RegenerationButton and StopButton components outside the chatPanel component and passed the onClick event handlers as props. This change improves the readability and maintainability of the code by separating the components and their logic.
In this commit, we updated the ChatPanel component to display error messages using the Alert component from the Mantine library. This change improves the user experience by providing a clear and consistent way to display error messages in the chat interface. The error message is now stored as a string in the hasError state, and the Alert component is conditionally rendered based on the presence of an error message.
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.
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.
In this commit, we replaced the react-syntax-highlighter package with the Prism component from the same package. This change improves the syntax highlighting performance and provides better support for various programming languages. The okaidia theme is also imported for a consistent look and feel.
In this commit, we removed the unnecessary registed state from the ChatPanel component and improved the message handling by moving the messageUtil.registerHandler calls to the useEffect hook. This change simplifies the code and ensures that the handlers are registered only once during the component's lifecycle.
Created a new MessageContainer.tsx file and moved the MessageContainer component from ChatPanel/index.tsx to the new file.
Imported the MessageContainer component in ChatPanel/index.tsx and removed the previous inline implementation.
MessageContainer component handles the display and management of messages in the chat panel, including message avatars, message contexts, and message blinking.
Created a new CodeBlock.tsx file and moved the CodeBlock component from ChatPanel/index.tsx to the new file.
Imported the CodeBlock component in ChatPanel/index.tsx and removed the previous inline implementation.
CodeBlock component handles the display and management of code blocks in the chat panel, including language corner, code buttons, and syntax highlighting.
Extracted the InputMessage component from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new InputMessage component.
InputMessage component handles the display and management of the input message area, including the command menu and context menu.
Extracted the InputContexts component from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new InputContexts component.
InputContexts component handles the display and management of input contexts in the chat panel.
Extracted the RegenerationButton and StopButton components from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new RegenerationButton and StopButton components.
RegenerationButton and StopButton components handle the regeneration and stopping of message generation, respectively.
Extracted the MessageContainer component from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new MessageContainer component.
MessageContainer component includes MessageAvatar, MessageContext, and MessageBlink subcomponents.
Extracted the CodeButtons component from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new CodeButtons component.
CodeButtons component includes CommitButton, DiffButton, CodeApplyButton, FileApplyButton, and CodeCopyButton.
Extracted the LanguageCorner component from the CodeBlock function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new LanguageCorner component.
Extracted the CodeBlock component from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new CodeBlock component.
- Added WaitCreateTopic flag to prevent UI updates during topic creation.
- Updated DevChatViewProvider to check for WaitCreateTopic flag.
- Added onSelectChanged method in TopicTreeDataProvider.
- Enabled setCurrentTopic in TopicManager.
- Added args property to Command interface in commandManager.ts and customCommand.ts.
- Updated regCommandList handler to convert command patterns with args.
- Replaced {{prompt}} with an array of empty strings based on the args count.