-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: option to view plaintext chat message. Issue/2508 #3496
Conversation
const inputRef = useRef<HTMLTextAreaElement>(null); | ||
const memoIsPlainText = useMemo(() => isPlainText, [isPlainText]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably has no effect, you can remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted. i have made the change.
@@ -175,6 +177,12 @@ export const ChatMessageEntry = memo(function ChatMessageEntry({ | |||
)} | |||
{state === "complete" && ( | |||
<> | |||
<BaseMessageEmojiButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you adjust icon base on the isPlainText
state? I think using these two icons will make more sense
https://tabler-icons.io/i/markdown-off
https://tabler-icons.io/i/markdown
Just copy the SVG, we don't need to install the lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted. have made the relevant changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Fixes: #2508
Rendered by suspense
Plain text
I am not sure whether using memo on isPlainText has any performance gain. I need your opinions.