373 Commits

Author SHA1 Message Date
Rankin Zheng
2d6692ff39 Update: Replace react-syntax-highlighter with Prism in CodeBlock component
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.
2023-06-05 20:44:50 +08:00
Rankin Zheng
70d1668e6c Refactor: Remove unnecessary state and improve message handling in ChatPanel
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.
2023-06-05 20:41:37 +08:00
Rankin Zheng
77898b8294 Refactor: Extract MessageContainer component from ChatPanel
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.
2023-06-05 19:27:25 +08:00
Rankin Zheng
2ad72ed857 Refactor: Extract CodeBlock component from ChatPanel
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.
2023-06-05 19:24:08 +08:00
Rankin Zheng
e6f2e926db Refactor: Extract InputMessage component in ChatPanel 2023-06-05 19:21:10 +08:00
Rankin Zheng
43853de82a Refactor: Extract InputMessage component in ChatPanel 2023-06-05 19:12:58 +08:00
Rankin Zheng
cee7c0eac6 Refactor: Extract InputMessage component in ChatPanel
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.
2023-06-05 18:42:45 +08:00
Rankin Zheng
ba32f21082 Refactor: Extract InputContexts component in ChatPanel
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.
2023-06-05 18:40:07 +08:00
Rankin Zheng
d500fe63f1 Refactor: Extract RegenerationButton and StopButton components in ChatPanel
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.
2023-06-05 18:35:21 +08:00
Rankin Zheng
a835755439 Refactor: Extract MessageContainer component in ChatPanel
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.
2023-06-05 18:20:08 +08:00
Rankin Zheng
b170623bce Refactor: Extract CodeButtons component in ChatPanel
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.
2023-06-05 17:25:47 +08:00
Rankin Zheng
3bda063a2e Refactor: Extract LanguageCorner component in CodeBlock
Extracted the LanguageCorner component from the CodeBlock function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new LanguageCorner component.
2023-06-05 17:15:28 +08:00
Rankin Zheng
32af336585 Refactor: Extract CodeBlock component in ChatPanel
Extracted the CodeBlock component from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new CodeBlock component.
2023-06-05 17:09:40 +08:00
boob.yang
f7bc5d08fc
Merge pull request #153 from covespace/log_history_load_error
Add logger to TopicManager for better error handling
2023-06-05 14:07:42 +08:00
bobo.yang
34066c5597 Add logger to TopicManager for better error handling
- Imported logger from '../util/logger' in topicManager.ts.
- Added logger.channel()?.info() for "Topic not found" cases.
2023-06-05 14:05:55 +08:00
boob.yang
f82512f63c
Merge pull request #151 from covespace/fix_topic_error
Fix topic error
2023-06-05 12:37:15 +08:00
bobo.yang
06afafb937 Fix message header assignment condition
- Changed condition in parseMessageAndSetOptions function.
- Now correctly assigns chatOptions.header based on message.text.
2023-06-05 11:37:14 +08:00
bobo.yang
9546cfb7ba Add wait flag for topic creation and update UI
- 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.
2023-06-05 11:36:45 +08:00
bobo.yang
3c63fb4c61 Fix history message repeat 2023-06-05 11:25:04 +08:00
bobo.yang
2aca2d3db5 don't append partial response before error 2023-06-05 09:17:58 +08:00
boob.yang
ac8992f4f6
Merge pull request #146 from covespace/optimize_command_show
fix log miss in history messages
2023-06-02 14:08:55 +08:00
bobo.yang
f91abd1002 fix log miss in history messages 2023-06-02 14:07:20 +08:00
boob.yang
f5576c9c28
Merge pull request #145 from covespace/optimize_command_show
Add args property to Command interface and update regCommandList
2023-06-02 13:46:36 +08:00
bobo.yang
1c6e002373 Add args property to Command interface and update regCommandList
- 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.
2023-06-02 13:45:12 +08:00
boob.yang
17b1d547fd
Merge pull request #143 from covespace/add_filter_tree_context
add tree context
2023-06-02 13:13:13 +08:00
bobo.yang
6d57aaeb1f add tree context 2023-06-02 13:12:23 +08:00
boob.yang
5c4e13d6ac
Merge pull request #141 from covespace/devchat_extension
Devchat extension
2023-06-02 12:55:41 +08:00
bobo.yang
f7b26755db Update chatConfig.ts to prevent overwriting existing files
- Modified copyFileSync() to check if the target file exists before writing.
- Commented out the return statement in createChatDirectoryAndCopyInstructionsSync() to allow copying workflows.
2023-06-02 12:34:57 +08:00
boob.yang
8678183865
Merge pull request #139 from covespace/history_in_page
Refactor historyMessages and historyMessagesBase
2023-06-02 11:16:20 +08:00
bobo.yang
cd6c091d68 Refactor historyMessages and historyMessagesBase
- Updated historyMessages to handle pagination with skip and maxCount.
- Exported LoadHistoryMessages interface from historyMessagesBase.
- Added setTopic and getTopic methods to messageHistory class.
- Implemented loadTopicHistoryFromCurrentMessageHistory function.
2023-06-02 11:15:04 +08:00
bobo.yang
3c5e44273a Implement ActionManager and CustomActions classes
- Added ActionManager class to manage and apply actions.
- Implemented CustomActions class to parse and handle custom actions.
- Created applyAction and regActionList handlers for action execution and registration.
2023-06-02 09:58:44 +08:00
bobo.yang
a66127ffc9 Add CustomContexts class and related test cases
- Implemented CustomContexts class to handle custom contexts.
- Added methods to parse, get, and handle custom context commands.
- Created test cases for CustomContexts class in customContext.test.ts.
2023-06-02 09:58:44 +08:00
bobo.yang
cbd3b8fc77 Update unspecified changes
- This commit message is a placeholder for unspecified changes.
- Please provide more context or specific changes to create a more accurate commit message.
2023-06-02 09:58:44 +08:00
bobo.yang
7e7f7e6a91 Add methods for active file path, selected range, and selected text
- Added activeFilePath() method to get the current active file path.
- Added selectRange() method to get the current selected range as an offset from the file start.
- Added selectText() method to get the current selected text.
2023-06-02 09:58:44 +08:00
bobo.yang
b2ba9e148d Support env var and prompt input for command 2023-06-02 09:58:44 +08:00
boob.yang
e06e35f8f9
Merge pull request #134 from covespace/fix_unit_test
fix test cases
2023-05-31 17:01:33 +08:00
bobo.yang
a349d8dd29 fix test cases 2023-05-31 16:57:39 +08:00
boob.yang
9a4840c514
Merge pull request #133 from covespace/refactor_code2
Refactor code2
2023-05-31 16:32:49 +08:00
bobo.yang
c46d29bf20 Improve history message handling and topic view
- Add check for current topic change during history load.
- Return undefined if no log entries found.
- Add check/uncheck icons for topic view items.
- Update TopicTreeDataProvider to handle item selection.
2023-05-31 16:10:53 +08:00
bobo.yang
23409abd0c Update title and placeholder for API key input
- Change title from "DEVCHAT_API_KEY" to "Input Access Key".
- Add placeholder text "Set OPENAI_API_KEY (or DevChat Access Key)".
2023-05-31 16:10:53 +08:00
bobo.yang
3136748f72 Update ESLint rules and error handling
- Remove "no-unused-vars" and "no-unused-expressions" from .eslintrc.json.
- Simplify error handling in devchat.ts by returning stderr directly.
- Remove "noUnusedLocals" and "noUnusedParameters" from tsconfig.json.
2023-05-31 16:10:53 +08:00
bobo.yang
ba097eab26 add unit tests for src 2023-05-31 16:10:53 +08:00
bobo.yang
7a72ebcabe append error to response text 2023-05-31 16:10:53 +08:00
bobo.yang
82faf14eb6 Separate VSCode from core logic for ISSUE #125
- Extract VSCode-related code from core logic.
- Improve modularity for easier unit testing.
2023-05-31 16:10:53 +08:00
bobo.yang
562a125902 handle vscode 2023-05-31 16:10:53 +08:00
bobo.yang
cad2bbb69d refactor code 2023-05-31 16:10:53 +08:00
Jinglei Ren
b658fcbc17
Update README.md 2023-05-31 13:15:28 +08:00
Jinglei Ren
623b5b2e2b
Update README.md 2023-05-31 13:14:02 +08:00
boob.yang
2adb1b4e6a
Merge pull request #124 from covespace/keep_response_while_error
Improve handling of partial chat responses and topic creation
2023-05-29 08:53:12 +08:00
bobo.yang
c2feaccc58 Improve handling of partial chat responses and topic creation
- Store partial chat response data in a separate variable.
- Concatenate partial data with responseText when chatResponse.isError is true.
- Comment out setCurrentTopic call in topicManager.ts.
2023-05-29 08:51:53 +08:00