Skip to content

Commit 9222d15

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 4bedfe2 + 45c7788 commit 9222d15

32 files changed

+1826
-98
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Bug report
2+
description: Report an issue with a chatbot component or interaction.
3+
title: "[Bug] - [short description]"
4+
type: bug
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please provide a clear way to reproduce the issue.
10+
11+
- type: textarea
12+
id: bug_description
13+
attributes:
14+
label: Description
15+
description: What is the current (incorrect) behavior?
16+
placeholder: e.g., "The message bubble overflows the container when a long URL is pasted."
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: reproduction_steps
22+
attributes:
23+
label: Steps to Reproduce
24+
placeholder: |
25+
1. Go to '...'
26+
2. Enter '...' in the chat input
27+
3. Observe the error
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: data_context
33+
attributes:
34+
label: Data/JSON Context (if applicable)
35+
description: Provide the message object or JSON that triggered the bug.
36+
placeholder: |
37+
{
38+
"role": "assistant",
39+
"content": "...",
40+
"metadata": { ... }
41+
}
42+
43+
- type: textarea
44+
id: environment
45+
attributes:
46+
label: Environment
47+
placeholder: |
48+
- PatternFly Chatbot Version:
49+
- Browser & Version:
50+
- Viewport size:
51+
validations:
52+
required: false
53+
54+
- type: textarea
55+
id: visuals
56+
attributes:
57+
label: Screenshots or Logs
58+
description: Drag and drop images or paste console errors here.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Chatbot Feature Request
2+
description: Suggest a new component or extension specifically for the PatternFly Chatbot library.
3+
title: "[Chatbot] - [short description]"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
### AI & Conversational UX Proposal
9+
Use this form for components like message bubbles, action footers, streaming indicators, or persona headers.
10+
11+
- type: dropdown
12+
id: chatbot_category
13+
attributes:
14+
label: Chatbot Component Area
15+
options:
16+
- Message Content (Text, Markdown, Citations)
17+
- Input/Action (Prompts, Attachments, Voice)
18+
- Layout (Chat Drawer, Header, Persona)
19+
- System (Loading, Error, Streaming)
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: description
25+
attributes:
26+
label: Describe the feature
27+
description: What is the specific chatbot interaction or UI component you are proposing?
28+
placeholder: e.g., "A source citation component that appears below assistant responses."
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: data_structure
34+
attributes:
35+
label: Expected Data Structure
36+
description: Chatbot components often rely on specific JSON or object shapes. How should the data be passed?
37+
placeholder: |
38+
e.g.,
39+
{
40+
"source_id": 1,
41+
"title": "Documentation",
42+
"url": "..."
43+
}
44+
validations:
45+
required: false
46+
47+
- type: textarea
48+
id: interaction_flow
49+
attributes:
50+
label: Conversational Flow
51+
description: How does this appear in the message stream? Does it support streaming?
52+
placeholder: |
53+
- Is it interactive (clickable)?
54+
- Does it appear only in Assistant or User messages?
55+
- How does it look while the message is still "typing" (streaming)?
56+
validations:
57+
required: false
58+
59+
- type: textarea
60+
id: visuals
61+
attributes:
62+
label: Visuals & Mockups
63+
description: Focus on how it integrates into the Chat Drawer or Window.
64+
placeholder: "Figma links or screenshots go here."
65+
66+
- type: textarea
67+
id: accessibility
68+
attributes:
69+
label: Conversational Accessibility
70+
description: Focus on screen reader announcements for new messages or state changes.
71+
placeholder: "e.g., Screen reader should announce when the 'Thought' block expands."
72+
73+
- type: checkboxes
74+
id: checklist
75+
attributes:
76+
label: Validation
77+
options:
78+
- label: This request aligns with PatternFly AI/Chatbot design guidelines.
79+
required: true
80+
- label: I have searched for existing chatbot-specific components.
81+
required: true

packages/module/patternfly-docs/content/extensions/chatbot/design-guidelines.md

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import "./images.css"
1616

1717
1. **Container:** The window that contains the entire ChatBot experience and all of its components.
1818
1. **Header:** A persistent region at the top of the ChatBot window that contains navigation, branding, and actions.
19-
1. **History menu:** A menu that contains a conversation history of previous chats.
19+
1. **Chat history menu:** A menu that contains a history of previous chats.
2020
1. **Options menu:** A menu that contains settings that are relevant to your product. This typically includes display options (more details in the [ChatBot variations section](#variations)) and other general settings (more details in the [ChatBot settings and preferences section](#chatbot-settings-and-preferences)).
2121
1. **Messages:** Elements of the conversation between a ChatBot and user. More details can be found in the [message guidelines](#messages).
2222
1. **Attachments:** Details about files that a user has uploaded to the ChatBot.
@@ -43,7 +43,7 @@ import "./images.css"
4343

4444
At the start of a new chat, you should welcome your users to the ChatBot with a greeting.
4545

46-
If you have user details from their account information, you can personalize this greeting with their username or name. If you don't have this information, or if you'd prefer to not use their personal details, you should instead introduce the ChatBot:
46+
As much as possible, the suggested prompts should consider the user’s location in the service or application, or the situation their project is undergoing. If you have user details from their account information, you can personalize this greeting with their username or name. If you don't have this information, or if you'd prefer to not use their personal details, you should instead introduce the ChatBot:
4747

4848
<div class="ws-docs-content-img">
4949
![Welcome messages.](./img/welcome-message.svg)
@@ -55,16 +55,44 @@ To help users get started quickly, it can also be helpful to include welcome pro
5555
![Welcome message with prompts.](./img/welcome-elements.svg)
5656
</div>
5757

58-
#### Source tiles
58+
#### Source cards
5959

60-
A ChatBot can share relevant sources with users, like documentation that could provide the information a user is searching for. These sources will be contained in a single tile, which users can paginate through and select to navigate to other resources.
60+
To share relevant resources with users, like documentation containing the answer to a user's question, you can use source cards.
6161

62-
To provide users with enough context, sources should have descriptive titles and descriptions. The title is limited to 1 line and the body is limited to 2 lines.
62+
<div class="ws-docs-content-img">
63+
![A white card below a message from a ChatBot. In the card is blue text for the title and black text for a short description. There are four pink annotation markers pointing to major sections of the image.](./img/source-card.svg)
64+
</div>
65+
66+
1. **Source count:** Notes the number of sources shared in a card.
67+
2. **Source card title:** Offers a concise, descriptive title of the source content to provide users with quick context about a source. Titles are limited to 1 line and should be truncated when the text overflows or wraps.
68+
3. **Source card description:** Offers a concise preview or summary of the source content. We recommend limiting the length to 2 lines to provide context without overcrowding the chat window.
69+
4. **Pagination:** Used to navigate through all options when there are multiple source cards provided. Not displayed when only 1 source is provided.
70+
71+
Instead of a short preview of the linked source's content, you can choose to summarize the contents and use that summary as your description. This is helpful for in-depth resources where the context is not clear from the beginning snippet. You can also choose to elevate a quote from the resource that is most relevant to the user's question.
6372

6473
<div class="ws-docs-content-img">
65-
![Bot message that include multiple source tiles.](./img/source-tile.svg)
74+
![A single source card is show below a chatbot message.](./img/source-card-summary.svg)
6675
</div>
6776

77+
While we generally recommend staying within 2 lines for your source description, you can choose to provide a "show more" button that allows users to expand and view a longer description. When using expandable descriptions, it is recommended to end the description at the end of the sentence. Use your best UX judgment here&mdash;extremely lengthy descriptions can quickly fill out the chat window and obstruct previous conversation details.
78+
79+
<div class="ws-docs-content-img">
80+
![A before and after image is shown. The before image shows a single source card below a chatbot message, with a blue link at the bottom that says "show more." In the after image, additional description lines are shown and the link now says "show less."](./img/source-card-expanded.svg)
81+
</div>
82+
83+
##### Custom source cards
84+
85+
You can create a custom source card by utilizing additional components that make sense for your use case. The source card's flexibility can be used in a number of ways, but the following example demonstrates how you might customize its appearance to provide additional details about a source.
86+
87+
<div class="ws-docs-content-img">
88+
![A source card, annotated with four pink markers. Each marker points to a unique point of the card: a light gray subtitle below the main card title, a filled, green label beneath the card body that is labeled with a confidence % score, a blue help link is to the right of the green label that says "learn about this score", and light gray text at the bottom of the card with the last updated date.](./img/custom-source-card.svg)
89+
</div>
90+
91+
1. **Subtitle:** Additional context about the resource, such as where the documentation is hosted.
92+
2. **Label:** A confidence score, to indicate the likelihood that a source contains relevant information for the user.
93+
3. **Link with popover:** Additional context about the confidence score label.
94+
4. **Date:** The last time the linked resource was updated.
95+
6896
#### Quick start tiles
6997

7098
A ChatBot can share a link to a [quick start](/extensions/quick-starts) that will help users complete a given task. Users can either select **Start** or the tile's title to initiate the linked quick start.
@@ -119,7 +147,7 @@ When users select either of these icons, you should present them with either:
119147
1. **Close button (optional):** Closes the feedback form. The original feedback response should still be collected.
120148
1. **Quick responses:** Options for users to provide more context around their rating. Customize these to make the most sense for your product. You can present positive and negative options based on the response type originally selected.
121149
1. **Text area (optional):** Allows users to provide additional written detail if they'd like.
122-
1. **Submit button:** Submits the feedback form and triggers the thank-you card.
150+
1. **Submit button:** Submits the feedback form and triggers the thank-you card.
123151

124152
### Message bar
125153

@@ -205,7 +233,7 @@ To help users further identify the toggle, add a "Launch ChatBot" tooltip. You c
205233
![Tooltips for ChatBot toggle.](./img/toggle-tooltips.svg)
206234
</div>
207235

208-
Whichever method you choose, it is critical to be consistent with the toggle location and refer to the following the additional guidelines for each.
236+
Whichever method you choose, it is critical to be consistent with the toggle location and refer to the following additional guidelines for each.
209237

210238
#### Floating toggle
211239
When users click the toggle, the ChatBot window opens and the toggle will change to display an "angle down" icon to indicate that clicking the toggle again will minimize the ChatBot. Users can select the toggle at any point in their journey to open and close the ChatBot as needed.
@@ -250,17 +278,27 @@ If a UI element within the page content is an AI/ChatBot-supported feature, the
250278
![Menu item for an AI action that launches a ChatBot.](./img/ai-action-inpage.svg)
251279
</div>
252280

253-
When a ChatBot is launches via an AI-supported action, the action should be sent as a user message once the ChatBot opens.
281+
When a ChatBot is launched via an AI-supported action, the action should be sent as a user message once the ChatBot opens.
254282

255283
<div class="ws-docs-content-img">
256284
![User message in ChatBot for an AI action command.](./img/ai-action-message.svg)
257285
</div>
258286

259-
### Starting a new conversation
287+
### Starting a new chat
288+
289+
Each time a user begins a new chat, display a [welcome message](#welcome-message), with prompts that provide initial suggestions and indicate the actions that the ChatBot can take.
290+
291+
The default approach for users to create a new chat is by clicking the "New chat" button (which contains a "pen to square" icon) placed at the top of the [chat history menu](#using-the-chat-history-menu).
260292

261-
Each time a user begins a new conversation, display a [welcome message, with prompts](#welcome-message) that help them learn what the ChatBot can help with.
293+
<div class="ws-docs-content-img">
294+
![A blue "New chat" button at the top right of a drawer labeled "Chat history".](./img/new-chat-in-nav.svg)
295+
</div>
296+
297+
Alternatively, you can choose to surface the "New chat" button as an icon button in the header. For this approach, the "pen to square" icon is displayed in the button and a "New chat" tooltip should appear on hover and focus.
262298

263-
As much as possible, the suggested prompts should consider the user’s location in the service or application, or the situation their project is undergoing.
299+
<div class="ws-docs-content-img">
300+
![An icon button is placed at the start of the ChatBot header, prior to a hamburger menu. It contains the visual of a pen placed within a square and is in a hover state, with a darker gray background and a black tooltip that says "New chat."](./img/starting-new-chat.svg)
301+
</div>
264302

265303
### Executing user requests
266304

@@ -272,23 +310,23 @@ This can be done using the [quick response](/extensions/chatbot/messages#message
272310
![Confirmation options from a bot in response to a user's request.](./img/quick-response-confirmation.svg)
273311
</div>
274312

275-
### Using the conversation history menu
313+
### Using the chat history menu
276314

277-
The ChatBot history menu contains a log of a users' previous chats. Clicking the menu icon opens a side drawer in the ChatBot window.
315+
The ChatBot history menu contains a log of a user's previous chats. Clicking the menu icon opens a side drawer in the ChatBot window.
278316

279317
By clicking into the history menu, users can search through previous conversations and perform additional actions, such as sharing a conversation with others.
280318

281319
<div class="ws-docs-content-img">
282320
![Conversation history with an options menu opened on a previous conversation.](./img/conversation-history.svg)
283321
</div>
284322

285-
When the conversation history is still loading, display skeleton items:
323+
When the chat history is still loading, display skeleton items:
286324

287325
<div class="ws-docs-content-img">
288326
![Chat history items loading.](./img/loading-state.svg)
289327
</div>
290328

291-
If there's an error loading the conversation history, display an error screen with steps for resolving the error:
329+
If there's an error loading the chat history, display an error screen with steps for resolving the error:
292330

293331
<div class="ws-docs-content-img">
294332
![Error state in chat history.](./img/error-state.svg)
@@ -349,9 +387,9 @@ For guidance, refer to our download transcripts demo, which opens a Markdown fil
349387

350388
Choose the download action location that best works for your ChatBot:
351389

352-
#### Download via conversation history drawer
390+
#### Download via chat history drawer
353391

354-
If your ChatBot uses a conversation history drawer, you can provide a download option in the [actions menu linked to a previous conversation](/extensions/chatbot/ui#drawer-with-conversation-actions).
392+
If your ChatBot uses a chat history drawer, you can provide a download option in the [actions menu linked to a previous conversation](/extensions/chatbot/ui#drawer-with-conversation-actions).
355393

356394
<div class="ws-docs-content-img">
357395
![Expanded menu for previous chat in the history window, which shows a download option.](./img/download-chat-history.svg)
@@ -367,7 +405,7 @@ To allow users to download individual bot messages, the message actions can incl
367405

368406
#### Download control in header
369407

370-
If you don't use a conversation history drawer, you can place an option to download the transcript for the active chat within the header options menu.
408+
If you don't use a chat history drawer, you can place an option to download the transcript for the active chat within the header options menu.
371409

372410
<div class="ws-docs-content-img">
373411
![Download transcript action within the ChatBot header options menu.](./img/download-header.svg)

packages/module/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ _Italic text, formatted with single underscores_
319319
hasRoundAvatar={false}
320320
/>
321321
<Message name="Bot" role="bot" content="This is a message from a bot with no avatar." />
322+
<Message
323+
name="Bot"
324+
role="bot"
325+
avatar={patternflyAvatar}
326+
isMetadataVisible={false}
327+
content="This is a message from a bot with metadata not visible."
328+
/>
322329
<Select
323330
id="single-select"
324331
isOpen={isOpen}

packages/module/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithDeepThinking.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,18 @@ export const MessageWithDeepThinkingExample: FunctionComponent = () => (
2727
body: "Here's why I said this."
2828
}}
2929
/>
30+
<Message
31+
name="Bot"
32+
role="bot"
33+
avatar={patternflyAvatar}
34+
content="This example has deep thinking that is loading:"
35+
deepThinking={{
36+
isDefaultExpanded: false,
37+
toggleContent: 'Show thinking',
38+
subheading: 'Thought for 3 seconds',
39+
body: "Here's why I said this.",
40+
isLoading: true
41+
}}
42+
/>
3043
</>
3144
);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { FunctionComponent } from 'react';
2+
3+
import Message from '@patternfly/chatbot/dist/dynamic/Message';
4+
import patternflyAvatar from './patternfly_avatar.jpg';
5+
6+
export const IconSwappingExample: FunctionComponent = () => (
7+
<Message
8+
name="Bot"
9+
role="bot"
10+
avatar={patternflyAvatar}
11+
content="Click the response actions to see the outlined icons swapped with the filled variants!"
12+
actions={{
13+
// eslint-disable-next-line no-console
14+
positive: { onClick: () => console.log('Good response') },
15+
// eslint-disable-next-line no-console
16+
negative: { onClick: () => console.log('Bad response') },
17+
// eslint-disable-next-line no-console
18+
copy: { onClick: () => console.log('Copied') }
19+
}}
20+
useFilledIconsOnClick
21+
/>
22+
);

0 commit comments

Comments
 (0)