Skip to content

Conversation

@cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Mar 24, 2025

Follow up to #1853

Apparently statically rendered custom icons were never working as intended. Here's an example:

import faicons

from shiny.express import ui

welcome = """
**Hello!** How can I help you today?

Here are a couple suggestions:

* <span class="suggestion">Tell me a joke</span>
* <span class="suggestion submit">Tell me a story</span>
"""

ui.br()

chat = ui.Chat(id="chat")
chat.ui(
    messages=[welcome],
    icon_assistant=faicons.icon_svg("otter"),
)

Currently, you get the default robot icon, when you should get an otter in the startup message.

This got overlooked because ui.Chat()'s messages are dynamically rendered (and thus, are included in the server-side state), but .ui(messages) is static (and thus is not)

@cpsievert cpsievert marked this pull request as draft March 24, 2025 18:38
@cpsievert cpsievert marked this pull request as ready for review March 24, 2025 18:49
@cpsievert cpsievert requested a review from gadenbuie March 24, 2025 18:49
Copy link
Collaborator

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cpsievert cpsievert merged commit 24ef875 into main Mar 24, 2025
54 checks passed
@cpsievert cpsievert deleted the fix-icon-startup-message branch March 24, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants