957 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
76ec8c0019 Allow Tab key to select command in InputMessage
- Modify event condition to include Tab key along with Enter key.
2023-06-15 20:56:17 +08:00
Rankin Zheng
5f519538d7
Merge pull request #184 from devchat-ai/171-dynamic-loading-and-disposal-of-chat-history-for-improved-frontend-performance
171 dynamic loading and disposal of chat history for improved frontend performance
2023-06-15 20:53:06 +08:00
Rankin Zheng
fdbe1d0565 Temporarily disable message loading logic
- Comment out dispatch(fetchHistoryMessages) in ChatPanel.tsx.
- Add TODO comment explaining the reason for disabling the logic.
2023-06-15 20:52:33 +08:00
Rankin Zheng
799c87abcf Remove default message and simplify MessageContainer
- Remove DefaultMessage component and its usage.
- Simplify MessageContainer by directly mapping messages to components.
- Adjust styling and layout for better readability.
2023-06-15 20:43:52 +08:00
bobo.yang
baaaafa240 Handle secretStorageGet errors
- Wrap secretStorageGet in a try-catch block.
- Log errors to the logger channel.
- Return undefined in case of an error.
2023-06-14 19:44:31 +08:00
bobo.yang
f50e2118b0 Add PYTHONUTF8 environment variable to DevChat
- Set PYTHONUTF8 to 1 in the DevChat class.
- Ensures proper handling of UTF-8 encoding.
2023-06-14 15:57:32 +08:00
Rankin Zheng
439838bb21 Improve chat history pagination and fetching
- Remove selectMessageCount, selectIsMiddle, and related useEffect in ChatPanel.tsx.
- Add selectPageIndex and selectIsLastPage to chatSlice.ts.
- Update fetchHistoryMessages to accept pageIndex parameter.
- Modify chatSlice to handle pageIndex and isLastPage states.
2023-06-13 17:53:05 +08:00
Rankin Zheng
bcdc78d65f Update import paths with alias
- Replace relative import paths with '@/...' alias in multiple files.
- Update tsconfig.json to include paths configuration.
- Add alias configuration to webpack.config.js.
2023-06-13 17:03:48 +08:00
bobo.yang
c7a891e00d add devchatStatus checking 2023-06-13 12:48:58 +08:00
bobo.yang
5fc21c1982 Refactor checkDevChatDependency to accept pythonCommand
- Update checkDevChatDependency to take pythonCommand as an argument.
- Modify getPipxEnvironmentPath to use pythonCommand.
- Adjust statusBarViewBase.ts to pass pythonCommand.
- Update test cases in commandsBase.test.ts accordingly.
2023-06-13 11:56:03 +08:00
Rankin Zheng
9a906a1c0f Update ChatPanel to handle scroll position and message fetching
- Added selectors for isTop, isBottom, and isMiddle in chatSlice.
- Removed scrollPosition and stopScrolling states from ChatPanel.
- Added onScrollPositionChange function to handle scroll events.
- Dispatch onMessagesTop, onMessagesBottom, and onMessagesMiddle actions based on scroll position.
2023-06-13 11:54:31 +08:00
bobo.yang
8ccf73b9bb Update welcome message to include SVN repositories
- Modify welcome.html to mention both Git and SVN repository folders.
2023-06-13 11:26:32 +08:00
bobo.yang
e65bef0633 load topics even no folder is opened. 2023-06-13 11:15:02 +08:00
Rankin Zheng
ec440be005 Refactor history messages fetching
- Add fetchHistoryMessages async thunk in chatSlice.
- Replace messageUtil.sendMessage with dispatch(fetchHistoryMessages()) in ChatPanel.tsx.
- Remove redundant message handler registration in ChatPanel.tsx.
2023-06-13 11:11:29 +08:00
bobo.yang
ae15158fe5 Replace 'path' with 'fsPath' in registerAddContextCommand
- Update callback function to use 'fsPath' instead of 'path'.
- Modify sendFileSelectMessage call to pass 'uri.fsPath'.
2023-06-13 11:05:42 +08:00
bobo.yang
3fc21b920e update log text 2023-06-13 10:45:11 +08:00
Rankin Zheng
b4a8839313 Refactor command menu fetching
- Remove messageUtil.sendMessage from ChatPanel.tsx.
- Add fetchCommandMenus to inputSlice using createAsyncThunk.
- Replace local commandMenus state with Redux store in InputMessage.tsx.
2023-06-13 10:12:13 +08:00
Rankin Zheng
e594ef75c5 Refactor context menu fetching
- Move context menu fetching to inputSlice using createAsyncThunk.
- Remove redundant message handler registration in InputMessage.tsx.
- Use fetched context menus from the Redux store.
2023-06-13 10:00:27 +08:00
Rankin Zheng
7f25e426b2 Refactor directory structure 2023-06-13 09:20:12 +08:00
bobo.yang
eba9fa9782 Load topics only when a workspace is open
- Update dependencyCheck in statusBarViewBase.ts.
- Add a condition to check if a workspace is open before loading topics.
2023-06-13 08:52:44 +08:00
bobo.yang
659e35edf8 don't focus on output while devchat check fail. 2023-06-13 08:46:53 +08:00
bobo.yang
4e249441db update logger output 2023-06-13 08:45:42 +08:00
bobo.yang
abba2c7df3 Add getValidPythonCommand function and improve dependency check
- Implement getValidPythonCommand in commandsBase.ts to detect Python 3.
- Update dependencyCheck in statusBarViewBase.ts to use getValidPythonCommand.
- Modify install.py to use sys.executable instead of hardcoded 'python3'.
2023-06-13 08:32:22 +08:00
bobo.yang
d349ea42a5 Improve statusBarView tooltip and command handling
- Update tooltip text to 'DevChat is checking ..., please wait'.
- Set command property to undefined to avoid "command '' not found" error.
2023-06-13 08:23:46 +08:00
bobo.yang
22a5705c59 Add terminal disposal before running new command
- Import logger in uiUtil_vscode.ts.
- Iterate through existing terminals and dispose the one with the same name.
- Create a new terminal and run the command.
2023-06-13 08:21:29 +08:00
bobo.yang
2503da5a09 Update DevChat installation command
- Replace 'python' with 'python3' in DevChat Install command.
2023-06-12 08:42:30 +08:00
bobo.yang
13f161506f Improve DevChat dependency check and error handling
- Add logger import to commandsBase.ts.
- Replace plain error handling with logger in checkDevChatDependency.
- Refactor getPipxEnvironmentPath and updateEnvironmentPath functions.
2023-06-12 08:39:02 +08:00
bobo.yang
dde0ff2e44 Fix versionChanged assignment in statusBarViewBase.ts
- Corrected the assignment of versionChanged variable.
- Removed unnecessary const declaration.
2023-06-09 12:39:31 +08:00
bobo.yang
01c2fc545b let userStop to false before sendMessage 2023-06-09 12:09:18 +08:00
Rankin Zheng
8d271361ef Move stopDevChat message sending to StopButton onClick
- Removed messageUtil.sendMessage from chatSlice stopGenerating action.
- Added messageUtil.sendMessage to StopButton onClick event in ChatPanel index.tsx.
2023-06-09 12:01:56 +08:00
Rankin Zheng
c16d7e1404
Merge pull request #174 from covespace/fix-hello-load-error
Fix hello load error
2023-06-09 11:21:25 +08:00
Rankin Zheng
09ab19289f Add keys to Accordion.Item components in ChatPanel
- Assign unique keys to Accordion.Item components in InputMessage.tsx.
- Update MessageContainer.tsx to include keys for Accordion.Item components.
2023-06-09 11:16:20 +08:00
Rankin Zheng
c60860559e Add keys to mapped elements in ChatPanel components
- Add unique keys to mapped elements in InputMessage.tsx.
- Refactor MessageContainer.tsx to use keys for mapped elements.
- Remove unused IDs from ChatPanel/index.tsx.
2023-06-09 11:10:23 +08:00
Rankin Zheng
056f6dafaa fix svg DOM property invliad 2023-06-09 11:09:57 +08:00