Skip to content

Commit 6652dc8

Browse files
authored
Merge pull request #212 from rebeccaalpert/screenshots
Update screenshots and deprecate default avatars in examples
2 parents a0c2270 + 80e1916 commit 6652dc8

21 files changed

+58
-18
lines changed

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/ChatbotMessage/BotMessage.tsx

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
32
import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
3+
import patternflyAvatar from './patternfly_avatar.jpg';
44

55
export const AttachmentMenuExample: React.FunctionComponent = () => {
66
const markdown = `
@@ -35,9 +35,15 @@ export default MessageLoading;
3535
`;
3636
return (
3737
<>
38-
<Message name="Bot" role="bot" content="Example content with updated timestamp text" timestamp="1 hour ago" />
39-
<Message name="Bot" role="bot" content={markdown} />
40-
<Message name="Bot" role="bot" content="Example content" isLoading />
38+
<Message
39+
name="Bot"
40+
role="bot"
41+
avatar={patternflyAvatar}
42+
content="Example content with updated timestamp text"
43+
timestamp="1 hour ago"
44+
/>
45+
<Message name="Bot" role="bot" avatar={patternflyAvatar} content={markdown} />
46+
<Message name="Bot" role="bot" avatar={patternflyAvatar} content="Example content" isLoading />
4147
</>
4248
);
4349
};

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/ChatbotMessage/ChatbotMessage.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
2222
import PreviewAttachment from '@patternfly/virtual-assistant/dist/dynamic/PreviewAttachment';
2323
import AttachmentEdit from '@patternfly/virtual-assistant/dist/dynamic/AttachmentEdit';
2424
import SourcesCard from '@patternfly/virtual-assistant/dist/dynamic/SourcesCard';
25-
import customImage from './custom_user_img.jpeg';
2625
import { RobotIcon } from '@patternfly/react-icons/dist/esm/icons/robot-icon';
26+
import patternflyAvatar from './patternfly_avatar.jpg';
27+
import userAvatar from './user_avatar.jpg';
2728

2829
The `content` prop of the `<Message>` component is passed to a `<Markdown>` component (from [react-markdown](https://remarkjs.github.io/react-markdown/)), which is configured to translate plain text strings into PatternFly [`<Content>` components](/components/content) and code blocks into PatternFly [`<CodeBlock>` components.](/components/code-block)
2930

@@ -77,7 +78,7 @@ You can add actions to a message, to allow users to interact with the message co
7778

7879
### Messages with sources
7980

80-
If you are using Retrieval-Augmented Generation, you may want to display sources in a message. Passing `sources` to `<Message>` allows you to paginate between the sources you provide.
81+
If you are using Retrieval-Augmented Generation, you may want to display sources in a message. Passing `sources` to `<Message>` allows you to paginate between the sources you provide.
8182

8283
The API for a source requires a link at minimum, but we strongly recommend providing a more descriptive title and body description so users have enough context. The title is limited to 1 line and the body is limited to 2 lines.
8384

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/ChatbotMessage/MessageWithAttachment.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
44
import PreviewAttachment from '@patternfly/virtual-assistant/dist/dynamic/PreviewAttachment';
55
import AttachmentEdit from '@patternfly/virtual-assistant/dist/dynamic/AttachmentEdit';
6+
import userAvatar from './user_avatar.jpg';
67

78
export const AttachmentMenuExample: React.FunctionComponent = () => {
89
const [isPreviewModalOpen, setIsPreviewModalOpen] = React.useState<boolean>(false);
@@ -14,6 +15,7 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
1415
<Message
1516
name="User"
1617
role="user"
18+
avatar={userAvatar}
1719
content="Here is an uploaded file"
1820
attachmentName="auth-operator.yml"
1921
attachmentId="1"

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/ChatbotMessage/MessageWithResponseActions.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react';
22

33
import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
4+
import patternflyAvatar from './patternfly_avatar.jpg';
45

56
export const AttachmentMenuExample: React.FunctionComponent = () => (
67
<Message
78
name="Bot"
89
role="bot"
10+
avatar={patternflyAvatar}
911
content="Example content with updated timestamp text"
1012
timestamp="1 hour ago"
1113
actions={{

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/ChatbotMessage/MessageWithSources.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
32
import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
3+
import patternflyAvatar from './patternfly_avatar.jpg';
44

55
export const AttachmentMenuExample: React.FunctionComponent = () => {
66
const onSetPage = (_event: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPage: number) => {
@@ -13,6 +13,7 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
1313
<Message
1414
name="Bot"
1515
role="bot"
16+
avatar={patternflyAvatar}
1617
content="Example with sources"
1718
sources={{
1819
sources: [
@@ -38,6 +39,7 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
3839
<Message
3940
name="Bot"
4041
role="bot"
42+
avatar={patternflyAvatar}
4143
content="Example with very long sources"
4244
sources={{
4345
sources: [
@@ -58,6 +60,7 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
5860
<Message
5961
name="Bot"
6062
role="bot"
63+
avatar={patternflyAvatar}
6164
content="Example with only one source"
6265
sources={{
6366
sources: [
@@ -73,6 +76,7 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
7376
<Message
7477
name="Bot"
7578
role="bot"
79+
avatar={patternflyAvatar}
7680
content="Example with sources that include a title and link"
7781
sources={{
7882
sources: [
@@ -92,6 +96,7 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
9296
<Message
9397
name="Bot"
9498
role="bot"
99+
avatar={patternflyAvatar}
95100
content="Example with link-only sources (not recommended)"
96101
sources={{
97102
sources: [

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/ChatbotMessage/UserMessage.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
4-
import customImage from './custom_user_img.jpeg';
4+
import userAvatar from './user_avatar.jpg';
55

66
export const AttachmentMenuExample: React.FunctionComponent = () => {
77
const markdown = `A paragraph with *emphasis* and **strong importance**.
@@ -15,11 +15,11 @@ Here is an inline code - \`() => void\``;
1515
<Message
1616
name="User"
1717
role="user"
18-
content="Example content with custom avatar image and updated timestamp text"
18+
content="Example content with updated timestamp text"
1919
timestamp="1 hour ago"
20-
avatar={customImage}
20+
avatar={userAvatar}
2121
/>
22-
<Message name="User" role="user" content={markdown} />
22+
<Message name="User" role="user" content={markdown} avatar={userAvatar} />
2323
</>
2424
);
2525
};

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/AttachmentDemos.md

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ import OpenDrawerRightIcon from '@patternfly/react-icons/dist/esm/icons/open-dra
4242
import OutlinedWindowRestoreIcon from '@patternfly/react-icons/dist/esm/icons/outlined-window-restore-icon';
4343
import PFIconLogoColor from '../ChatbotHeader/PF-IconLogo-Color.svg';
4444
import PFIconLogoReverse from '../ChatbotHeader/PF-IconLogo-Reverse.svg';
45+
import userAvatar from '../ChatbotMessage/user_avatar.jpg';
46+
import patternflyAvatar from '../ChatbotMessage/patternfly_avatar.jpg';
4547

4648
# Demos
4749

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

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ import PFHorizontalLogoColor from '../ChatbotHeader/PF-HorizontalLogo-Color.svg'
5353
import PFHorizontalLogoReverse from '../ChatbotHeader/PF-HorizontalLogo-Reverse.svg';
5454
import PFIconLogoColor from '../ChatbotHeader/PF-IconLogo-Color.svg';
5555
import PFIconLogoReverse from '../ChatbotHeader/PF-IconLogo-Reverse.svg';
56+
import userAvatar from '../ChatbotMessage/user_avatar.jpg';
57+
import patternflyAvatar from '../ChatbotMessage/patternfly_avatar.jpg';
5658

5759
### Basic chatbot
5860

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/Chatbot.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import PFHorizontalLogoColor from '../ChatbotHeader/PF-HorizontalLogo-Color.svg'
3030
import PFHorizontalLogoReverse from '../ChatbotHeader/PF-HorizontalLogo-Reverse.svg';
3131
import PFIconLogoColor from '../ChatbotHeader/PF-IconLogo-Color.svg';
3232
import PFIconLogoReverse from '../ChatbotHeader/PF-IconLogo-Reverse.svg';
33+
import userAvatar from '../ChatbotMessage/user_avatar.jpg';
34+
import patternflyAvatar from '../ChatbotMessage/patternfly_avatar.jpg';
3335

3436
const footnoteProps = {
3537
label: 'Lightspeed uses AI. Check for mistakes.',
@@ -93,12 +95,14 @@ const initialMessages: MessageProps[] = [
9395
{
9496
role: 'user',
9597
content: 'Hello, can you give me an example of what you can do?',
96-
name: 'User'
98+
name: 'User',
99+
avatar: userAvatar
97100
},
98101
{
99102
role: 'bot',
100103
content: markdown,
101104
name: 'Bot',
105+
avatar: patternflyAvatar,
102106
actions: {
103107
// eslint-disable-next-line no-console
104108
positive: { onClick: () => console.log('Good response') },
@@ -191,12 +195,13 @@ export const ChatbotDemo: React.FunctionComponent = () => {
191195
// we can't use structuredClone since messages contains functions, but we can't mutate
192196
// items that are going into state or the UI won't update correctly
193197
messages.forEach((message) => newMessages.push(message));
194-
newMessages.push({ role: 'user', content: message, name: 'User' });
198+
newMessages.push({ role: 'user', content: message, name: 'User', avatar: userAvatar });
195199
newMessages.push({
196200
role: 'bot',
197201
content: 'API response goes here',
198202
name: 'bot',
199-
isLoading: true
203+
isLoading: true,
204+
avatar: patternflyAvatar
200205
});
201206
setMessages(newMessages);
202207

@@ -212,6 +217,7 @@ export const ChatbotDemo: React.FunctionComponent = () => {
212217
content: 'API response goes here',
213218
name: 'bot',
214219
isLoading: false,
220+
avatar: patternflyAvatar,
215221
actions: {
216222
// eslint-disable-next-line no-console
217223
positive: { onClick: () => console.log('Good response') },

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/ChatbotAttachment.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import PFHorizontalLogoColor from '../ChatbotHeader/PF-HorizontalLogo-Color.svg'
2727
import PFHorizontalLogoReverse from '../ChatbotHeader/PF-HorizontalLogo-Reverse.svg';
2828
import PFIconLogoColor from '../ChatbotHeader/PF-IconLogo-Color.svg';
2929
import PFIconLogoReverse from '../ChatbotHeader/PF-IconLogo-Reverse.svg';
30+
import userAvatar from '../ChatbotMessage/user_avatar.jpg';
31+
import patternflyAvatar from '../ChatbotMessage/patternfly_avatar.jpg';
3032

3133
interface ModalData {
3234
code: string;
@@ -51,6 +53,7 @@ export const BasicDemo: React.FunctionComponent = () => {
5153
role: 'user',
5254
content: "I'm referring to this attachment for added context in our conversation.",
5355
name: 'User',
56+
avatar: userAvatar,
5457
attachmentName: 'auth-operator.yml',
5558
attachmentId: '1',
5659
onAttachmentClose,
@@ -63,6 +66,7 @@ export const BasicDemo: React.FunctionComponent = () => {
6366
{
6467
role: 'bot',
6568
content: 'Great, I can reference this attachment throughout our conversation.',
69+
avatar: patternflyAvatar,
6670
name: 'Bot'
6771
}
6872
];

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/ChatbotAttachmentMenu.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { Divider, DropdownGroup, DropdownItem, DropdownList, DropEvent } from '@
1414
import FileDetailsLabel from '@patternfly/virtual-assistant/dist/dynamic/FileDetailsLabel';
1515
import { BellIcon, CalendarAltIcon, ClipboardIcon, CodeIcon, UploadIcon } from '@patternfly/react-icons';
1616
import { useDropzone } from 'react-dropzone';
17+
import userAvatar from '../ChatbotMessage/user_avatar.jpg';
18+
import patternflyAvatar from '../ChatbotMessage/patternfly_avatar.jpg';
1719

1820
const initialMenuItems = [
1921
<DropdownList key="list-1">
@@ -68,12 +70,14 @@ const messages: MessageProps[] = [
6870
{
6971
role: 'user',
7072
content: 'Hello, can you give me an example of what you can do?',
71-
name: 'User'
73+
name: 'User',
74+
avatar: userAvatar
7275
},
7376
{
7477
role: 'bot',
7578
content: 'I sure can!',
76-
name: 'Bot'
79+
name: 'Bot',
80+
avatar: patternflyAvatar
7781
}
7882
];
7983

packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/EmbeddedChatbot.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ import ChatbotHeader, {
3737
import PFHorizontalLogoColor from '../ChatbotHeader/PF-HorizontalLogo-Color.svg';
3838
import PFHorizontalLogoReverse from '../ChatbotHeader/PF-HorizontalLogo-Reverse.svg';
3939
import { BarsIcon } from '@patternfly/react-icons';
40+
import userAvatar from '../ChatbotMessage/user_avatar.jpg';
41+
import patternflyAvatar from '../ChatbotMessage/patternfly_avatar.jpg';
4042

4143
const footnoteProps = {
4244
label: 'Lightspeed uses AI. Check for mistakes.',
@@ -100,12 +102,14 @@ const initialMessages: MessageProps[] = [
100102
{
101103
role: 'user',
102104
content: 'Hello, can you give me an example of what you can do?',
103-
name: 'User'
105+
name: 'User',
106+
avatar: userAvatar
104107
},
105108
{
106109
role: 'bot',
107110
content: markdown,
108111
name: 'Bot',
112+
avatar: patternflyAvatar,
109113
actions: {
110114
// eslint-disable-next-line no-console
111115
positive: { onClick: () => console.log('Good response') },
@@ -190,11 +194,12 @@ export const EmbeddedChatbotDemo: React.FunctionComponent = () => {
190194
// we can't use structuredClone since messages contains functions, but we can't mutate
191195
// items that are going into state or the UI won't update correctly
192196
messages.forEach((message) => newMessages.push(message));
193-
newMessages.push({ role: 'user', content: message, name: 'User' });
197+
newMessages.push({ role: 'user', content: message, name: 'User', avatar: userAvatar });
194198
newMessages.push({
195199
role: 'bot',
196200
content: 'API response goes here',
197201
name: 'bot',
202+
avatar: patternflyAvatar,
198203
isLoading: true
199204
});
200205
setMessages(newMessages);
@@ -210,6 +215,7 @@ export const EmbeddedChatbotDemo: React.FunctionComponent = () => {
210215
role: 'bot',
211216
content: 'API response goes here',
212217
name: 'bot',
218+
avatar: patternflyAvatar,
213219
isLoading: false,
214220
actions: {
215221
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)