BotFramework-WebChat
BotFramework-WebChat copied to clipboard
DRAFT: Add like/dislike button
Fixes #
Changelog Entry
Description
Design
Ideas
- We could simply look at the originating activity, and it would tell which button is actually pressed
- We need some infrastructure to "modify the originating activity when we are processing more activities."
- Somehow, a client-side "edit activity" feature
- We will use the
entitiesfield and theLikeActionandDislikeAction - We will use W3C Hydra and URL Template to create the content body
- We could build a form, or allow bot/web devs to build an AC-in-Markdown that would fulfill the form based on
PropertyValueSpecificationor HTML Content Validation - I believe
PropertyValueSpecificationand HTML Content Validation can be converged rather easily
- We could build a form, or allow bot/web devs to build an AC-in-Markdown that would fulfill the form based on
- We will have a special protocol handler for
ms-directline://postback- In this PR or future, we could enable
<form action="ms-directline://postback">in Markdown too
- In this PR or future, we could enable
To-do
(This is draft.)
- [ ] Supports
<form action="ms-directline://postback">in Markdown as the container of activities- In future, we may consider this for container of Adaptive Cards
- (Optional) If the activity content is non-interactive, we may not add
<form>
- [ ] Improves
usePerformCardActionet al. to handle<form>submissions- May also need upgrade suggested actions and other existing card action containers
- [ ] Uses
use-schema-org-actionfor implementing the actions - [ ] Implements UI in Fluent, already done in white-label
- Need links to Figma
- [ ] Implements a facility to edit previous activities
- Goal:
useActivities()should return edited result - For example, modify the bot activity with
PotentialActionStatus->CompletedActionStatus
- Goal:
Specific Changes
-
- [ ] I have added tests and executed them locally
- [ ] I have updated
CHANGELOG.md - [ ] I have updated documentation
Review Checklist
This section is for contributors to review your work.
- [ ] Accessibility reviewed (tab order, content readability, alt text, color contrast)
- [ ] Browser and platform compatibilities reviewed
- [ ] CSS styles reviewed (minimal rules, no
z-index) - [ ] Documents reviewed (docs, samples, live demo)
- [ ] Internationalization reviewed (strings, unit formatting)
- [ ]
package.jsonandpackage-lock.jsonreviewed - [ ] Security reviewed (no data URIs, check for nonce leak)
- [ ] Tests reviewed (coverage, legitimacy)
@compulim are you aware of the feature that Teams includes? Where you can set 'feedbackLoopEnabled' in channelData?See https://github.com/microsoft/teams-ai/blob/main/getting-started/CONCEPTS/POWERED-BY-AI.md#feedback-loop. This will render a dialog in Teams, which will return a { name: "message/submitAction", type: "invoke" } with the feedback in the value property.
Would be great if these like/dislike buttons could be standardized across the channels supported by the Bot Service (or a way to map 'feedbackLoopEnabled' to way of working in BotFramework-Webchat).
@compulim are you aware of the feature that Teams includes? Where you can set 'feedbackLoopEnabled' in channelData?See https://github.com/microsoft/teams-ai/blob/main/getting-started/CONCEPTS/POWERED-BY-AI.md#feedback-loop. This will render a dialog in Teams, which will return a
{ name: "message/submitAction", type: "invoke" }with the feedback in thevalueproperty.Would be great if these like/dislike buttons could be standardized across the channels supported by the Bot Service (or a way to map 'feedbackLoopEnabled' to way of working in BotFramework-Webchat).
AFAIK, it is a quick solution: a simple flag to enable the dialog, without ability to put a payload for more debugging information for prompt engineers.
Invoke activity activity isn't supported across the board. The URL handler design here should be able to send the response via postback or invoke, depending on what the bot choose in the original payload.