Skip to content

Commit 036da6a

Browse files
committed
SimpleChatTC:UICleanup: WordBreaks, Print avoid side vertical
Define rules to ensure that chat message contents wrap so as to avoid overflowing beyond the size of the screen being viewed. The style used for chat message role to be placed with vertical oriented text adjacent to the actual message content on the side seems to be creating issue with blank pages in some browsers, so avoid that styling when one is printing.
1 parent ac23168 commit 036da6a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

tools/server/public_simplechat/simplechat.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
}
4646
.chat-message-reasoning {
4747
border-block-style: dashed;
48+
overflow-wrap: break-word;
49+
word-break: break-word;
50+
hyphens: auto;
4851
}
4952
.chat-message-toolcall {
5053
border-style: solid;
@@ -58,6 +61,16 @@
5861
border-width: thin;
5962
border-radius: 2px;
6063
}
64+
.chat-message-content {
65+
overflow-wrap: break-word;
66+
word-break: break-word;
67+
hyphens: auto;
68+
}
69+
.chat-message-content-live {
70+
overflow-wrap: break-word;
71+
word-break: break-word;
72+
hyphens: auto;
73+
}
6174

6275

6376
.gridx2 {
@@ -117,8 +130,26 @@ button {
117130

118131
@media print {
119132

133+
120134
#fullbody {
121135
height: auto;
122136
}
123137

138+
.chat-message {
139+
border-style: solid;
140+
border-color: grey;
141+
border-width: thin;
142+
border-radius: 2px;
143+
display:inherit;
144+
}
145+
.chat-message-role {
146+
border-style: dotted;
147+
border-color: black;
148+
border-width: thin;
149+
border-radius: 4px;
150+
writing-mode:inherit;
151+
padding-inline: 1vmin;
152+
}
153+
154+
124155
}

tools/server/public_simplechat/simplechat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ class SimpleChat {
643643
*/
644644
async handle_response_multipart(resp, apiEP, elDiv) {
645645
let elP = ui.el_create_append_p("", elDiv);
646+
elP.classList.add("chat-message-content-live")
646647
if (!resp.body) {
647648
throw Error("ERRR:SimpleChat:SC:HandleResponseMultiPart:No body...");
648649
}

0 commit comments

Comments
 (0)