Skip to content
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

Extend chatfeed card stylesheets through card_params #6240

Closed
pmeier opened this issue Jan 19, 2024 · 0 comments · Fixed by #6242
Closed

Extend chatfeed card stylesheets through card_params #6240

pmeier opened this issue Jan 19, 2024 · 0 comments · Fixed by #6242
Milestone

Comments

@pmeier
Copy link

pmeier commented Jan 19, 2024

#6154 added the ability to pass parameters to the Card though the pn.chat.ChatFeed:

panel/panel/chat/feed.py

Lines 155 to 156 in 00a45d7

card_params = param.Dict(default={}, doc="""
Params to pass to Card, like `header`, `header_background`, `header_color`, etc.""")

Unfortunately, it is impossible to send additional stylesheets, because the builtin ones are simply overwritten by whatever one passes through the chat feed:

panel/panel/chat/feed.py

Lines 270 to 272 in 00a45d7

stylesheets=self._stylesheets + self.param.stylesheets.rx(),
)
card_params.update(self.card_params)

To achieve that, one has to access the private attribute:

chat_feed._card.stylesheets.extend([...])

This is what we do over at Ragna.

Would it be possible to refactor how card_params are used internally to update the stylesheets rather than flat-out overwriting them?

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 a pull request may close this issue.

2 participants