948 Commits

Author SHA1 Message Date
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
Rankin Zheng
dd6146f5d2 Fix context mapping in ChatPanel
- Add optional chaining to context mapping in loadHistoryMessages handler.
- Prevent potential errors when context is undefined or null.
2023-06-09 10:47:23 +08:00
bobo.yang
f510d1de62 Explicitly define array types in sendMessageBase.ts
- Change contextPaths, instructionPaths, and referencePaths to explicitly define string[] type.
2023-06-09 10:45:17 +08:00
Rankin Zheng
4b5279c1c8 Introduce custom hooks for Redux store
- Create hooks.ts file to define useAppDispatch and useAppSelector hooks.
- Replace useDispatch and useSelector with custom hooks in InputMessage.tsx and MessageContainer.tsx.
- Update RootState and AppDispatch types in store.ts.
2023-06-09 09:26:37 +08:00
bobo.yang
d998dbd71d Add edit functionality to custom contexts
- Add edit property to CustomContext interface.
- Implement edit functionality in CustomContexts class.
- Update _setting_.json files for git_log_for_releasenote and tree contexts.
2023-06-09 08:56:42 +08:00
Rankin Zheng
76e1f945a3 Add text truncation to InputMessage and MessageContainer
- Replace plain text with Text component and truncate='end' in InputMessage.tsx.
- Update MessageContainer.tsx to use Text component with truncate='end' for context display.
2023-06-08 23:18:59 +08:00
Rankin Zheng
a58d5580b6 Refactor InputMessage and inputSlice for menu handling
- Replace local state with Redux actions for menu management in InputMessage.tsx.
- Add openMenu, closeMenu, and setCurrentMenuIndex actions to inputSlice.ts.
- Update useSelector and useDispatch for menu-related states in InputMessage.tsx.
2023-06-08 20:53:38 +08:00
Rankin Zheng
7ebf8014be Refactor InputMessage and MessageContainer to use Redux
- Replace contextsHandlers with Redux actions in InputMessage.tsx.
- Update InputContexts to use useSelector and useDispatch.
- Remove onRefillClick prop and use Redux actions in MessageContainer.tsx.
- Update inputSlice with new actions for context management.
2023-06-08 20:40:05 +08:00
Rankin Zheng
3fc3c21abb Update InputMessage and chatSlice for message handling
- Import selectGenerating, newMessage, and startGenerating in InputMessage.tsx.
- Remove onSendClick prop and use Redux actions instead.
- Add messageUtil calls to chatSlice for sendMessage, regeneration, and stopDevChat.
2023-06-08 20:11:00 +08:00
Rankin Zheng
1771e87028 Refactor ChatPanel to use Redux for message handling
- Replace messageHandlers with Redux actions and selectors.
- Add newMessage, updateMessage, shiftMessage, and popMessage actions to chatSlice.
- Update MessageContainer to use useSelector for messages.
2023-06-08 19:54:21 +08:00