Skip to content

Commit 8edce4d

Browse files
Merge pull request #818 from edonehoo/iss796
docs(chatbot): Updates docs to ensure chat history drawer is consistently named.
2 parents 45c7788 + 1ba4c28 commit 8edce4d

File tree

11 files changed

+88
-65
lines changed

11 files changed

+88
-65
lines changed

package-lock.json

Lines changed: 51 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Explore our documentation, which covers both the components you'll need to build
4040
- [Toggle](/extensions/chatbot/ui#toggle)
4141
- [Header](/extensions/chatbot/ui#header)
4242
- [Footer](/extensions/chatbot/ui#footer)
43-
- [Navigation](/extensions/chatbot/ui#navigation)
43+
- [Chat history drawer](/extensions/chatbot/ui#chat-history)
4444
- [Modals](/extensions/chatbot/ui#modals)
4545
- Messages: Components that customize features related to the conversation
4646
- [Bot and user messages](/extensions/chatbot/messages)

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import "./images.css"
1515
</div>
1616

1717
1. **Container:** The window that contains the entire ChatBot experience and all of its components.
18-
1. **Header:** A persistent region at the top of the ChatBot window that contains navigation, branding, and actions.
19-
1. **Chat history menu:** A menu that contains a history of previous chats.
18+
1. **Header:** A persistent region at the top of the ChatBot window that contains chat history, branding, and actions.
19+
1. **Chat history drawer:** A menu used to access 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.
@@ -288,7 +288,7 @@ When a ChatBot is launched via an AI-supported action, the action should be sent
288288

289289
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.
290290

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).
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 drawer](#using-the-chat-history-drawer).
292292

293293
<div class="ws-docs-content-img">
294294
![A blue "New chat" button at the top right of a drawer labeled "Chat history".](./img/new-chat-in-nav.svg)
@@ -310,14 +310,12 @@ This can be done using the [quick response](/extensions/chatbot/messages#message
310310
![Confirmation options from a bot in response to a user's request.](./img/quick-response-confirmation.svg)
311311
</div>
312312

313-
### Using the chat history menu
313+
### Using the chat history drawer
314314

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.
316-
317-
By clicking into the history menu, users can search through previous conversations and perform additional actions, such as sharing a conversation with others.
315+
The chat history drawer can be opened via the hamburger menu in the ChatBot header. In this drawer, users can search through previous conversations and perform additional actions, such as sharing a conversation with others.
318316

319317
<div class="ws-docs-content-img">
320-
![Conversation history with an options menu opened on a previous conversation.](./img/conversation-history.svg)
318+
![Chat history with an options menu opened on a previous conversation.](./img/conversation-history.svg)
321319
</div>
322320

323321
When the chat history is still loading, display skeleton items:
@@ -383,16 +381,16 @@ If a message attachment fails, an error message should share the reason for fail
383381

384382
You can enable users to download chat transcripts, for their personal records or to share with others. When users choose to download a transcript, you can choose how you want to configure the behavior in your ChatBot.
385383

386-
For guidance, refer to our download transcripts demo, which opens a Markdown file for a conversation within a new tab.
384+
For guidance, refer to our [chat transcripts demo](/extensions/chatbot/overview/demo#chat-transcripts), which opens a Markdown file for a conversation within a new tab.
387385

388386
Choose the download action location that best works for your ChatBot:
389387

390388
#### Download via chat history drawer
391389

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).
390+
If your ChatBot uses chat history, you can provide a download option in the [actions menu linked to a previous conversation](/extensions/chatbot/ui#drawer-with-conversation-actions).
393391

394392
<div class="ws-docs-content-img">
395-
![Expanded menu for previous chat in the history window, which shows a download option.](./img/download-chat-history.svg)
393+
![Expanded menu for previous chat in the chat history drawer, which shows a download option.](./img/download-chat-history.svg)
396394
</div>
397395

398396
#### Download message response action
@@ -405,7 +403,7 @@ To allow users to download individual bot messages, the message actions can incl
405403

406404
#### Download control in header
407405

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.
406+
If you don't use chat history, you can place an option to download the transcript for the active chat within the header options menu.
409407

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

packages/module/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const BasicDemo: FunctionComponent = () => {
8080
showAll && setShowAll(!showAll);
8181
}}
8282
name="basic-inline-radio"
83-
label="With menu"
83+
label="With chat history drawer"
8484
id="menu"
8585
/>
8686
<Checkbox

packages/module/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ The ChatBot header is persistent, and contains the title for the ChatBot window,
189189

190190
The `<ChatbotHeader>` has 2 sections:
191191

192-
- `<ChatbotHeaderMain>` contains the title and an optional menu toggle or new chat button:
192+
- `<ChatbotHeaderMain>` contains the title and an optional hamburger menu toggle or new chat button:
193193
- `<ChatbotHeaderTitle>` handles the layout and display of a title or image at different responsive sizes.
194-
- `<ChatbotHeaderMenu>` (optional) is placed on the left side of the header and used to toggle a chat history menu.
194+
- `<ChatbotHeaderMenu>` (optional) is placed on the left side of the header and used to toggle a chat history drawer.
195195
- `<ChatbotHeaderNewChatButton>` (optional) is placed on the left side of the header and used to initiate a new chat.
196196
- `<ChatbotHeaderActions>` contains any additional controls:
197197
- The `<ChatbotHeaderSelectorDropdown>` component is a standard PatternFly dropdown that matches the ChatBot styles.
@@ -227,8 +227,8 @@ There are a variety of options and customizations you can make to the header, to
227227

228228
In this example, select the respective checkbox to toggle these features:
229229

230-
- **Menu:** Users can select the menu toggle to open a menu of additional options or actions.
231-
- **New chat button:** Used to start a new chat session. The header button can be used in addition to or in place of a new chat button within the [conversation history drawer](/extensions/chatbot/ui/#drawer-with-search-and-new-chat-button).
230+
- **Chat history drawer:** Users can select the hamburger menu toggle to open the [chat history drawer](#chat-history).
231+
- **New chat button:** Used to start a new chat session. The header button can be used in addition to or in place of a new chat button within the [chat history drawer](/extensions/chatbot/ui/#drawer-with-search-and-new-chat-button).
232232
- **Left-aligned logo**
233233
- **Centered logo**
234234
- **Selector dropdown:** Users can choose from preselected options in a dropdown menu. For example, they can toggle between AI models.
@@ -339,11 +339,11 @@ This example shows a simplified method of handling the "thinking" animation: aft
339339

340340
```
341341

342-
## Navigation
342+
## Chat history
343343

344-
### Side nav in a drawer
344+
### Chat history drawer
345345

346-
The ChatBot conversation history is contained in an interactive drawer, where users can interact with previous conversations or start a new conversation.
346+
A user's chat history is contained in an interactive drawer, where they can interact with previous conversations or start a new conversation.
347347

348348
The `<ChatbotConversationHistoryNav>` component is a wrapper placed within `<Chatbot>`, which contains all other ChatBot components in `drawerContent`. There is a focus trap so users can only tab within the drawer while it is open.
349349

@@ -367,14 +367,14 @@ The code structure will look like this:
367367
</Chatbot>
368368
```
369369

370-
The conversation history drawer looks different depending on the `displayMode` of the parent `<Chatbot>`. (As shown in the [main ChatBot demo](/extensions/chatbot/overview/demo#basic-chatbot).):
370+
The chat history drawer looks different depending on the `displayMode` of the parent `<Chatbot>` (as shown in the [main ChatBot demo](/extensions/chatbot/overview/demo#basic-chatbot).):
371371

372-
- `Default` and `docked` display modes display the conversation history on top of the rest of the ChatBot content, with a PatternFly backdrop between the drawer panel and drawer content.
373-
- `Fullscreen` and `embedded` display modes display the conversation history in line with the drawer content.
372+
- `Default` and `docked` display modes display the chat history on top of the rest of the ChatBot content, with a PatternFly backdrop between the drawer panel and drawer content.
373+
- `Fullscreen` and `embedded` display modes display the chat history in line with the drawer content.
374374

375375
### Drawer with search and "new chat" button
376376

377-
In the conversation history drawer, users can search previous ChatBot conversations via an input field. To customize the placeholder text, use `searchInputPlaceholder`. Provide an aria label via `searchInputAriaLabel`.
377+
In the chat history drawer, users can search previous ChatBot conversations via an input field. To customize the placeholder text, use `searchInputPlaceholder`. Provide an aria label via `searchInputAriaLabel`.
378378

379379
They can also start new conversations via a "New chat" button. To customize the button label, use `newChatButtonText`.
380380

@@ -386,7 +386,7 @@ Both the search input field and "New chat" buttons are optional. The `reverseBut
386386

387387
### Drawer with search actions
388388

389-
You can customize the search experience within the conversation history drawer via the `searchActionStart` and `searchActionEnd` props, which provide additional search controls before and after the input field. These props are useful for adding filtering, sorting, or other search-related functionality.
389+
You can customize the search experience within the chat history drawer via the `searchActionStart` and `searchActionEnd` props, which provide additional search controls before and after the input field. These props are useful for adding filtering, sorting, or other search-related functionality.
390390

391391
You can also add a visual divider between the drawer head and the title by setting `hasDrawerHeadDivider` to `true`.
392392

@@ -404,15 +404,15 @@ Actions can be added to conversations with `menuItems`. Optionally, you can also
404404

405405
### Pinning conversations
406406

407-
To help users track important conversations, add a "pin" option to the conversation action menus. This action moves a conversation to a dedicated "pinned" section at the top of the history drawer for quick access. Pinned items should contain an "unpin" option, so that users can remove pinned conversations as needed.
407+
To help users track important conversations, add a "pin" option to the conversation action menus. This action moves a conversation to a dedicated "pinned" section at the top of the chat history drawer for quick access. Pinned items should contain an "unpin" option, so that users can remove pinned conversations as needed.
408408

409409
```js file="./ChatbotHeaderDrawerWithPin.tsx"
410410

411411
```
412412

413-
### Renaming conversations in history drawer
413+
### Renaming conversations in chat history drawer
414414

415-
You can allow users to rename a conversation in the history drawer by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:
415+
You can allow users to rename a conversation in the chat history drawer by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:
416416

417417
- When the modal opens, focus is placed at the end of the text input.
418418
- When the modal closes, focus goes back to the action toggle that was previously opened.
@@ -433,7 +433,7 @@ If you're showing a conversation that is already active, you can set the `active
433433

434434
### Resizable drawer
435435

436-
By default, the conversation history drawer has a fixed width (384px) and a focus trap. To provide users with more flexibility as they navigate their conversation history, or to better support embedded ChatBots on tablet-sized devices or smaller browser windows, you can instead make the drawer resizable. By default, even resizable drawers will still open to their full width on mobile devices.
436+
By default, the chat history drawer has a fixed width (384px) and a focus trap. To provide users with more flexibility as they navigate their chat history, or to better support embedded ChatBots on tablet-sized devices or smaller browser windows, you can instead make the drawer resizable. By default, even resizable drawers will still open to their full width on mobile devices.
437437

438438
In this example, the drawer can be resized up to the max size of the parent and resized down to 200px wide. To customize this behavior further (including width, style, and focus behavior) use PatternFly [`<Drawer>` props](/components/drawer#props), [`<DrawerPanelContent>` props](/components/drawer/#drawerpanelcontent), or any other drawer subcomponents.
439439

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ This demo displays a basic ChatBot, which includes:
9595
- Sending a message to the ChatBot.
9696
- Receiving a response from a backend AI tool with a loading message state.
9797

98-
6. A [`<ChatbotConversationHistoryNav>`](/extensions/chatbot/ui#navigation) toggled open and closed by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
98+
6. A [`<ChatbotConversationHistoryNav>`](/extensions/chatbot/ui#chat-history) toggled open and closed by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
9999

100100
7. A "Skip to chatbot" button that allows you to skip to the chatbot content via the [PatternFly skip to content component](/extensions/chatbot/ui#skip-to-content). To display this button you must tab into the main window.
101101

@@ -126,7 +126,7 @@ This demo displays an embedded ChatBot. Embedded ChatBots are meant to be placed
126126
- [Speech to text.](/extensions/chatbot/ui#message-bar-with-speech-recognition-and-file-attachment)
127127
- Sending a message to the ChatBot.
128128
- Receiving a response from a backend AI tool with a loading message state.
129-
6. A [`<ChatbotConversationHistoryNav>`](/extensions/chatbot/ui#navigation) that can be toggled by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
129+
6. A [`<ChatbotConversationHistoryNav>`](/extensions/chatbot/ui#chat-history) that can be toggled by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
130130

131131
```js file="./EmbeddedChatbot.tsx" isFullscreen
132132

@@ -196,7 +196,7 @@ This demo illustrates how you could add downloadable transcripts to your ChatBot
196196

197197
A message transcript includes details from a single chat message. To download a sample message transcript in this demo, click the "Download" action under a bot message.
198198

199-
A conversation transcript includes details from the entirety of a ChatBot conversation. To download a sample conversation transcript in this demo, open the chat history menu and click "Download" in the options menu for the conversation.
199+
A conversation transcript includes details from the entirety of a ChatBot conversation. To download a sample conversation transcript in this demo, open the chat history drawer and click "Download" in the options menu for the conversation.
200200

201201
In this example, file download is implemented with [file-saver](https://www.npmjs.com/package/file-saver).
202202

packages/module/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ describe('ChatbotConversationHistoryNav', () => {
307307
isLoading
308308
/>
309309
);
310-
expect(screen.getByRole('dialog', { name: /Loading chatbot conversation history/i })).toBeTruthy();
310+
expect(screen.getByRole('dialog', { name: /Loading chatbot chat history/i })).toBeTruthy();
311311
expect(screen.getByRole('button', { name: /Close drawer panel/i })).toBeTruthy();
312312
});
313313

packages/module/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface ChatbotConversationHistoryNavProps extends DrawerProps {
8484
activeItemId?: string | number;
8585
/** Callback function for when an item is selected */
8686
onSelectActiveItem?: (event?: React.MouseEvent, itemId?: string | number) => void;
87-
/** Items shown in conversation history */
87+
/** Items shown in chat history */
8888
conversations: Conversation[] | { [key: string]: Conversation[] };
8989
/** Additional button props for new chat button. */
9090
newChatButtonProps?: ButtonProps;

packages/module/src/ChatbotConversationHistoryNav/LoadingState.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ import type { FunctionComponent } from 'react';
44
export const LoadingState: FunctionComponent<SkeletonProps> = ({ screenreaderText, ...rest }: SkeletonProps) => (
55
<div className="pf-chatbot__history-loading">
66
<div className="pf-chatbot__history-loading-block">
7-
<Skeleton
8-
screenreaderText={screenreaderText ?? 'Loading chatbot conversation history'}
9-
fontSize="3xl"
10-
{...rest}
11-
/>
7+
<Skeleton screenreaderText={screenreaderText ?? 'Loading chatbot chat history'} fontSize="3xl" {...rest} />
128
</div>
139
<div className="pf-chatbot__history-loading-block">
1410
<Skeleton fontSize="sm" width="70%" {...rest} />

packages/module/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('ChatbotHeaderMenu', () => {
1212
it('should call onMenuToggle when ChatbotHeaderMenu button is clicked', () => {
1313
const onMenuToggle = jest.fn();
1414
render(<ChatbotHeaderMenu className="custom-header-menu" onMenuToggle={onMenuToggle} />);
15-
fireEvent.click(screen.getByRole('button', { name: 'Chat history menu' }));
15+
fireEvent.click(screen.getByRole('button', { name: 'Chat history drawer' }));
1616

1717
expect(onMenuToggle).toHaveBeenCalled();
1818
});

0 commit comments

Comments
 (0)