Skip to content
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

Merged
merged 10 commits into from Jun 21, 2023

Conversation

CertifiedJoon
Copy link
Contributor

@CertifiedJoon CertifiedJoon commented Jun 19, 2023

Fixes: #2508

Rendered by suspense
image

Plain text
image

I am not sure whether using memo on isPlainText has any performance gain. I need your opinions.

const inputRef = useRef<HTMLTextAreaElement>(null);
const memoIsPlainText = useMemo(() => isPlainText, [isPlainText]);
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@CertifiedJoon CertifiedJoon changed the title Issue/2508 Add: option to view plaintext chat message. Issue/2508 Jun 20, 2023
@CertifiedJoon CertifiedJoon marked this pull request as ready for review June 20, 2023 09:04
@@ -175,6 +177,12 @@ export const ChatMessageEntry = memo(function ChatMessageEntry({
)}
{state === "complete" && (
<>
<BaseMessageEmojiButton
Copy link
Collaborator

@notmd notmd Jun 20, 2023

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

Copy link
Contributor Author

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.

Copy link
Collaborator

@notmd notmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@notmd notmd merged commit 4f1b1eb into LAION-AI:main Jun 21, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to view unformatted response when using inference
2 participants