957 Commits

Author SHA1 Message Date
bobo.yang
9178710534 Update DevChat version and force reinstall packages
- Updated expected DevChat version to 0.2.3 in checkDevChatDependency function.
- Modified package installation command to force reinstall packages.
2023-08-30 22:48:31 +08:00
bobo.yang
9261a07589 clone commands by run --update-sys 2023-08-30 17:03:22 +08:00
bobo.yang
63fbb1289d Add InstallCommands functionality to DevChat
- Added a new command "InstallCommands" to the package.json file.
- Created a new function "registerInstallCommandsCommand" in commands.ts to handle the execution of the new command.
- The function checks for a directory in the user's home directory, if it exists it performs a git pull, if not it clones a git repository.
- The function is registered in the extension.ts file.
- Added a function "sendCommandListByDevChatRun" in regCommandList.ts to send the command list.
- The new command is executed in the statusBarView.ts file.
- Updated the InputMessage component to register a handler for the 'regCommandList' message.
- Updated the InputStore to handle the new commands and removed the old "regCommandMenus" function.
2023-08-30 16:39:47 +08:00
bobo.yang
c6048d79fb Integrate DevChat commands into CommandManager
- Imported DevChat and created a new method to get commands from DevChat.
- Modified processText method to use the new getCommandListByDevChatRun method.
- Updated loadHandlers and regCommandList to use the new method.
- Added new methods in DevChat to get a list of commands and run a specific command.
2023-08-30 16:39:47 +08:00
Rankin Zheng
a821a174f2 Refactor stopGenerating function in ChatStore
- Changed the parameters of stopGenerating function to accept hash and message as strings.
- Updated the stopGenerating function calls in StopButton and ChatPanel components.
- Added a condition to update the last message when the generation has not completed.
2023-08-30 12:02:23 +08:00
Rankin Zheng
b6be3c0817 Update InputMessage component with new icon and closeButtonProps
- Imported IconChevronDown from "@tabler/icons-react".
- Added closeButtonProps to the Popover component with IconChevronDown as children.
2023-08-30 11:39:13 +08:00
Rankin Zheng
37fdc93b2f Add ScrollArea to InputContexts component
- Wrapped the content of the Accordion.Panel in a ScrollArea component.
- This change allows the content to be scrollable when it exceeds the panel's height.
2023-08-30 11:27:07 +08:00
Rankin Zheng
12979c50e6 Remove commandMenuIcon function and update UI
- Removed the commandMenuIcon function from InputMessage component.
- Updated the UI by removing the commandMenuIcon from the menu items.
- Added padding to the left of the menu items for better alignment.
2023-08-30 11:02:55 +08:00
Jinglei Ren
91d2fd8549 Refine context command descriptions 2023-08-29 23:20:10 +08:00
bobo.yang
6a0b220c1c replace conda with mamba, to handle chinies path. 2023-08-29 15:29:28 +08:00
bobo.yang
427398704b fix #97, update tip text and show output 2023-08-29 15:29:27 +08:00
bobo.yang
89ccc1068f Fix Conda installation and download issues
- Update the command to check Conda version to use 'conda' instead of 'conda2'
- Modify the command to install Conda to properly handle paths and arguments
- Add error handling when deleting the existing Conda installation directory
- Update the downloadFile function to resolve with an empty string if the downloaded file is empty or incomplete
2023-08-29 15:29:27 +08:00
Rankin Zheng
1a70853fb8 Add settings link to DevChat
- Added a case for "#settings" in MessageMarkdown component to handle settings command.
- Included "#settings" in the list of custom anchors.
- Replaced the settings button in ChatStore with a link to settings.
2023-08-28 15:27:00 +08:00
Jinglei Ren
3f26713d45
Refine help text for individual workflows 2023-08-27 11:42:41 +08:00
Jinglei Ren
d534ab199c
Refine help text in chat 2023-08-27 11:24:23 +08:00
bobo.yang
e306489b80 Refactor app_install.ts and package_install.ts
- In app_install.ts, modified the for loop to iterate 4 times instead of 3.
- Added a new parameter 'otherSource' to the installPackage function in package_install.ts.
- If 'otherSource' is provided, it is used as the source for package installation.
- Added logging for the command executed in installPackage function.
2023-08-25 17:27:21 +08:00
Rankin Zheng
19b4616db4 Add ScrollArea to context and command menus in InputMessage component
- Wrapped the contextMenusNode and commandMenusNode with ScrollArea.Autosize for better UX.
- Set the maximum height of the ScrollArea to 240 and scroll type to 'always'.
- This change ensures that the menus are scrollable and do not exceed a certain height.
2023-08-25 13:19:05 +08:00
Rankin Zheng
df436015ae Adjust minimum width and width of chat panel in ChatPanel component
- Reduced the minimum width of the chat panel from 310 to 300 for better layout.
- Adjusted the width of the chat panel to match the chatPanelWidth variable, improving consistency.
2023-08-25 13:08:05 +08:00
Rankin Zheng
0bebfe83cf
Merge branch 'main' into 95-cannot-see-symbol-definitions-when-there-are-many 2023-08-24 23:52:02 -05:00
Rankin Zheng
7b00f6f62a Improve styling of Chip components in ChatPanel
- Added a new chipStyle object to define custom styles for Chip components.
- Applied the new chipStyle to the Chip components used for selecting the chat model.
- The new style improves the visual consistency with the rest of the VSCode UI.
2023-08-25 12:43:16 +08:00
Rankin Zheng
f7013b5a21 Remove redundant interval in ChatPanel
- Removed the interval that was set to fetch settings every 3 seconds in ChatPanel.tsx.
- This interval was unnecessary and has been removed to improve performance.
- Also, cleaned up the useEffect hook by removing the interval start and stop calls.
2023-08-25 12:14:34 +08:00
Rankin Zheng
e71d4c9209 Update UI elements and styles in ChatPanel component
- Imported Chip from '@mantine/core' for better UI representation.
- Adjusted minimum width and bottom position of the chat panel for better layout.
- Replaced Radio.Group with Chip.Group for selecting chat model, improving user interaction.
- Removed unnecessary Flex container wrapping the chat model selection.
2023-08-25 12:13:13 +08:00
Rankin Zheng
271f4eb55d Fix conditional rendering of Indicator in InputMessage component
- Corrected the placement of the closing brace for the conditional rendering of the Indicator component in the InputMessage component.
2023-08-25 11:35:20 +08:00
Rankin Zheng
824e9ae120 Enhance UI and UX of InputMessage and ChatPanel components
- Refactored InputContexts component to use Drawer for better UX.
- Added an Indicator to show the number of contexts in the InputMessage component.
- Added an ActionIcon to open the Drawer containing the contexts.
- Removed unused imports from InputMessage and ChatPanel components.
- Adjusted the zIndex of the 'scroll to bottom' ActionIcon in ChatPanel.
- Simplified the Accordion.Panel in InputContexts by removing unnecessary ScrollArea.
- Adjusted the styling of the pre tag in InputContexts for better readability.
2023-08-25 11:26:24 +08:00
bobo.yang
1e79465522 Update feature toggle for "ask-code" to true
- Update the feature toggle for "ask-code" to true in the feature_toggles.ts file.
2023-08-25 10:41:14 +08:00
bobo.yang
377abf2554 Refine response text parsing in getUndefinedSymbols
- Updated the response text trimming logic in getUndefinedSymbols function in contextRefDefs.ts.
- Now the function correctly extracts the JSON content from the response text.
2023-08-24 20:01:11 +08:00
Rankin Zheng
38a685edb2 Remove redundant interval in ChatPanel
- Removed the interval that was set to fetch settings every 3 seconds in ChatPanel.tsx.
- This interval was unnecessary and has been removed to improve performance.
- Also, cleaned up the useEffect hook by removing the interval start and stop calls.
2023-08-24 19:40:07 +08:00
Rankin Zheng
4189243ad7 Add explanations for /code, /commit_message, and /release_note commands
- Added explanations for the /code, /commit_message, and /release_note commands in MessageMarkdown/index.tsx.
- Updated the helpMessage function in ChatStore.ts to include the explanations for the new commands.
- Updated the list of available commands in ChatStore.ts to reflect the changes.
2023-08-24 11:34:15 +08:00
Rankin Zheng
28f1e186bd Clear input field and scroll to bottom after sending message
- Imported 'useTimeout' hook from '@mantine/hooks' in InputMessage/index.tsx.
- Added a setTimeout function in the handleSendMessage function in InputMessage/index.tsx to scroll to the bottom after clearing the input field.
2023-08-24 11:21:05 +08:00
Rankin Zheng
2e6ad2f484 Add reference to RootStore in ChatStore
- Imported 'RootStore' from './RootStore' in ChatStore.ts.
- Added a new property 'rootStore' of type 'RootStore' in ChatStore.ts.
- Created a new action 'setRootStore' in ChatStore.ts to set the value of 'rootStore'.
- Updated the 'RootStore' definition in RootStore.ts to include 'ChatStore' as a property.
- Called 'chat.setRootStore(rootStore)' in RootStore.ts to pass the rootStore instance to ChatStore.
- Registered a new handler for 'featureToggles' messages in ChatPanel.tsx to update the features based on the received value.
- Added a new property 'features' of type 'object' in ChatStore.ts to store the feature toggles.
- Updated the 'helpMessage' function in ChatStore.ts to conditionally include the '/ask-code' workflow based on the 'ask-code' feature toggle.
2023-08-24 11:10:27 +08:00
bobo.yang
48a9f0cb28 Add version check for devchat-ask package
- Added a version check for the devchat-ask package in commands.ts.
- Updated appInstall function in app_install.ts to accept package version.
- Modified installAskCode function in install_askcode.ts to pass package version to appInstall.
- Updated installDevchat function in install_devchat.ts to pass empty string as package version to appInstall.
- Added a new utility function getPackageVersion in pip_package_version.ts to get the installed version of a package.
2023-08-24 10:45:51 +08:00
bobo.yang
6d75c0d853 Update feature toggle for 'ask-code'
- Changed the 'ask-code' feature toggle from true to false in the feature_toggles.ts file.
2023-08-24 10:45:51 +08:00
bobo.yang
9c16bced23 Implement feature toggles for beta commands
- Added feature toggles for beta commands in the package.json file.
- Implemented dynamic registration of commands based on feature toggles.
- Added error messages for users trying to access beta commands without the correct permissions.
- Updated the version of the devchat-ask package based on the feature toggles.
- Created a new featureToggle handler to manage feature toggles.
2023-08-24 10:45:51 +08:00
Rankin Zheng
7dc42d2ca4 Add useInterval hook and clear it on component unmount
- Imported useInterval hook from '@mantine/hooks' in ChatPanel.tsx.
- Added a new function getSettings() in ChatPanel.tsx to fetch chat settings.
- Created a useInterval hook in ChatPanel.tsx to periodically call getSettings().
- Called getSettings() in the useEffect hook to fetch initial chat settings.
- Started and cleared the timer and interval in the useEffect hook to ensure they are properly managed on component mount and unmount.
- Registered a new handler for 'getSetting' messages in ChatPanel.tsx to update the chat model based on the received value.
- Updated the changeChatModel action in ChatStore.ts to remove the messageUtil.sendMessage call.
2023-08-24 10:39:35 +08:00
bobo.yang
53fb5ff12b Update getSetting handler to send configuration value
- Imported MessageHandler in updateConfig.ts.
- Updated getSetting function to send the fetched configuration value using MessageHandler.
- Registered an outgoing message for 'getSetting' command.
2023-08-24 10:24:28 +08:00
bobo.yang
34be6fe03e Merge branch '93-plugin-support-for-easy-switching-between-gpt35-and-gpt4' of https://github.com/covespace/devchat-vscode into 93-plugin-support-for-easy-switching-between-gpt35-and-gpt4 2023-08-24 08:59:34 +08:00
bobo.yang
4840035108 Implement getSetting handler in updateConfig.ts
- Added getSetting function in updateConfig.ts to fetch configuration values.
- Registered getSetting in loadHandlers.ts.
- Updated the import statement in loadHandlers.ts to include getSetting.
2023-08-24 08:59:13 +08:00
Rankin Zheng
c28e19ed8e Add chat model selection to chat panel
- Imported additional components in ChatPanel.tsx for the chat model selection.
- Adjusted padding and height in ChatPanel.tsx to accommodate the new chat model selection.
- Added a radio group in ChatPanel.tsx for selecting the chat model.
- Added a new property 'chatModel' to the ChatStore model in ChatStore.ts.
- Added a new action 'changeChatModel' in ChatStore.ts to update the chat model.
2023-08-24 08:55:06 +08:00
Rankin Zheng
ec5912cb45 Merge remote-tracking branch 'origin/switch_gpt_model' into 93-plugin-support-for-easy-switching-between-gpt35-and-gpt4 2023-08-24 08:24:41 +08:00
Rankin Zheng
54f275a41d Add recharge link to chat error message
- Imported additional components and icons in ChatPanel.tsx.
- Added a conditional button to the error message in ChatPanel.tsx that appears when the error message contains 'Insufficient balance'. This button directs the user to the official website to recharge.
- Added a new property 'rechargeSite' to the ChatStore model in ChatStore.ts.
2023-08-24 08:14:21 +08:00
bobo.yang
72a3859512 Fix import path in updateConfig.ts
- Corrected the import path for UiUtilWrapper from '@/util/uiUtil' to '../util/uiUtil'.
2023-08-23 22:58:46 +08:00
bobo.yang
8ceb8308d9 Add updateSetting handler to loadHandlers
- Imported updateSetting from './updateConfig' in loadHandlers.ts.
- Registered updateSetting in messageHandler.
- Created a new file updateConfig.ts to handle the updateSetting function.
- The updateSetting function updates the configuration based on the provided keys and value.
2023-08-23 22:12:17 +08:00
Rankin Zheng
10950fd6c8 Revert style changes to inline code blocks in MessageMarkdown
- Removed the application of 'breakStyles' to inline code blocks in MessageMarkdown component.
2023-08-23 21:32:13 +08:00
Rankin Zheng
7830a6d421 Refactor code to improve readability and functionality
- Renamed 'width' prop to 'chatPanelWidth' in InputMessage component for clarity.
- Passed 'chatPanelWidth' prop to MessageList component to set its width.
- Added condition to wrap long lines in 'markdown' or 'text' language blocks in MessageMarkdown component.
- Applied 'breakStyles' to inline code blocks in MessageMarkdown component.
- Passed 'chatPanelWidth' to InputMessage component in ChatPanel page.
2023-08-23 21:30:23 +08:00
Rankin Zheng
891ca523c6 Refactor UI components and remove redundant width props
- Replaced 'Container' components with 'Box' in MessageList/index.tsx and ChatPanel.tsx for better layout control.
- Removed unnecessary 'width' prop from MessageList component and its usage in ChatPanel.tsx.
- Simplified the structure of MessageList by removing the 'props' parameter and its related code.
- Adjusted the layout of the 'Box' component in MessageList/index.tsx to accommodate the removal of the 'width' prop.
2023-08-23 20:26:05 +08:00
Rankin Zheng
8d777feeed Revert "Remove unused features from initial bot message in ChatStore"
This reverts commit be4888f54cb0623b254c44a47466fa8545bccd14.
2023-08-23 19:56:28 +08:00
Rankin Zheng
8b43283566 Add 'help' command to DevChat
- Added a new 'help' command to the command menu in InputStore.ts.
- Modified the behavior of the 'Enter' and 'Tab' keys in InputMessage/index.tsx to display a help message when the 'help' command is selected.
- Refactored ChatStore.ts to include a new 'helpMessage' function that displays a help message.
- Removed redundant code in ChatStore.ts and reorganized the remaining code for better readability.
2023-08-23 19:53:55 +08:00
Rankin Zheng
be4888f54c Remove unused features from initial bot message in ChatStore
- Removed /code, /commit_message, /release_note, and /extension features from the initial bot message in ChatStore.
2023-08-22 17:44:53 +08:00
Rankin Zheng
bf459d0efa Add API key setting buttons and handle their actions
- Added buttons for setting OpenAI and DevChat keys in apiKeyMissedMessage function in historyMessagesBase.ts.
- Updated handleButton function in MessageMarkdown component to handle the new buttons' actions.
- Cleaned up formatting and removed unused code in historyMessagesBase.ts.
2023-08-22 17:41:24 +08:00
Rankin Zheng
d4dc6db801 Enhance MessageMarkdown component and ChatStore
- Added observer from 'mobx-react-lite' and useMst from '@/views/stores/RootStore' to MessageMarkdown.
- Imported Message from '@/views/stores/ChatStore' and messageUtil from '@/util/MessageUtil' to MessageMarkdown.
- Added handleExplain and handleButton functions to MessageMarkdown to handle button clicks and anchor clicks.
- Updated button and anchor components in MessageMarkdown to use the new handleButton and handleExplain functions.
- Added useEffect hook in ChatPanel to handle scroll to bottom when chat.scrollBottom changes.
- Added scrollBottom property and goScrollBottom action to ChatStore.
2023-08-22 17:22:30 +08:00