-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Tweak ChatMessage layout #7209
Tweak ChatMessage layout #7209
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7209 +/- ##
==========================================
+ Coverage 82.24% 82.27% +0.02%
==========================================
Files 331 331
Lines 49420 49470 +50
==========================================
+ Hits 40647 40699 +52
+ Misses 8773 8771 -2 ☔ View full report in Codecov by Sentry. |
The green activity indicator is now in the right spot. I still see the divider icon though. You can reproduce with from asyncio import sleep
import panel as pn
ORSTED_AVATAR = "https://nationalmaglab.org/media/hdri02zb/hans-christian-oersted.png"
ASSISTANT = "Ørsted, AI Trading Assistant"
pn.chat.message.DEFAULT_AVATARS[ASSISTANT] = ORSTED_AVATAR
pn.chat.ChatMessage.show_reaction_icons = False
pn.extension(sizing_mode="stretch_width")
async def generate_response(contents, user, instance):
text = ""
for _ in range(0, 50):
text += "ABCD "
yield text
await sleep(0.1)
# pylint: disable=line-too-long
chat_interface = pn.chat.ChatInterface(
callback=generate_response,
callback_user=ASSISTANT,
widgets=pn.chat.ChatAreaInput(
placeholder="Enter some text and click Send",
auto_grow=True,
max_length=20000,
),
)
chat_interface.send(
"""XYZ """ * 50,
user=ASSISTANT,
respond=False,
)
pn.template.FastListTemplate(
main=[chat_interface],
main_max_width="1200px",
main_layout=None,
).servable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described its almost perfect. The vertical bar is still there though.
The line is not reproducible on my end, I think you forgot to pull. |
Also we will have to revisit this, e.g. serializing a whole model simply to render the separator icon is a little bit insane. |
Ensures the icon divider is invisible if reaction_icons is empty or if copy icon is invisible.
cm = pn.chat.ChatMessage("ABC", show_copy_icon=False)
cm = pn.chat.ChatMessage("ABC", reaction_icons={})