- Import ChatResponse from DevChat in sendMessage.ts
- Update sendMessage function to handle parent_hash and partial responses
- Refactor DevChat.chat to parse response data and handle partial stdout
- Remove unused lastPromptHash variable
Add a padding to the top of the chat container to prevent the first message from being hidden behind the input field. Also, focus on the input field when the chat panel mounts for better user experience.
- Remove unused CSS class
- Add dynamic height to chat container
- Add smooth scrolling to bottom when new messages are received
- Fix input field width to match container width
- Use Mantine's useResizeObserver hook to get input field width
- Remove console.log statements
Add useEffect hooks to display received messages in the chat UI as bot messages. Also, update the Input component to use Textarea and add the ability to send messages using Ctrl + Enter
Add a copy button to code blocks in ChatPanel.tsx. The copy button allows users to easily copy code snippets to their clipboard. The button is implemented using the CopyButton component from @mantine/core and the IconCopy and IconCheck components from @tabler/icons-react.
Add react-syntax-highlighter and react-markdown to package.json to enable syntax highlighting and markdown rendering in the chat panel.
Also, update ChatPanel.tsx to use ReactMarkdown instead of Remark for markdown rendering. Additionally, add SyntaxHighlighter from react-syntax-highlighter to render code blocks with syntax highlighting.
This commit adds message handling for sending and receiving messages between the chat panel and the extension. It also displays the messages in the chat panel. The messages are displayed as a list of messages, with each message containing an avatar and the message content. The message content is displayed using the `Remark` component from the `react-remark` library.
Create a singleton instance for MessageUtil to avoid multiple instances of the class. The instance is created only once and returned on subsequent calls. This commit also removes the creation of a new instance of MessageUtil in ChatPanel.tsx.
Create a MessageUtil class to handle sending and receiving messages between the extension and the chat panel. Add a function to send messages to the extension and register message handlers to receive messages from the extension. When the user clicks the send button, send the message to the extension. When the extension sends a message, add it to the chat UI as a bot message.
This commit adds a new webpack configuration for the webview part of the project. It includes the necessary rules for transpiling and bundling the TypeScript and React code, as well as the CSS and image files. The new configuration is added to the existing configuration for the extension. The devtool option is changed to 'source-map' for better debugging experience.