diff --git a/panel/chat/interface.py b/panel/chat/interface.py index 3ef6e68e77..d23a154f26 100644 --- a/panel/chat/interface.py +++ b/panel/chat/interface.py @@ -292,8 +292,8 @@ def _init_widgets(self): sizing_mode="stretch_width", max_width=show_expr.rx.where(90, 45), max_height=50, - margin=(5, 5, 5, 0), - align="start", + margin=(0, 5, 0, 0), + align="center", visible=visible ) if action != "stop": diff --git a/panel/chat/message.py b/panel/chat/message.py index 9996c5a5b9..229c6f3a22 100644 --- a/panel/chat/message.py +++ b/panel/chat/message.py @@ -277,6 +277,7 @@ def _build_layout(self): self.chat_copy_icon, stylesheets=self._stylesheets, sizing_mode="stretch_width", + css_classes=["header"] ), self._center_row, self._timestamp_html, diff --git a/panel/dist/css/chat_message.css b/panel/dist/css/chat_message.css index 692dcc4cfa..c85c9753ba 100644 --- a/panel/dist/css/chat_message.css +++ b/panel/dist/css/chat_message.css @@ -47,6 +47,10 @@ max-width: calc(100% - 80px); } +.header { + width: fit-content; +} + .name { font-size: 1em; margin-bottom: 0px; @@ -88,7 +92,7 @@ .timestamp { color: #a9a9a9; display: flex; - margin-top: 0px; + margin-top: 3px; } .markdown {