diff --git a/src/app/sidebar/aichat.less b/src/app/sidebar/aichat.less index a5e707e2..b39faf62 100644 --- a/src/app/sidebar/aichat.less +++ b/src/app/sidebar/aichat.less @@ -55,23 +55,18 @@ i { margin-right: 0.5em; } - - .chat-username { - font-weight: bold; - margin-right: 5px; - } } } .chat-msg-assistant { color: var(--app-text-color); - } - .chat-msg-user { - .msg-text { - font-family: var(--markdown-font); - font-size: 14px; + pre { white-space: pre-wrap; + word-break: break-word; + max-width: 100%; + overflow-x: auto; + margin-left: 0; } } diff --git a/src/app/sidebar/aichat.tsx b/src/app/sidebar/aichat.tsx index 54a68bd1..a0987938 100644 --- a/src/app/sidebar/aichat.tsx +++ b/src/app/sidebar/aichat.tsx @@ -9,7 +9,7 @@ import { boundMethod } from "autobind-decorator"; import { If, For } from "tsx-control-statements/components"; import { Markdown } from "@/elements"; import * as appconst from "@/app/appconst"; -import { OverlayScrollbarsComponent } from "overlayscrollbars-react"; +import { OverlayScrollbarsComponent, OverlayScrollbarsComponentRef } from "overlayscrollbars-react"; import "./aichat.less"; @@ -55,7 +55,7 @@ class AIChatKeybindings extends React.Component<{ AIChatObject: AIChat }, {}> { @mobxReact.observer class AIChat extends React.Component<{}, {}> { chatListKeyCount: number = 0; - chatWindowScrollRef: React.RefObject; + chatWindowScrollRef: React.RefObject; textAreaRef: React.RefObject; termFontSize: number = 14; @@ -79,6 +79,7 @@ class AIChat extends React.Component<{}, {}> { componentDidUpdate() { if (this.chatWindowScrollRef?.current != null) { + console.log("scrolling to bottom", this.chatWindowScrollRef.current.osInstance().scrollHeight); this.chatWindowScrollRef.current.scrollTop = this.chatWindowScrollRef.current.scrollHeight; } } @@ -238,15 +239,18 @@ class AIChat extends React.Component<{}, {}> {
Wave AI
- -
+ +
{this.renderChatMessage(chitem)}
-