632 Commits

Author SHA1 Message Date
boob.yang
bc10fc594d
Merge pull request #229 from devchat-ai/add_devchat_png
add devchat png
2023-08-04 16:26:39 +08:00
bobo.yang
7588c6932e add devchat png 2023-08-04 16:25:22 +08:00
Rankin Zheng
5b36f0b9d1
Merge pull request #228 from devchat-ai/fix-ajust-margin-in-message-header
Adjust margin in MessageHeader component
2023-08-04 11:13:03 +08:00
Rankin Zheng
96bef7ff1d Adjust margin in MessageHeader component
- Added marginRight of 10px to the container holding the ActionIcon in MessageHeader.
- Also applied marginRight of 10px to the ActionIcon itself for consistent spacing.
2023-08-04 11:07:55 +08:00
Rankin Zheng
4d3e53ded3
Merge pull request #227 from devchat-ai/70-implement-a-feature-to-display-a-message-at-the-top-of-the-chat-history-when-scrolled-to-the-top
70 implement a feature to display a message at the top of the chat history when scrolled to the top
2023-08-03 22:43:57 +08:00
Rankin Zheng
fd0d0c7c94 Move ChatPanel to pages folder
- Moved ChatPanel from views to pages folder.
- Updated import paths for ChatPanel in App.tsx and MessageContainer in ChatPanel.tsx.
2023-08-03 21:58:49 +08:00
Rankin Zheng
abbad8ee64 Add scroll to bottom button in ChatPanel
- Imported ActionIcon, IconCircleArrowDown, and IconCircleArrowDownFilled in ChatPanel.tsx.
- Added a scroll to bottom button in the chat panel.
2023-08-03 21:08:49 +08:00
Rankin Zheng
addc1bcd33 Remove unused ScrollArea type in ChatPanel.tsx
- Removed the unused type "never" for ScrollArea in ChatPanel.tsx.
2023-08-03 20:49:00 +08:00
Rankin Zheng
8da3083e9e Fix import path and remove unused CopyWebpackPlugin
- Fixed import path for avatar_devchat.svg in MessageHeader/index.tsx.
- Removed unused CopyWebpackPlugin from webpack.config.js.
2023-08-03 17:16:15 +08:00
Rankin Zheng
7062d423ae Delete assets folder and files 2023-08-03 17:05:44 +08:00
Rankin Zheng
ee226826d2 Move store and hooks to reducers folder
- Moved store.ts and hooks.ts from views to reducers folder.
- Updated import paths for store in index.tsx and hooks.ts.
- Adjusted import paths for store in chatSlice.ts and inputSlice.ts.
- Improved code formatting in chatSlice.ts.
2023-08-03 17:03:42 +08:00
Rankin Zheng
d7371149f1 Move MessageContainer to components folder
- Moved MessageContainer from views to components folder.
- Updated import path for MessageContainer in ChatPanel.tsx.
2023-08-03 17:02:02 +08:00
Rankin Zheng
0bcc339447 Move Icons and avatar images to appropriate folders
- Moved Icons.tsx from views to components/ChatIcons folder.
- Updated import path for Icons in InputMessage/index.tsx.
- Moved avatar_devchat.svg, avatar_spaceman.png, and avatar_user.svg from views to components/MessageHeader folder.
- Updated import paths for avatar images in MessageHeader/index.tsx.
2023-08-03 17:01:12 +08:00
Rankin Zheng
7e2d622236 Move CurrentMessage to components folder
- Moved CurrentMessage from views to components folder.
2023-08-03 16:53:31 +08:00
Rankin Zheng
9663f91fe8 Move MessageHeader to components folder
- Moved MessageHeader from views to components folder.
- Updated import path for MessageHeader in MessageContainer.tsx.
2023-08-03 16:51:39 +08:00
Rankin Zheng
cec95185b3 Move chatSlice and inputSlice to reducers folder
- Moved chatSlice and inputSlice from views to reducers folder.
- Updated import paths for chatSlice and inputSlice in various files.
- Adjusted import paths for chatSlice and inputSlice in store.ts.
2023-08-03 16:49:30 +08:00
Rankin Zheng
b900fe0b8b Move InputMessage and related files to components folder
- Moved InputMessage and InputContexts from views to components folder.
- Updated import paths for InputMessage in ChatPanel.tsx.
- Adjusted import paths for inputSlice and chatSlice in InputMessage and InputContexts.
- Improved code formatting in InputMessage.tsx.
2023-08-03 16:47:26 +08:00
Rankin Zheng
efd3bc0e14 Move CodeBlock and related files to components folder
- Moved CodeBlock and CodeButtons from views to components folder.
- Updated import paths for CodeBlock in CurrentMessage.tsx and MessageContainer.tsx.
- Adjusted import path for CodeButtons in CodeBlock.
2023-08-03 16:41:35 +08:00
Rankin Zheng
4acbf8a8eb Refactor chat panel and move buttons to components folder
- Moved StopButton and RegenerationButton from views to components folder.
- Updated import paths for StopButton and RegenerationButton in ChatPanel.tsx.
- Adjusted import paths for chatSlice in StopButton and RegenerationButton.
- Improved code formatting in ChatPanel.tsx.
2023-08-03 16:34:52 +08:00
boob.yang
a9514c62ba
Merge pull request #226 from devchat-ai/split_api_key_in_diff_inputs
Separate handling for OpenAI and DevChat API keys
2023-08-03 15:12:59 +08:00
bobo.yang
e2e761fd16 Separate handling for OpenAI and DevChat API keys
- Renamed and split the API key settings in package.json into DevChat and OpenAI specific keys.
- Updated the commands for setting API keys to handle OpenAI and DevChat keys separately.
- Modified the ApiKeyManager to handle and validate OpenAI and DevChat keys separately.
- Updated the status bar view to use the DevChat access key command.
- Adjusted the tests to reflect the new handling of API keys.
2023-08-03 15:09:34 +08:00
boob.yang
c665bc881f
Merge pull request #225 from devchat-ai/fix_access_key_error
Update API key validation and handling
2023-08-03 11:11:11 +08:00
bobo.yang
bef66fb80e Update API key validation and handling
- Modified the API key validation logic to check for non-empty strings before validating.
- Updated the API key prefix from 'sk.' to 'sk-' in the ApiKeyManager and corresponding tests.
- Adjusted the test cases to reflect the new API key format.
2023-08-03 10:58:18 +08:00
boob.yang
e9910019e9
Merge pull request #224 from devchat-ai/update_symbol_action
Refactor symbol definition and reference retrieval
2023-07-28 08:14:19 +08:00
boob.yang
0ed5fe5af3
Merge pull request #223 from devchat-ai/test_fix_2
Test fix 2
2023-07-28 08:10:35 +08:00
bobo.yang
cd8f99405a Refactor symbol definition and reference retrieval
- Improved error handling and validation in symbol definition and reference retrieval functions.
- Enhanced the logic for finding the smallest symbol definition that contains the target range.
- Updated the function descriptions to provide more detailed information about their purpose, input, output, and error handling.
- Added 'ref_line' to the output of the symbol reference retrieval function.
2023-07-27 12:48:18 +08:00
bobo.yang
63fa9b1bd2 Add tracking and deletion of temporary files in sendMessage function
- Added a new array `tempFiles` to store the names of temporary files created during the execution of the `sendMessage` function.
- When a new temporary file is created, its name is added to the `tempFiles` array.
- After the message is sent, the function iterates over the `tempFiles` array and deletes each file.
- This ensures that only the temporary files created during the execution of the function are deleted.
2023-07-27 12:47:56 +08:00
bobo.yang
716895045a Add temporary file handling for contextInfo in sendMessage
- Added createTempFile and deleteTempFiles functions in sendMessage.ts.
- Modified sendMessage function to handle contextInfo field in the message.
- If the file name is not present in the context, a temporary file is created.
- The file name is inserted into the text field of the message.
- All temporary files created are deleted after the message is sent.
- Modified handleSendClick function in InputMessage.tsx to process and send the message to the extension.
- Modified startGenerating reducer in chatSlice.ts to send the message with contextInfo.
2023-07-27 08:11:40 +08:00
boob.yang
e098202c17
Merge pull request #222 from devchat-ai/fix_install_error2
Change location of temporary file in pip_cmd_run function
2023-07-26 15:41:02 +08:00
bobo.yang
999edb5129 Change location of temporary file in pip_cmd_run function
- Imported tempfile module to create a temporary file.
- Replaced the creation of 'test.txt' in the current directory with a temporary file.
- The temporary file is automatically deleted when it is closed, eliminating the need for manual deletion.
2023-07-26 15:03:20 +08:00
boob.yang
1f841446e2
Merge pull request #221 from devchat-ai/fix_python_3.8_error
Update pip command functions in install.py
2023-07-26 15:01:55 +08:00
bobo.yang
a3ccb0d45d Update pip command functions in install.py
- Changed the type hinting for the 'pipcmd' parameter in 'pip_cmd_run' and 'pip_cmd_with_retries' functions.
- The 'pipcmd' parameter now accepts any type, not just list of strings.
2023-07-26 11:25:40 +08:00
boob.yang
475b04d88d
Merge pull request #220 from devchat-ai/fix_install_error
Refactor DevChat installation error handling
2023-07-25 17:37:43 +08:00
bobo.yang
8566b37e72 Refactor DevChat installation error handling
- Removed unnecessary if-else condition for errorInstall.
- Moved devchatCommandEnv extraction outside the if-else block.
- Added condition to check if devchatCommandEnv exists before updating configuration and setting devchatStatus.
- Added else block to handle case when devchatCommandEnv is undefined.
2023-07-25 16:57:06 +08:00
boob.yang
b35fd5dc3e
Merge pull request #219 from devchat-ai/fix_symbol_ref_bug
Fix symbol ref bug
2023-07-25 12:41:35 +08:00
bobo.yang
a1b124166d Fix string interpolation in devchat version logging
- Corrected the syntax for string interpolation in the log message that displays the devchat version and the expected version.
2023-07-25 12:35:49 +08:00
bobo.yang
6681ed65cf Improve symbol reference detection in SymbolRefAction
- Added a function to check if the symbol at a given index is the correct symbol.
- Adjusted the getSymbolPosition function to use the new check function.
- Enhanced the findSymbolInWorkspace function to handle more edge cases.
- Added more logging for better debugging and traceability.
2023-07-25 12:35:20 +08:00
bobo.yang
2fa11df238 Refactor select context action into select text and select block actions
- Split the SelectContextAction into two separate actions: SelectTextAction and SelectBlockAction.
- Updated the ActionManager to register these new actions.
- SelectTextAction retrieves the selected text in the active document.
- SelectBlockAction retrieves the entire block of code in the active document, such as a function, when a part of it is selected.
2023-07-25 12:34:24 +08:00
boob.yang
98d7206b87
Merge pull request #218 from devchat-ai/current_selection_function
Add CurrentDocumentAction and SelectContextAction
2023-07-25 00:27:37 +08:00
bobo.yang
9074b571e4 Add CurrentDocumentAction and SelectContextAction
- Added CurrentDocumentAction and SelectContextAction to ActionManager.
- Created new files for CurrentDocumentAction and SelectContextAction.
- CurrentDocumentAction retrieves the current active document.
- SelectContextAction retrieves the selected information in the current document.
2023-07-25 00:18:38 +08:00
boob.yang
5dbf71f8e1
Merge pull request #217 from devchat-ai/fix_symbole_ref_error
Fix symbole ref error
2023-07-24 18:57:46 +08:00
bobo.yang
bf8a4b198c Enhance SymbolDefAction and SymbolRefAction classes
- Added new imports and removed unused ones in both classes.
- Refactored findSymbolInWorkspace function in SymbolDefAction to include symbol line and file.
- Added checks for absolute path for symbol file in handlerAction method of SymbolDefAction.
- Updated args in SymbolDefAction constructor to include line and file.
- Made getSymbolPosition function in SymbolRefAction exportable and updated its usage in SymbolDefAction.
- Minor changes in SymbolRefAction to improve code readability and efficiency.
2023-07-24 18:51:05 +08:00
bobo.yang
6342c6eb25 Improve error handling in symbol reference action
- Added null checks before processing reference locations and symbols.
- Ensured that symbol children are processed only if they exist.
- Added a check to continue the loop if a symbol is not found.
2023-07-24 17:37:02 +08:00
Rankin Zheng
701c0d7903
Merge pull request #216 from devchat-ai/128-extract-inline-styles-to-separate-css-files-in-react-component
Refactor CurrentMessage component in chat feature
2023-07-24 13:07:32 +08:00
Rankin Zheng
c60443e509
Merge pull request #215 from devchat-ai/128-extract-inline-styles-to-separate-css-files-in-react-component
128 extract inline styles to separate css files in react component
2023-07-24 13:06:30 +08:00
Rankin Zheng
f42e0f638b Refactor CurrentMessage component in chat feature
- Removed unused import 'selectResponsed' from chatSlice.
- Replaced 'selecHasDone' with 'selectResponsed' for better clarity.
- Removed unnecessary condition check for 'hasDone' in useEffect.
- Added 'responsed' as a dependency in useEffect to trigger update when response is received.
2023-07-24 13:05:16 +08:00
boob.yang
8f4fcfea39
Merge pull request #214 from devchat-ai/fix_del_message_error
Update condition in deleteMessage method
2023-07-24 12:20:59 +08:00
bobo.yang
a7b1953cf7 Update condition in deleteMessage method
- Added a check to ensure the messageHash equals the firstMessageHash before updating.
- This prevents unnecessary updates and ensures the correct message is targeted for deletion.
2023-07-24 12:18:00 +08:00
boob.yang
bfe8720a9c
Merge pull request #213 from devchat-ai/remove_dup_actions
Refactor ActionManager class initialization
2023-07-24 12:16:31 +08:00
Rankin Zheng
3c2345af0b Refactor ChatPanel by extracting button components
- Extracted RegenerationButton and StopButton components from ChatPanel into separate files.
- Removed unused imports and state from ChatPanel.
- Updated ChatPanel to use the new button components.
2023-07-24 11:34:10 +08:00