Skip to content

Add: option to view plaintext chat message. Issue/2508#3496

Merged
notmd merged 10 commits into
LAION-AI:mainfrom
CertifiedJoon:issue/2508
Jun 21, 2023
Merged

Add: option to view plaintext chat message. Issue/2508#3496
notmd merged 10 commits into
LAION-AI:mainfrom
CertifiedJoon:issue/2508

Conversation

@CertifiedJoon

@CertifiedJoon CertifiedJoon commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

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 [isEditing, setIsEditing] = useBoolean(false);
const [isPlainText, setIsPlainText] = useState<boolean>(false);
const inputRef = useRef<HTMLTextAreaElement>(null);
const memoIsPlainText = useMemo(() => isPlainText, [isPlainText]);

Copy link
Copy Markdown
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
Copy Markdown
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
)}
{state === "complete" && (
<>
<BaseMessageEmojiButton

@notmd notmd Jun 20, 2023

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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.

@notmd notmd left a comment

Copy link
Copy Markdown
Collaborator

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
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