6 Commits

Author SHA1 Message Date
Rankin Zheng
4189243ad7 Add explanations for /code, /commit_message, and /release_note commands
- Added explanations for the /code, /commit_message, and /release_note commands in MessageMarkdown/index.tsx.
- Updated the helpMessage function in ChatStore.ts to include the explanations for the new commands.
- Updated the list of available commands in ChatStore.ts to reflect the changes.
2023-08-24 11:34:15 +08:00
Rankin Zheng
10950fd6c8 Revert style changes to inline code blocks in MessageMarkdown
- Removed the application of 'breakStyles' to inline code blocks in MessageMarkdown component.
2023-08-23 21:32:13 +08:00
Rankin Zheng
7830a6d421 Refactor code to improve readability and functionality
- Renamed 'width' prop to 'chatPanelWidth' in InputMessage component for clarity.
- Passed 'chatPanelWidth' prop to MessageList component to set its width.
- Added condition to wrap long lines in 'markdown' or 'text' language blocks in MessageMarkdown component.
- Applied 'breakStyles' to inline code blocks in MessageMarkdown component.
- Passed 'chatPanelWidth' to InputMessage component in ChatPanel page.
2023-08-23 21:30:23 +08:00
Rankin Zheng
bf459d0efa Add API key setting buttons and handle their actions
- Added buttons for setting OpenAI and DevChat keys in apiKeyMissedMessage function in historyMessagesBase.ts.
- Updated handleButton function in MessageMarkdown component to handle the new buttons' actions.
- Cleaned up formatting and removed unused code in historyMessagesBase.ts.
2023-08-22 17:41:24 +08:00
Rankin Zheng
d4dc6db801 Enhance MessageMarkdown component and ChatStore
- Added observer from 'mobx-react-lite' and useMst from '@/views/stores/RootStore' to MessageMarkdown.
- Imported Message from '@/views/stores/ChatStore' and messageUtil from '@/util/MessageUtil' to MessageMarkdown.
- Added handleExplain and handleButton functions to MessageMarkdown to handle button clicks and anchor clicks.
- Updated button and anchor components in MessageMarkdown to use the new handleButton and handleExplain functions.
- Added useEffect hook in ChatPanel to handle scroll to bottom when chat.scrollBottom changes.
- Added scrollBottom property and goScrollBottom action to ChatStore.
2023-08-22 17:22:30 +08:00
Rankin Zheng
447ae59088 Refactor MessageBody component and enhance ChatStore
- Extracted Markdown rendering logic from MessageBody into a new MessageMarkdown component.
- Moved CodeButtons component into the new MessageMarkdown directory.
- Updated MessageBody to use the new MessageMarkdown component.
- Added value attributes to buttons in the initial bot message in ChatStore.
2023-08-22 16:14:43 +08:00