553 Commits

Author SHA1 Message Date
bobo.yang
2be4e52a0a Add new actions and settings for auto_command workflow
- Add new_file action for creating or replacing files.
- Add run_shell action for running shell scripts.
- Add run_shell_file action for running shell script files.
- Add update_file action for replacing file content.
- Add default command action settings for auto pattern.
2023-07-24 00:11:56 +08:00
bobo.yang
63ea89387b Update test cases to include args property
- Add args property to commandManager.test.ts test cases.
- Add args property to customCommand.test.ts test cases.
- Update sendMessageBase.test.ts to fix expected result.
2023-07-24 00:11:56 +08:00
bobo.yang
1a75347bd1 Refactor variable names and improve condition checks
- Rename WaitCreateTopic to waitCreateTopic for consistency.
- Update condition check to use parsedMessage.instruction.
2023-07-24 00:11:56 +08:00
bobo.yang
bf531a8fd6 Allow outputFile to be undefined in runCommandStringAndWriteOutput
- Change outputFile parameter type to string | undefined.
- Update function to handle cases when outputFile is undefined.
2023-07-24 00:11:56 +08:00
bobo.yang
f19feef302 Load and save custom actions in DevChatViewProvider
- Import CustomActions from '../action/customAction'.
- Load custom actions from the workflows directory.
- Save action instruction file to the .chat directory.
2023-07-24 00:11:56 +08:00
bobo.yang
23883abc20 Update API endpoint in apiKey.test.ts
- Replace old endpoint with the new 'https://api.devchat.ai/v1' endpoint.
2023-07-24 00:11:56 +08:00
bobo.yang
78d1db75f5 Improve applyAction function and add error handling
- Add compressText function to truncate long text.
- Wrap applyAction in try-catch block for error handling.
- Send error message to devchat if codeBlock type is 'command'.
2023-07-24 00:11:56 +08:00
bobo.yang
d99548b3a0 Add unit tests for actions with valid and empty args
- Add a test case for applying an action with valid args.
- Add a test case for applying an action with empty args.
2023-07-24 00:11:56 +08:00
bobo.yang
dc96991fca Refactor symbol reference and definition handling
- Extracted getSelectedSymbol function to improve code readability.
- Fixed the scope of refLocations variable to avoid reference error.
- Added error handling for vscode.executeReferenceProvider command.
- Refactored the way symbol references are retrieved and handled.
- Improved the logic for getting symbol definitions.
2023-07-24 00:11:56 +08:00
bobo.yang
5cf0828a93 Refine context descriptions and add checks for selected text
- Updated descriptions for 'symbol references' and 'symbol definitions' contexts for clarity.
- Added checks to return early if no text has been selected in both contexts.
- Removed unnecessary logging of selected text and files list.
- Added logic to handle cases where symbol kind is a variable.
- Removed redundant logging of reference URI and range.
2023-07-24 00:11:56 +08:00
bobo.yang
77493db13f Add symbol references and definitions contexts
- Created two new contexts for symbol references and definitions.
- Updated the handler in ChatContext interface to return an array of strings.
- Updated the processText method in ChatContextManager to return an array of strings.
- Registered the new contexts in loadContexts.ts.
- Updated the addContext function to handle multiple context strings.
2023-07-24 00:11:56 +08:00
boob.yang
8719779b4d
Merge pull request #211 from devchat-ai/fix_delete_message_bug
Update message deletion and topic management
2023-07-21 17:19:47 +08:00
bobo.yang
c1b8ee2f88 Update message deletion and topic management
- Added a check in deleteChatMessageBase to remove the message from the current topic if deletion is successful.
- Modified updateFirstMessageHashAndName in Topic class to accept undefined values.
- Added a new method deleteMessage in TopicManager to update the topic when a message is deleted.
2023-07-21 17:17:43 +08:00
Rankin Zheng
2695f9829a
Merge pull request #210 from devchat-ai/52-i-hope-that-chat-messages-in-devchat-can-be-selectively-deleted
Modify parent_hash assignment in sendMessage command
2023-07-19 17:00:57 +08:00
Rankin Zheng
318540c632 Modify parent_hash assignment in sendMessage command
- Updated the assignment of parent_hash in the sendMessage command to be null when lastNonEmptyHash is 'message'.
2023-07-19 16:52:13 +08:00
Rankin Zheng
03a698e38a
Merge pull request #209 from devchat-ai/52-i-hope-that-chat-messages-in-devchat-can-be-selectively-deleted
52 i hope that chat messages in devchat can be selectively deleted
2023-07-19 16:17:35 +08:00
boob.yang
681a2d16e4
Merge pull request #208 from devchat-ai/update_devchat_by_version
Update DevChat dependency check and configuration update
2023-07-19 16:16:46 +08:00
Rankin Zheng
1a2c31badf Refactor deleteMessage handler and remove debugger statement
- Updated the 'deleteChatMessage' handler to directly access the hash from the message object.
- Removed a debugger statement from the 'deleteMessage.fulfilled' case in chatSlice.
2023-07-19 16:15:26 +08:00
bobo.yang
3136283970 Update DevChat dependency check and configuration update
- Added version check for DevChat in checkDevChatDependency function.
- Updated configuration in both Global and Workspace scopes.
- Commented out the initial DevChat check in install.py and added --force flag to pip install command.
2023-07-19 16:06:45 +08:00
Rankin Zheng
8a5ecbc001 Enhance message handling in chatSlice
- Added condition to check if `action.payload.hasDone` is true, then update the hash of the last two messages in `state.messages`.
- Fixed the `splice` method in `deleteMessage.fulfilled` to correctly remove the message from `state.messages`.
- Updated `stopGenerating` dispatch in `ChatPanel.tsx` to include the message in the payload.
- Modified the delete message action in `MessageHeader.tsx` to handle the case when `item.hash` is not present.
2023-07-19 16:03:39 +08:00
bobo.yang
70be0acd16 Refactor delete method in DevChat class
- Un-commented and updated the delete method logic.
- Added logging for the devchat command execution.
- Added error handling for stderr, failure to delete prompt, and non-zero exit code.
2023-07-18 23:11:28 +08:00
bobo.yang
0ceab66eb6 Fix deleteChatMessage functionality
- Changed the deleteChatMessageBase function call to be awaited.
- Adjusted the condition to send a 'deletedChatMessage' command only when the message is successfully deleted.
2023-07-18 22:54:08 +08:00
Rankin Zheng
38598d1fde Add functionality to find last non-empty hash
- Introduced a loop to iterate over the state.messages array in reverse order.
- The loop finds the last message with a non-empty hash and assigns it to lastNonEmptyHash.
- The parent_hash of the new message is now set to lastNonEmptyHash.
2023-07-18 19:54:57 +08:00
Rankin Zheng
d7105b9c5e Remove debugger 2023-07-18 19:36:25 +08:00
Rankin Zheng
819fe9f302 Refactor InputContexts into a separate component
- Created a new file `InputContexts.tsx` and moved the `InputContexts` component from `InputMessage.tsx` to this new file.
- Imported `InputContexts` in `InputMessage.tsx` and removed the old `InputContexts` component definition.
- This change improves code organization and readability by separating concerns.
2023-07-18 18:10:55 +08:00
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
9a1a985757 Merge branch '52-i-hope-that-chat-messages-in-devchat-can-be-selectively-deleted' of https://github.com/devchat-ai/devchat-vscode into 52-i-hope-that-chat-messages-in-devchat-can-be-selectively-deleted 2023-07-17 20:34:32 +08:00
Rankin Zheng
21fb29f72c Add delete icon to MessageHeader component
- Imported IconTrash from "@tabler/icons-react" in MessageHeader.tsx.
- Added a new prop 'showDelete' to the MessageHeader component with a default value of true.
- Added a new Tooltip for the delete icon with the label "Delete message".
- The delete icon is conditionally rendered based on the 'showDelete' prop.
2023-07-17 20:31:01 +08:00
Rankin Zheng
90d0064e15 Add edit message functionality to MessageHeader
- Imported SimpleGrid and IconEdit from respective libraries in MessageHeader.tsx.
- Added a new prop 'showEdit' to MessageHeader component to conditionally show the edit icon.
- Wrapped the refill prompt and edit message icons in a Flex container for better alignment.
- Added a Tooltip and ActionIcon for the edit message functionality.
2023-07-17 20:31:01 +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
bobo.yang
421b4e6f2e Update sendMessageBase tests after refactoring
- Removed tests for the getParentHash function in sendMessageBase.test.ts.
- This function was removed in a previous commit, so the tests are no longer needed.
2023-07-17 20:31:01 +08:00
bobo.yang
3819d7679c Refactor parent hash handling in sendMessageBase.ts
- Replaced the getParentHash function with direct access to message.parent_hash.
- Updated the handleTopic function to accept undefined parentHash.
- This simplifies the code and makes the parent hash handling more straightforward.
2023-07-17 20:31:01 +08:00
bobo.yang
1957ddd280 Add delete chat message functionality
- Removed 'Cancel' option from topicDeleteCallback in commands.ts.
- Imported deleteChatMessage in loadHandlers.ts and registered it as a handler.
- Added deleteChatMessage function in sendMessage.ts to prompt user for confirmation before deleting a message.
- Added deleteChatMessageBase function in sendMessageBase.ts to delete a message from messageHistory and by devchat.
- Added delete function in devchat.ts to delete a message by hash.
- Added delete function in messageHistory.ts to remove a message from history by hash.
2023-07-17 18:56:56 +08:00
Jinglei Ren
9e056e26d2
Update README.md 2023-07-14 07:46:28 +08:00
boob.yang
e0a3f9d5e2
Merge pull request #207 from devchat-ai/update_install
Update install
2023-07-12 18:10:03 +08:00
bobo.yang
b057d93593 Add log message for successful DevChat installation check
- Added a log message in commandsBase.ts to confirm successful DevChat installation check.
2023-07-12 17:37:00 +08:00
bobo.yang
116defdec7 Refactor install.py and statusBarViewBase.ts
- Added pip_cmd_run and pip_cmd_with_retries functions in install.py to handle pip command execution and retries.
- Simplified the installation of devchat and virtualenv in install.py using the new functions.
- Removed unnecessary checks in statusBarViewBase.ts.
2023-07-12 14:04:08 +08:00
bobo.yang
b4d21be26c update install 2023-07-12 09:02:00 +08:00
Rankin Zheng
647feb085d Add edit message functionality to MessageHeader
- Imported SimpleGrid and IconEdit from respective libraries in MessageHeader.tsx.
- Added a new prop 'showEdit' to MessageHeader component to conditionally show the edit icon.
- Wrapped the refill prompt and edit message icons in a Flex container for better alignment.
- Added a Tooltip and ActionIcon for the edit message functionality.
2023-07-11 18:38:03 +08:00
Rankin Zheng
ebf625d46b 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-11 18:09:16 +08:00
bobo.yang
74913baf23 Update sendMessageBase tests after refactoring
- Removed tests for the getParentHash function in sendMessageBase.test.ts.
- This function was removed in a previous commit, so the tests are no longer needed.
2023-07-10 12:08:36 +08:00
bobo.yang
1ee0cf1b34 Refactor parent hash handling in sendMessageBase.ts
- Replaced the getParentHash function with direct access to message.parent_hash.
- Updated the handleTopic function to accept undefined parentHash.
- This simplifies the code and makes the parent hash handling more straightforward.
2023-07-10 11:49:23 +08:00
Jinglei Ren
e4c9dc9ecd
Update README.md 2023-07-08 16:49:58 +08:00
boob.yang
cd0392f4d2
Merge pull request #204 from devchat-ai/remove_unnecessary_error
Refactor error handling and logging in DevChat dependency check
2023-07-07 09:47:46 +08:00
bobo.yang
15141dd6ff Refactor error handling and logging in DevChat dependency check
- Added a new optional parameter 'showError' in checkDevChatDependency function in commandsBase.ts.
- Updated the conditions for logging error messages in checkDevChatDependency function.
- Updated the call to checkDevChatDependency in dependencyCheck function in statusBarViewBase.ts to pass 'showError' parameter.
- Updated the condition for logging stderr in CommandRun class in commonUtil.ts.
2023-07-07 08:56:28 +08:00
boob.yang
e1d939c7f7
Merge pull request #202 from devchat-ai/set_python
update devchat install
2023-07-06 11:54:57 +08:00
bobo.yang
cfaff1d3d6 Update DevChat installation process and status check
- Increased the runStatus check interval from 20 to 60 in statusBarView.ts.
- Added a new import, CommandRun, in statusBarViewBase.ts.
- Updated the conditions for checking devchatStatus in dependencyCheck function.
- Replaced the terminal run command for DevChat installation with a new CommandRun instance.
- Added error handling for the installation process, updating devchatStatus accordingly.
2023-07-06 11:52:00 +08:00
bobo.yang
46ea8cc436 Fix command execution in checkDevChatDependency function
- Enclosed the pipxDevChat command in quotes to ensure correct execution, especially when the path contains spaces.
2023-07-06 09:06:48 +08:00
bobo.yang
8f846e2d62 Refactor checkDevChatDependency function in commandsBase.ts
- Imported path module for handling file paths.
- Added pipxBinPath variable to store the pipx environment path.
- Changed error logging level from error to warn.
- Updated the way DevChat command is run and its path is updated.
2023-07-06 07:42:44 +08:00
bobo.yang
1019658bf2 Refactor DevChat class in devchat.ts
- Added a semicolon after the object declaration for better code readability.
- Added a line break for better code structure and readability.
2023-07-06 07:42:44 +08:00