Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluent: allow displaying feedback inside activity actions toolbar #5407

Merged
merged 13 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -74,6 +74,10 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- Added support for math blocks using `$$` delimiter alongside existing `\[...\]` and `\(...\)` notations, in PR [#5381](https://github.com/microsoft/BotFramework-WebChat/pull/5381), by [@OEvgeny](https://github.com/OEvgeny)
- Added support for speech recognition initial silence timeout when using Azure Speech, in PR [#5400](https://github.com/microsoft/BotFramework/WebChat/pull/5400), by [@compulim](https://github.com/compulim)
- Introduced syntax highlighting for markdown code blocks, in PR [#5389](https://github.com/microsoft/BotFramework-WebChat/pull/5389), by [@OEvgeny](https://github.com/OEvgeny)
- (Experimental) Added `feedbackActionsPlacement` style option to control feedback button placement, in PR [#5407](https://github.com/microsoft/BotFramework-WebChat/pull/5407), by [@OEvgeny](https://github.com/OEvgeny)
- New style option supports two values: `'activity-actions'` and `'activity-status'` (default)
- When set to `'activity-actions'`, feedback buttons are displayed in the activity actions toolbar
- When set to `'activity-status'`, feedback buttons appear in the activity status area (default behavior)

### Changed

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions __tests__/html/assets/index.css
Original file line number Diff line number Diff line change
@@ -21,6 +21,10 @@ body {
width: 360px;
}

.webchat__tooltip {
transition-duration: 0.01ms !important;
}

body.jest input,
body.jest textarea,
body.jest [contenteditable] {
103 changes: 103 additions & 0 deletions __tests__/html/fluentTheme/side-by-side.wide.dark.html
Original file line number Diff line number Diff line change
@@ -612,6 +612,91 @@

$ pip install numpy matplotlib`
}
], [
{
from:{
role: "bot"
},
id: "a-00000",
type: "message",
text: "This is compleded feedback action example.",
timestamp: timestamp(),
entities: [
{
...aiMessageEntity,
keywords: ['AIGeneratedContent', 'AllowCopy'],
potentialAction: [
{
"@type": "LikeAction",
actionStatus: "CompletedActionStatus",
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=like"
}
},
{
"@type": "DislikeAction",
actionStatus: "PotentialActionStatus",
result: {
"@type": "Review",
reviewBody: "I don't like it.",
"reviewBody-input": {
"@type": "PropertyValueSpecification",
valueMinLength: 3,
valueName: "reason"
}
},
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
}
}
]
}
]
},
{
from:{
role: "bot"
},
id: "a-00001",
type: "message",
text: "Hi! I'm Cody, the devbot. How can I help?",
timestamp: timestamp(),
entities: [
{
...aiMessageEntity,
keywords: ['AIGeneratedContent', 'AllowCopy'],
potentialAction: [
{
"@type": "LikeAction",
actionStatus: "PotentialActionStatus",
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=like"
}
},
{
"@type": "DislikeAction",
actionStatus: "PotentialActionStatus",
result: {
"@type": "Review",
reviewBody: "I don't like it.",
"reviewBody-input": {
"@type": "PropertyValueSpecification",
valueMinLength: 3,
valueName: "reason"
}
},
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
}
}
]
}
]
}
]];

const leftStore = testHelpers.createStore();
@@ -726,6 +811,24 @@
await host.snapshot();
await host.sendKeys('ENTER');
await host.snapshot();
},
likeDislike: async sendbox => {
sendbox.focus();
await host.sendShiftTab();
await host.sendKeys('ARROW_UP');
await host.sendKeys('ENTER');
await host.snapshot();
await host.sendKeys('TAB');
await host.snapshot();
await host.sendKeys('ENTER');
await host.snapshot();
await host.sendKeys('TAB');
await host.snapshot();
await host.sendKeys('ENTER');
await host.snapshot();
await host.sendKeys('ESCAPE');
await host.sendKeys('ESCAPE');
await host.snapshot();
}
}));

6 changes: 5 additions & 1 deletion __tests__/html/fluentTheme/side-by-side.wide.dark.js
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@ describe('Fluent theme applied', () => {
test('side by side left - transcript, right - codeblock', () =>
runHTML('fluentTheme/side-by-side.wide.dark?transcript=0&transcript=5&focus=1&focus-preset=viewCode'));
test('side by side left - transcript, right - codeblock dark', () =>
runHTML('fluentTheme/side-by-side.wide.dark?transcript=0&transcript=5&focus=1&focus-preset=viewCode&codeBlockTheme=github-dark-default'));
runHTML(
'fluentTheme/side-by-side.wide.dark?transcript=0&transcript=5&focus=1&focus-preset=viewCode&codeBlockTheme=github-dark-default'
));
test('side by side left - transcript, right - feedback', () =>
runHTML('fluentTheme/side-by-side.wide.dark?transcript=0&transcript=6&focus=1&focus-preset=likeDislike'));
});
});
103 changes: 103 additions & 0 deletions __tests__/html/fluentTheme/side-by-side.wide.html
Original file line number Diff line number Diff line change
@@ -622,6 +622,91 @@

$ pip install numpy matplotlib`
}
], [
{
from:{
role: "bot"
},
id: "a-00000",
type: "message",
text: "This is compleded feedback action example.",
timestamp: timestamp(),
entities: [
{
...aiMessageEntity,
keywords: ['AIGeneratedContent', 'AllowCopy'],
potentialAction: [
{
"@type": "LikeAction",
actionStatus: "CompletedActionStatus",
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=like"
}
},
{
"@type": "DislikeAction",
actionStatus: "PotentialActionStatus",
result: {
"@type": "Review",
reviewBody: "I don't like it.",
"reviewBody-input": {
"@type": "PropertyValueSpecification",
valueMinLength: 3,
valueName: "reason"
}
},
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
}
}
]
}
]
},
{
from:{
role: "bot"
},
id: "a-00001",
type: "message",
text: "Hi! I'm Cody, the devbot. How can I help?",
timestamp: timestamp(),
entities: [
{
...aiMessageEntity,
keywords: ['AIGeneratedContent', 'AllowCopy'],
potentialAction: [
{
"@type": "LikeAction",
actionStatus: "PotentialActionStatus",
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=like"
}
},
{
"@type": "DislikeAction",
actionStatus: "PotentialActionStatus",
result: {
"@type": "Review",
reviewBody: "I don't like it.",
"reviewBody-input": {
"@type": "PropertyValueSpecification",
valueMinLength: 3,
valueName: "reason"
}
},
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
}
}
]
}
]
}
]];

const leftStore = testHelpers.createStore();
@@ -709,6 +794,24 @@
await host.snapshot();
await host.sendKeys('ENTER');
await host.snapshot();
},
likeDislike: async sendbox => {
sendbox.focus();
await host.sendShiftTab();
await host.sendKeys('ARROW_UP');
await host.sendKeys('ENTER');
await host.snapshot();
await host.sendKeys('TAB');
await host.snapshot();
await host.sendKeys('ENTER');
await host.snapshot();
await host.sendKeys('TAB');
await host.snapshot();
await host.sendKeys('ENTER');
await host.snapshot();
await host.sendKeys('ESCAPE');
await host.sendKeys('ESCAPE');
await host.snapshot();
}
}));

6 changes: 5 additions & 1 deletion __tests__/html/fluentTheme/side-by-side.wide.js
Original file line number Diff line number Diff line change
@@ -16,5 +16,9 @@ describe('Fluent theme applied', () => {
test('side by side left - transcript, right - codeblock', () =>
runHTML('fluentTheme/side-by-side.wide?transcript=0&transcript=5&focus=1&focus-preset=viewCode'));
test('side by side left - transcript, right - codeblock dark', () =>
runHTML('fluentTheme/side-by-side.wide?transcript=0&transcript=5&focus=1&focus-preset=viewCode&codeBlockTheme=github-dark-default'));
runHTML(
'fluentTheme/side-by-side.wide?transcript=0&transcript=5&focus=1&focus-preset=viewCode&codeBlockTheme=github-dark-default'
));
test('side by side left - transcript, right - feedback', () =>
runHTML('fluentTheme/side-by-side.wide?transcript=0&transcript=6&focus=1&focus-preset=likeDislike'));
});
Loading