521 Commits

Author SHA1 Message Date
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
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
bobo.yang
de03c654f5 Update package.json version and description
- Bumped up the version from 0.1.8 to 0.1.17.
- Modified the description for Python interpreter usage in DevChat.
2023-07-06 07:42:44 +08:00
bobo.yang
7149ca0190 Modify DevChat installation command in install.py
- Changed the DevChat installation command to include the '--force' flag to ensure the installation proceeds even if DevChat is already installed.
2023-07-06 07:42:44 +08:00
bobo.yang
e53b0576b3 Refactor command location and DevChat installation
- Updated the locateCommand function to split the output of the 'where' and 'which' commands and return the first line.
- Modified the DevChat installation command to include the path in quotes to handle paths with spaces.
2023-07-06 07:42:44 +08:00
bobo.yang
e6f184cfe6 update devchat check logic 2023-07-06 07:42:44 +08:00
bobo.yang
5de9d0f7ee update install for devchat 2023-07-06 07:42:44 +08:00
bobo.yang
8bc7f63c09 Add API key validation and pip installation check
- Added a check in commands.ts to validate the API key when setting it.
- If the API key is invalid, an error message is displayed to the user.
- Added a function in install.py to ensure pip is installed.
- This function attempts to install and upgrade pip using the ensurepip module.
- The function is called at the beginning of the main function in install.py.
2023-07-06 07:42:44 +08:00
bobo.yang
5bad06e967 Handle exceptions in dependencyCheck function
- Wrapped the version comparison logic in a try-catch block to handle potential exceptions.
- If an exception occurs, the isVersionChangeCompare flag is set to false.
- The version comparison is now only performed if the DevChat dependency check passes and the DevChat instance is not already initialized.
2023-07-06 07:42:44 +08:00
bobo.yang
d474957fe8 Add Python Path configuration and command to package.json
- Added a new configuration 'DevChat.PythonPath' in package.json.
- This configuration allows users to specify the location of the Python binary.
- Also added a new command 'DevChat.PythonPath' to the command palette.
- Updated commandsBase.ts to use the Python Path from the configuration.
- If the Python Path is not set in the configuration, it will use the default Python command.
- If the DevChat status is 'Missing required dependency: Python3', the status bar item will trigger the 'devchat.PythonPath' command.
2023-07-06 07:42:44 +08:00
bobo.yang
892c3638cc Add command to set Python Path in DevChat configuration
- Added a new command 'devchat.PythonPath' in commands.ts.
- This command prompts the user to input a Python Path and updates the DevChat configuration with the provided path.
- The new command is registered in the extension.ts file.
2023-07-06 07:42:44 +08:00
bobo.yang
f63f88e7f6 Add updateConfiguration method to UiUtil
- Added a new method updateConfiguration to the UiUtil interface.
- Implemented the updateConfiguration method in the UiUtilWrapper and UiUtilVscode classes.
- This method updates a given configuration key with a new value.
2023-07-06 07:42:44 +08:00
bobo.yang
a947651d85 Update install.py to use sys.executable for pipx commands
- Replaced direct 'pipx' calls with 'sys.executable -m pipx' to ensure the same Python environment is used.
- Added a print statement to display the Python command being used.
2023-07-06 07:42:44 +08:00
Rankin Zheng
7ee2b02dda
Merge pull request #201 from devchat-ai/194-split-rendering-of-markdown-in-message-body
194 split rendering of markdown in message body
2023-07-06 07:40:01 +08:00
Rankin Zheng
b573dff2cf Enhance message copying and refilling in MessageContainer
- Imported CopyButton and Icon360 from respective libraries for improved functionality.
- Replaced the refill prompt icon with a 360 icon for better user understanding.
- Added a copy message functionality for bot messages with a tooltip indicating the copy status.
- Changed the state variable name from 'refilled' to 'done' for better context understanding.
2023-07-06 06:22:04 +08:00
Rankin Zheng
f58e2fe333 Improve text formatting in CodeBlock component
- Imported Container from "@mantine/core" for better layout control in CodeBlock.
- Wrapped the preformatted text in a Container to apply additional styles.
- Added 'whiteSpace: 'pre-wrap'' and 'wordBreak: 'break-word'' to preserve white spaces, line breaks and ensure long words do not overflow the container.
2023-07-06 06:12:55 +08:00
Rankin Zheng
2d12c8978d Enhance CurrentMessage component with dynamic width and improved styling
- Passed dynamic width from ChatPanel to CurrentMessage component.
- Imported Container from "@mantine/core" for better layout control in CurrentMessage.
- Added styling to the CurrentMessage component to handle dynamic width and improve text display.
- Added 'whiteSpace: 'break-spaces'' to preserve white spaces and line breaks in the preformatted text.
2023-07-06 05:56:36 +08:00
Rankin Zheng
8773633d44 Update chat message handling and state management
- Modified the stopGenerating action to accept a payload indicating if the task has been completed.
- Added a new state property 'hasDone' to track if a task has been completed.
- Updated the CurrentMessage component to handle the new 'hasDone' state and update the last message accordingly.
- Introduced a new action 'updateLastMessage' to update the last message in the state.
- Added a new state property 'lastMessage' to keep track of the last message.
- Refactored the CurrentMessage component to split the message into blocks for better rendering.
2023-07-06 05:51:03 +08:00
Rankin Zheng
cb3a2cbc29 Refactor chat message handling and UI components
- Extracted current message handling logic into a new component, CurrentMessage.tsx.
- Removed redundant code and imports from ChatPanel.tsx.
- Removed MessageBlink component from MessageContainer.tsx as it's now part of CurrentMessage.tsx.
- Added import for CurrentMessage in ChatPanel.tsx.
- Removed unused selectors from ChatPanel.tsx.
- Simplified useEffect hooks in ChatPanel.tsx by moving some logic to CurrentMessage.tsx.
2023-07-05 15:00:20 +08:00
Rankin Zheng
7308f17be7
Merge pull request #199 from devchat-ai/193-change-replace-to-replace-file-in-the-code-box
Update tooltip label in CodeBlock component
2023-07-03 15:40:40 +08:00
Rankin Zheng
9f222f7d1a Update tooltip label in CodeBlock component
- Changed the tooltip label from 'Replace' to 'Replace File' in CodeBlock.tsx.
- This provides a clearer indication of the button's functionality.
2023-07-03 15:40:13 +08:00
Jinglei Ren
b54c425f7b
Update README.md 2023-07-01 11:02:32 +08:00
Rankin Zheng
257021cba7
Merge pull request #198 from devchat-ai/195-formatting-restoration-for-input-box-text
Differentiate code block rendering based on message type
2023-06-28 17:10:45 +08:00
Rankin Zheng
767afa4278 Differentiate code block rendering based on message type
- Added messageType prop to CodeBlock component in CodeBlock.tsx.
- CodeBlock now renders differently for 'bot' and other message types.
- Updated MessageContainer.tsx to pass messageType to CodeBlock.
2023-06-28 17:09:27 +08:00
Rankin Zheng
56be79ff6e
Merge pull request #197 from devchat-ai/196-pressing-enter-in-input-box-with-chinese-input-method-does-not-trigger-send-event
Prevent sending message on Enter key press during IME composition
2023-06-28 16:44:15 +08:00
Rankin Zheng
0f58038998 Prevent sending message on Enter key press during IME composition
- Modified the condition in InputMessage.tsx to check if the IME composition is in progress.
- This prevents the message from being sent when the Enter key is pressed during IME composition.
2023-06-28 16:42:23 +08:00
boob.yang
1722286323
Merge pull request #190 from devchat-ai/update_devchat_check2
Update devchat check2
2023-06-16 09:16:42 +08:00
bobo.yang
35215a7fb6 Prevent duplicate binPath in PATH environment variable
- Check if binPath is already in PATH before adding it.
- Add binPath to PATH only if it's not already present.
- Log a message when binPath is added to PATH.
2023-06-16 09:08:51 +08:00
bobo.yang
1bb215f51b Improve error handling in DevChat dependency check
- Add a catch block to handle errors when checking pipx environment path.
- Log detailed error message when DevChat dependency check fails.
- Move DevChat installation check to a separate try-catch block.
- Update logger error message to info when pipx environment path is not found.
2023-06-16 09:05:10 +08:00
boob.yang
f07296ea60
Merge pull request #189 from devchat-ai/update_devchat_check2
Improve DevChat dependency check and logging
2023-06-15 21:38:47 +08:00
bobo.yang
9820571783 Improve DevChat dependency check and logging
- Remove redundant DevChat installation check.
- Change logger error message to info when pipx environment path is not found.
- Move DevChat installation check outside of the if-else block.
- Return true after running 'devchat --help' command.
2023-06-15 21:20:52 +08:00
boob.yang
d5fdd4e901
Merge pull request #188 from devchat-ai/fix_historylog_mismatch
Refactor historyMessagesBase to accept topicId as parameter
2023-06-15 21:11:47 +08:00
bobo.yang
1feb9ddd9a Refactor historyMessagesBase to accept topicId as parameter
- Modify loadTopicHistoryLogs to accept topicId as a parameter.
- Update updateCurrentMessageHistory to accept topicId as a parameter.
- Pass topicId to loadTopicHistoryLogs and updateCurrentMessageHistory in historyMessagesBase.
- Add a check for topicId change before updating message history.
2023-06-15 21:00:01 +08:00
Rankin Zheng
f409365833
Merge pull request #187 from devchat-ai/180-adding-tab-completion-functionality-to-pop-up-menu-for-contexts-and-commands
Allow Tab key to select command in InputMessage
2023-06-15 20:56:45 +08:00