Add footer_actions parameter to ChatMessage#605
Add footer_actions parameter to ChatMessage#605ghostiee-11 wants to merge 2 commits intopanel-extensions:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #605 +/- ##
==========================================
+ Coverage 82.03% 82.04% +0.01%
==========================================
Files 31 31
Lines 3228 3230 +2
==========================================
+ Hits 2648 2650 +2
Misses 580 580 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Switch from inline Button chips in footer_objects to a single yellow lightbulb IconButton in footer_actions. The icon appears before edit/copy icons and cycles through suggestions on click, populating the ChatAreaInput without auto-submitting. Falls back to footer_objects on older pmui versions that lack footer_actions support. Addresses review feedback requesting a cleaner icon button approach instead of inline chips. Depends on panel-extensions/panel-material-ui#605 for footer_actions.
Replace inline suggestion chips with a single yellow lightbulb IconButton that cycles through AI-generated follow-up suggestions on click, populating the ChatAreaInput without auto-submitting. - Add FollowUpSuggestion/FollowUpSuggestions models - Add suggest_followup() to Coordinator with llm_spec="ui" - Add _add_followup_icon_to_footer() using footer_actions with fallback to footer_objects for older pmui versions - Add follow_up_suggestions settings toggle - Add docs for the feature - 15 tests (11 UI + 4 coordinator) Depends on panel-extensions/panel-material-ui#605 for footer_actions.
|
I think your changes are intertwined with #604 |
| footer_actions = Children(default=[], doc=""" | ||
| A list of icon button objects to display in the action row | ||
| of the message footer, alongside the edit and copy icons.""") | ||
|
|
There was a problem hiding this comment.
Torn between having instantiated icon buttons or something like https://github.com/holoviz/panel/blob/main/panel/chat/interface.py#L122-L146
OR whether that's too complicated
There was a problem hiding this comment.
I think the Children approach is the right call here. The dict-based CallbackIcon pattern from Panel's ChatInterface works well for a fixed set of built-in actions, but for footer_actions the user is bringing their own widgets, so passing instantiated components gives them full control over styling, callbacks, toggle behavior, etc. without us having to design a config schema for every possible option.
It also stays consistent with how footer_objects and header_objects already work in ChatMessage.
Let me know if you'd prefer the dict approach though!
There was a problem hiding this comment.
So actions is a loaded term in panel-material-ui because Menu components do use it for the dictionary-like specification. So if we are calling it footer_action then I would lean to the dict approach.
Adds a new `footer_actions` Children parameter to ChatMessage that renders icon button objects in the action row before the edit and copy icons. This allows downstream libraries like Lumen AI to add custom action buttons (e.g. follow-up suggestion icons) that appear inline with the built-in message actions.
05ec50f to
da95e40
Compare
Yupp.. sorry for this, fixed it!! |
Add a lightbulb icon to message footer that populates the chat input with an AI-generated follow-up suggestion on click. Uses the cheapest 'ui' LLM spec for efficient generation. - Add FollowUpSuggestion model in models.py - Add suggest_followup() to Coordinator with llm_spec='ui' - Add follow_up_suggestions.jinja2 extending Actor/main.jinja2 - Add lightbulb icon to footer_actions (fallback to footer_objects) - Add follow_up_suggestions settings toggle - 14 tests (10 UI + 4 coordinator) + docs Depends on panel-extensions/panel-material-ui#605 for footer_actions.
Add a lightbulb icon to message footer that populates the chat input with an AI-generated follow-up suggestion on click. Uses the cheapest 'ui' LLM spec for efficient generation. - Add FollowUpSuggestion model in models.py - Add suggest_followup() to Coordinator with llm_spec='ui' - Add follow_up_suggestions.jinja2 extending Actor/main.jinja2 - Add lightbulb icon to footer_actions (fallback to footer_objects) - Add follow_up_suggestions settings toggle - 14 tests (10 UI + 4 coordinator) + docs Depends on panel-extensions/panel-material-ui#605 for footer_actions.
- Move footer_actions to render after copy, edit, and reaction icons - Add alignItems center to action row for consistent alignment - Add footer_actions parameter to ChatMessage reference notebook - Move IconButton import to top of test file - Update docstring to reflect new icon order

Description
Adds a
footer_actionsparameter toChatMessagethat lets downstream libraries place custom icon buttons in the message action row, before the built-in edit and copy icons.Companion PR: This is the upstream change needed for holoviz/lumen#1764 (Add follow-up suggestion chips after successful queries).
Motivation
While working on follow-up suggestion features for Lumen AI (holoviz/lumen#1764), I needed a way to add a small icon button (lightbulb) inline with the existing edit/copy icons below each message. The current
footer_objectsparameter renders below the action row, which looks visually disconnected.footer_actionsrenders inside the action row for a native, consistent look.What's new
footer_actionsChildrenparameter onChatMessage(Python)ChatMessage.jsxfooter_objectscontinues to work as beforeUsage
How Has This Been Tested?
footer_objectsstill works independentlyAI Disclosure
I identified the need for this parameter while integrating follow-up suggestions into Lumen AI. AI tools helped scaffold the implementation. I reviewed and tested all code manually.