Spaces:
Runtime error
Runtime error
Commit ·
d747e02
1
Parent(s): 5e18627
refactor: put css in ChatBox component
Browse files- wanderlust.py +11 -7
wanderlust.py
CHANGED
|
@@ -132,7 +132,7 @@ def ChatMessage(message):
|
|
| 132 |
elif message.role == "user":
|
| 133 |
solara.Text(
|
| 134 |
message.content[0].text.value,
|
| 135 |
-
classes=["chat-message", "user-message"],
|
| 136 |
)
|
| 137 |
elif message.role == "assistant":
|
| 138 |
if message.content[0].text.value:
|
|
@@ -172,6 +172,16 @@ def ChatBox(children=[]):
|
|
| 172 |
# this uses a flexbox with column-reverse to reverse the order of the messages
|
| 173 |
# if we now also reverse the order of the messages, we get the correct order
|
| 174 |
# but the scroll position is at the bottom of the container automatically
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
solara.Column(
|
| 176 |
style={
|
| 177 |
"flex-grow": "1",
|
|
@@ -323,17 +333,11 @@ def Page():
|
|
| 323 |
width: 100%;
|
| 324 |
height: 15%;
|
| 325 |
}
|
| 326 |
-
.chat-box > :last-child{
|
| 327 |
-
padding-top: 7.5vh;
|
| 328 |
-
}
|
| 329 |
.map-container{
|
| 330 |
width: 50vw;
|
| 331 |
height: 100%;
|
| 332 |
justify-content: center;
|
| 333 |
}
|
| 334 |
-
.user-message{
|
| 335 |
-
font-weight: bold;
|
| 336 |
-
}
|
| 337 |
@media screen and (max-aspect-ratio: 1/1) {
|
| 338 |
.ui-container{
|
| 339 |
padding: 30px;
|
|
|
|
| 132 |
elif message.role == "user":
|
| 133 |
solara.Text(
|
| 134 |
message.content[0].text.value,
|
| 135 |
+
classes=["chat-message", "chat-user-message"],
|
| 136 |
)
|
| 137 |
elif message.role == "assistant":
|
| 138 |
if message.content[0].text.value:
|
|
|
|
| 172 |
# this uses a flexbox with column-reverse to reverse the order of the messages
|
| 173 |
# if we now also reverse the order of the messages, we get the correct order
|
| 174 |
# but the scroll position is at the bottom of the container automatically
|
| 175 |
+
solara.Style(
|
| 176 |
+
"""
|
| 177 |
+
.chat-box > :last-child{
|
| 178 |
+
padding-top: 7.5vh;
|
| 179 |
+
}
|
| 180 |
+
.chat-user-message{
|
| 181 |
+
font-weight: bold;
|
| 182 |
+
}
|
| 183 |
+
"""
|
| 184 |
+
)
|
| 185 |
solara.Column(
|
| 186 |
style={
|
| 187 |
"flex-grow": "1",
|
|
|
|
| 333 |
width: 100%;
|
| 334 |
height: 15%;
|
| 335 |
}
|
|
|
|
|
|
|
|
|
|
| 336 |
.map-container{
|
| 337 |
width: 50vw;
|
| 338 |
height: 100%;
|
| 339 |
justify-content: center;
|
| 340 |
}
|
|
|
|
|
|
|
|
|
|
| 341 |
@media screen and (max-aspect-ratio: 1/1) {
|
| 342 |
.ui-container{
|
| 343 |
padding: 30px;
|