Botframework-sdk: Add a button list style to the Choices for prompts

Created on 25 Oct 2018  Â·  14Comments  Â·  Source: microsoft/botframework-sdk

_From @rosskyl on October 24, 2018 18:36_

Is your feature request related to a problem? Please describe.
I am upgrading a v3 bot to v4 and am working on the prompts. I am currently using a ConfirmPrompt but would like to use buttons rather than just text.

Describe the solution you'd like
It would be great to have a button list style that would display the options as a card action inside a hero card attachment.

Describe alternatives you've considered
I have looked at creating a hero card and adding card actions to it and adding that to the prompt activity. However this displays the options "(1) Yes or (2) No" as text above the card still.

Additional context
This is what I am looking for:
image
I do have some custom css styling to in the webchat.

[enhancement]

_Copied from original issue: Microsoft/botbuilder-dotnet#1057_

triaged

Most helpful comment

That puts it inline as text. I would like buttons as they are easier for users to see and click on. I am able to get around this for the ChoicePrompt by creating a hero card with the choices as buttons and using that as the prompt and setting the ListStyleto none. But there is no way around this for others especially the ConfirmPrompt. I also think it is also a roundabout way.

All 14 comments

_From @sgellock on October 24, 2018 20:6_

Adaptive Cards should be able to address this issue for the customer

_From @nhadro on October 25, 2018 17:14_

I'm working with this developer on this and the primary channel we're using is Skype for Business which doesn't support many cards from what I've seen.

Moved from https://github.com/Microsoft/botbuilder-dotnet/issues/1057.
DCR for all SDK languages.

Using adaptive cards is not a great option (and not supported on all channels), the SDK 3 list style was quick and efficient to implement.

The SDK 4 choice prompt usability is questionable too, as many users are used to seeing such choice options inline in the chat rather than as - what looks like - suggested actions.

Is there any plan for SDK 4 to support list style please?

Inline and list formatting already exists:

const { ChoicePrompt, ListStyle } = require('botbuilder-dialogs');

const choicePrompt = new ChoicePrompt('prompt');
// Change the ListStyle of the prompt to ListStyle.none.
choicePrompt.style = ListStyle.list; // or ListStyle.inline

That puts it inline as text. I would like buttons as they are easier for users to see and click on. I am able to get around this for the ChoicePrompt by creating a hero card with the choices as buttons and using that as the prompt and setting the ListStyleto none. But there is no way around this for others especially the ConfirmPrompt. I also think it is also a roundabout way.

Has anyone found a better solution do to this? it works but its kinda of a pain.

I strongly believe on SDK 3 was easier and better on this than SDK 4. I'm using nodeJs with Teams channel, and I've tried:

this.dialogSet.dialogs.sourceCurrencyPrompt.style = ListStyle.heroCard; // or ListStyle.suggestedAction

and the BOT Emulator renders it whereas Teams does not.

Also tried doing:
var reply = MessageFactory.suggestedActions(['USD ($)', 'Euro (€)'], 'Choose destination currency');
await stepContext.context.sendActivity(reply);

and also, the emulator renders it perfectly and again Teams does not even show anything. Very dissapointing.

@yochay - This was implemented in this pull request: https://github.com/Microsoft/botbuilder-dotnet/pull/1339

Should we close this issue?

When is this being implemented for the NodeJs SDK? Thanks.

customer wants the v3 solution carried forward to v4.

@textminer - The Node SDK has parity with .NET: https://github.com/microsoft/botbuilder-js/pull/773

we believe this is resolved and possible with existing mechanisms

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kenyeung128 picture kenyeung128  Â·  3Comments

hailiang-wang picture hailiang-wang  Â·  3Comments

Vigneshramkumar picture Vigneshramkumar  Â·  3Comments

daveta picture daveta  Â·  3Comments

clearab picture clearab  Â·  3Comments