You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
content="This message contains multiple action groups, each with their own selection persistence: \n1. Feedback actions (thumbs up/down) with persistent selections \n2. Utility actions (copy, download) with non-persistent selections \n3. Listen action with persistent selection"
Copy file name to clipboardExpand all lines: packages/module/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,24 @@ When `persistActionSelection` is `true`:
122
122
123
123
```
124
124
125
+
### Multiple messsage action groups
126
+
127
+
To maintain finer control over message action selection behavior, you can create groups of actions by passing an array of objects to the `actions` prop. This allows you to separate actions into conceptually or functionally different groups and implement different behavior for each group as needed. For example, you could separate feedback actions (thumbs up/down) form utility actions (copy and download), and have different selection behaviors for each group.
128
+
129
+
To provide flexibility for your use case, there are 2 approaches you can take to pass an array of objects to `actions`:
130
+
131
+
1. Pass an array of objects, where each object contains:
132
+
133
+
-`actions`: An `action` object containing the actions for that group (the same format as a single `action` object)
134
+
135
+
-`persistActionSelection` (optional): A boolean to control whether selections persists for this specific group
136
+
137
+
2. Pass an array of `action` objects (the same format as a single `action` object) and (optionally) a value for the `persistActionSelection` property that will apply to all groups.
Beyond the standard message actions (good response, bad response, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations:
0 commit comments