Skip to content

Commit 1ea054e

Browse files
robertwildespliffone
authored andcommitted
docs(ai-chat): change action buttons
1 parent 95424a2 commit 1ea054e

14 files changed

Lines changed: 194 additions & 122 deletions
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

playwright/snapshots/static.spec.ts-snapshots/si-chat-messages--si-ai-message.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
- listitem: First item
1111
- listitem: Second item
1212
- button "Good response"
13+
- button "Bad response"
1314
- button "Copy response"
14-
- button "Retry response"
1515
- button "More actions"
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

playwright/snapshots/static.spec.ts-snapshots/si-chat-messages--si-chat-container.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@
77
- button "Export message"
88
- paragraph: I'd be happy to help you analyze your files! I can see you've shared a Python script and a CSV dataset.
99
- paragraph: Let me examine the structure and provide guidance.
10-
- button "Add to list"
11-
- button "Export response"
12-
- button "Retry response"
10+
- button "Good response"
11+
- button "Bad response"
12+
- button "Copy response"
1313
- button "More actions"
1414
- paragraph: Perfect! What should I focus on first
1515
- paragraph: I also want to make sure the performance is optimized for large datasets since this will be used in production with potentially millions of rows?
1616
- button "Export message"
1717
- paragraph: Great question! When analyzing large datasets, it's crucial to focus on...
18+
- button "Good response"
19+
- button "Bad response"
20+
- button "Copy response"
21+
- button "More actions"
1822
- alert: Info AI responses are for demonstration purposes.
1923
- group:
2024
- text: requirements.pdf
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

playwright/snapshots/static.spec.ts-snapshots/si-chat-messages--si-chat-message.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
- text: Can you help me with this
55
- strong: code snippet
66
- text: "? I'm getting an error when I run it."
7-
- button "Copy"
8-
- button "Edit"
9-
- button "More actions"
7+
- group:
8+
- button "Copy"
9+
- button "Edit"
10+
- button "More actions"
1011
- text: JD Thanks for the help! That worked perfectly.
11-
- button "Copy"
12-
- button "Edit"
12+
- group:
13+
- button "Copy"
14+
- button "Edit"
1315
- group: error-log.txt
1416
- group: screenshot.png

src/app/examples/si-chat-messages/si-ai-message.ts

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
*/
55
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
66
import { DomSanitizer } from '@angular/platform-browser';
7+
import {
8+
elementBookmark,
9+
elementCopy,
10+
elementRefresh,
11+
elementShare,
12+
elementThumbsDown,
13+
elementThumbsUp
14+
} from '@siemens/element-icons';
715
import { MessageAction, SiAiMessageComponent } from '@siemens/element-ng/chat-messages';
16+
import { addIcons } from '@siemens/element-ng/icon';
817
import { getMarkdownRenderer } from '@siemens/element-ng/markdown-renderer';
918
import { MenuItemAction } from '@siemens/element-ng/menu';
1019
import { LOG_EVENT } from '@siemens/live-preview';
@@ -21,6 +30,15 @@ export class SampleComponent {
2130

2231
protected markdownRenderer = getMarkdownRenderer(this.sanitizer);
2332

33+
protected readonly icons = addIcons({
34+
elementThumbsUp,
35+
elementThumbsDown,
36+
elementCopy,
37+
elementRefresh,
38+
elementBookmark,
39+
elementShare
40+
});
41+
2442
content = `Here's a **simple response** with basic formatting.
2543
2644
You can use \`inline code\` and create lists:
@@ -31,32 +49,38 @@ You can use \`inline code\` and create lists:
3149
actions: MessageAction[] = [
3250
{
3351
label: 'Good response',
34-
icon: 'element-plus',
52+
icon: this.icons.elementThumbsUp,
3553
action: (messageId: string) => this.logEvent(`Thumbs up for message ${messageId}`)
3654
},
3755
{
38-
label: 'Copy response',
39-
icon: 'element-export',
40-
action: (messageId: string) => this.logEvent(`Copy message ${messageId}`)
56+
label: 'Bad response',
57+
icon: this.icons.elementThumbsDown,
58+
action: (messageId: string) => this.logEvent(`Thumbs down for message ${messageId}`)
4159
},
4260
{
43-
label: 'Retry response',
44-
icon: 'element-refresh',
45-
action: (messageId: string) => this.logEvent(`Retry message ${messageId}`)
61+
label: 'Copy response',
62+
icon: this.icons.elementCopy,
63+
action: (messageId: string) => this.logEvent(`Copy message ${messageId}`)
4664
}
4765
];
4866

4967
secondaryActions: MenuItemAction[] = [
68+
{
69+
type: 'action',
70+
label: 'Retry response',
71+
icon: this.icons.elementRefresh,
72+
action: (messageId: string) => this.logEvent(`Retry message ${messageId}`)
73+
},
5074
{
5175
type: 'action',
5276
label: 'Bookmark',
53-
icon: 'element-bookmark',
77+
icon: this.icons.elementBookmark,
5478
action: (messageId: string) => this.logEvent(`Bookmark message ${messageId}`)
5579
},
5680
{
5781
type: 'action',
5882
label: 'Share',
59-
icon: 'element-share',
83+
icon: this.icons.elementShare,
6084
action: (messageId: string) => this.logEvent(`Share message ${messageId}`)
6185
}
6286
];

0 commit comments

Comments
 (0)