This commit adds the ability to track the scroll position of the chat panel and stop scrolling when the user scrolls up. It also includes a timer to automatically scroll to the bottom of the chat panel after a certain amount of time.
The ChatPanel.tsx file was moved to ChatPanel/index.tsx to better organize the project structure. The import statement for MessageUtil was also updated to reflect the new file path.
This commit enhances the handling of missing or invalid OPENAI_API_KEY
by adding validation checks and providing clear error messages to the
user. It also stores the valid API key in the secret storage and
displays a welcome message when the key is set correctly.
This commit adds a new welcome.html file to display a message to the
user when no Git repository is open. The message informs the user that
DevChat is designed for answering questions about Git repositories and
asks them to open a Git repository folder to start using DevChat.
- Use VSCode theme variables for colors and fonts in App.tsx and ChatPanel.tsx
- Update background, foreground, and border colors for various components
- Update hover and disabled states for buttons and icons
- Change DevChat.OPENAI_API_KEY title and add category
- Replace devchat.openChatPanel command with devchat-view.focus
- Update statusBarItem.command to devcaht.onStatusBarClick
- Set webviewOptions with retainContextWhenHidden: true for DevChatViewProvider
- Change the keyboard shortcut for sending a message from Ctrl+Enter to Enter without Shift
- Update the placeholder text to remove the reference to the old shortcut
- Import ExtensionContextHolder for secret storage access
- Retrieve OpenAI API key from secret storage, fallback to workspace config
- Make DevChat executable path configurable via workspace settings
- Replace hardcoded 'devchat' with configurable path in spawnAsync calls
- Add activationEvents to package.json for better extension activation
- Add Chinese commands for addConext, askForCode, and askForFile
- Register Chinese commands in contributes/commands.ts
- Set isChineseLocale context based on the user's locale
- Added a messageCount constant to limit the number of displayed messages
- Removed excess messages when the message length exceeds double the messageCount
- Ensured only the last 5 messages are loaded from the history
- Add a setTimeout function to scrollToBottom in useEffect to ensure smooth scrolling when ChatPanel is mounted.
- Adjust the height of the ScrollArea based on the generating state.
- Move the "Stop generating" button to a more appropriate location in the UI.
- Update the display property of the blinking cursor for better visibility.
Add a new message handler to load history messages when the ChatPanel component is mounted. The handler receives a list of message entries and appends them to the messageHandlers state. Each entry contains a hash, user, date, request, response, and context. The context is an array of objects with a content and role property, which is parsed and added to the messageHandlers state as well.
Also, add a useEffect hook to the ChatPanel component to call the new message handler when the component is mounted.
Add a button to stop generating messages during a dev chat session. The button is displayed when generating messages and stops the generation process when clicked. The button is represented by the IconPlayerStop icon from the Tabler Icons library. The button is disabled during message generation.
This commit adds the ability to commit code blocks with the commit message syntax highlighting. The commit button appears only when the code block is a commit message. The commit button sends the commit message content to the server. The commit button changes color to teal when the commit is successful.