Skip to content

Commit

Permalink
Wrap chat message text (#92)
Browse files Browse the repository at this point in the history
Also support for hyphenating wrapped words should the browser support it
  • Loading branch information
gsproston-scottlogic committed Aug 8, 2023
1 parent 004f57f commit 638af95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/components/ChatBox/ChatBoxMessage.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
margin-top: 16px;
padding: 8px;
max-width: 85%;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
word-wrap: break-word;
}

.blocked {
Expand Down Expand Up @@ -35,7 +40,7 @@

.chat-box-message-user-transformed {
background-color: rgb(252 229 255);
float: left;
float: left;
float: left;
margin-right: auto;
text-align: left;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/ChatBox/ChatBoxMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function ChatBoxMessage({ message }: { message: ChatMessage }) {
? "chat-box-message chat-box-message-ai chat-box-message-blocked"
: "chat-box-message chat-box-message-ai chat-box-message-ok"
}
lang="en"
>
{(message.isUser && message.isOriginalMessage && <b>Input: </b>) ||
(message.isUser && !message.isOriginalMessage && <b>Edited: </b>)}
Expand Down

0 comments on commit 638af95

Please sign in to comment.