BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Action.execute (AC 1.4) support Related to #3828

Open kaerm opened this issue 3 years ago • 17 comments

Add support for the Action.Execute command and various flows, including the action/execute invoke and auth flows.

OBI spec is here: microsoft/botframework-obi#128

Hacked up webchat that can do AC 1.4 cards: https://github.com/clearab/CateringDemo

Tracking status

  • [ ] PR
  • [ ] Merged

kaerm avatar Apr 12 '21 22:04 kaerm

@kaerm when will the schema spec be merged in?

semi-dupe of #3828

corinagum avatar Apr 12 '21 23:04 corinagum

not sure if there is a specific date. @clearab might know

kaerm avatar Apr 12 '21 23:04 kaerm

@compulim I'm assuming it's safest to wait until the schema is updated - thoughts?

@DDEfromOR @p-nagpal Is there any info from the service side on a schedule for supporting this on DirectLine?

corinagum avatar Apr 12 '21 23:04 corinagum

DirectLine currently supports the 1.4 protocol, it is necessary for the new Outlook and Search channels. The 1.4 schema itself is already GA.

clearab avatar Apr 13 '21 16:04 clearab

@Jeffders has done the work on the service/DirectLine side.

clearab avatar Apr 13 '21 16:04 clearab

Sorry for the confusion, folks. Spoke with DDEfromOR offline and he clarified about the service/DirectLine side. I've added this to R14 candidates (which was the hopeful plan already), and we'll probably consolidate this with 3828 in the next several days. :)

corinagum avatar Apr 13 '21 17:04 corinagum

The latest version of adaptivecards package on NPM is 2.9.0 as of now. The README only say it support up to 1.3, but not 1.4.

We generally wait until our deps is in production before we move to the newer version. It reduce risks on our customers, also reduce risks on release. But sometimes, we will simul-ship (2+ products goes to production at the same time), usually, if the management think a bigger splash outweigh its risks, or, if we can take the opportunity to provide feedbacks for them.

As we are close to Build, please let us know sooner. From our experiences, bumping AC usually takes us a few days due to breaking changes or accessibility issues. As AC 1.4 introduce new features, it will also requires new code, i.e. more time to integrate, plus upgrading our test bot to support new commands.

compulim avatar Apr 14 '21 18:04 compulim

Checked with the team, 2.9 is supposed to support 1.4.

kaerm avatar Apr 14 '21 19:04 kaerm

The table in the readme is mapping prior versions to card schema versions - I do know that Teams, Outlook, and Search are all rev'ing to support 1.4 schema cards by build.

clearab avatar Apr 14 '21 19:04 clearab

Please let us know when the spec is finalized. David from Adaptive Cards team is still commenting on the spec.

Do you know if there are any sample apps on how to use Adaptive Cards renderer 2.9 with Action.Execute? I mean, I know how it works on the protocol level, but I don't know how to use the 2.9 package and integrate it with the protocol.

compulim avatar Apr 14 '21 19:04 compulim

The spec is as finalized as it is going to be for this iteration I believe - Teams, Outlook, and Search are all building to it. We can schedule a meeting with David if you've got specific questions you need answered, and probably connect you with the folks doing the Teams implementation.

For the app, I believe @Jeffders has a couple working demo apps for this (and can probably also help answer any spec questions).

clearab avatar Apr 14 '21 19:04 clearab

List of stuff we do after Adaptive Cards rendered the card (from adaptiveCardRenderer.js):

  • (Accessibility) AC root container support tap action. If it is set, end-user can (use a pointer) to click to activate the action
    • However, it does not support ENTER or SPACEBAR, we added code to handle keypress
  • (Accessibility) End-user pushed a button on the AC, we will set a few ARIA attributes
    • aria-press="true"
    • role="button" (when rendered by AC, it set role="menuitem")
    • If end-dev provided actionPerformedClassName, we will set it to the button className after the button is pushed
    • Q to AC team: Why at the first place, the list of action buttons is grouped as role="menubar"?
  • Disable/enable all widgets in Adaptive Cards
    • If the dev set Web Chat control to disabled, we will also disable all widgets in the AC
  • If the card is re-rendered, we will save/restore input values and focus (document.activeElement)
    • For example, if actionPerformedClassName or disabled is changed
  • (Accessibility) Setting RTL in useParseAdaptiveCardJSON.ts
    • After AdaptiveCard.parse, we call updateRTLInline to walk the AC-specific DOM tree to add rtl property to every element of type AdaptiveCard.Container

Extra notes:

  • If the card refreshed by the bot failed validation, what should we do?
    • Today, if the (initial) card failed validation, we will show an error
  • Some actions are handled differently
    • Action.OpenUrl (default, it will become window.open)
    • Action.Submit become postBack and imBack
    • End-devs can provide an override for these default actions, including disabling them

compulim avatar May 26 '21 06:05 compulim

@compulim did this ever get implemented? I thought I remembered seeing that support for 1.4+ and action.execute was added.

clearab avatar Jun 07 '22 23:06 clearab

Any news about this? How can we use Action.Execute with botframework-webchat ?

Getting the error react_devtools_backend_compact.js:2367 Web Chat: received unknown action from Adaptive Cards with botframework-webchat 4.15.7

pedrojfds avatar Jun 05 '23 11:06 pedrojfds

any updates on this issue?

ohiobobcat avatar Jul 07 '23 16:07 ohiobobcat

Me too . Web Chat: received unknown action from Adaptive Cards image

hoangbaophu89 avatar Oct 04 '23 06:10 hoangbaophu89