botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Add a button list style to the Choices for prompts

Open yochay opened this issue 8 years ago • 14 comments

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

yochay avatar Oct 25 '18 21:10 yochay

From @sgellock on October 24, 2018 20:6

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

yochay avatar Oct 25 '18 21:10 yochay

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.

yochay avatar Oct 25 '18 21:10 yochay

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

yochay avatar Oct 25 '18 21:10 yochay

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?

dividor avatar Oct 27 '18 04:10 dividor

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

stevengum avatar Oct 29 '18 17:10 stevengum

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 ListStyle to none. But there is no way around this for others especially the ConfirmPrompt. I also think it is also a roundabout way.

rosskyl avatar Oct 29 '18 20:10 rosskyl

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

yapalex avatar Feb 18 '19 19:02 yapalex

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.

textminer avatar Apr 19 '19 16:04 textminer

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

Should we close this issue?

v-kydela avatar May 03 '19 15:05 v-kydela

Closing with fix merged https://github.com/Microsoft/botbuilder-dotnet/commit/170e3813302c74f9bf8e5ab3bcb197e2d54d4d1f

CoHealer avatar May 03 '19 16:05 CoHealer

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

textminer avatar May 07 '19 17:05 textminer

customer wants the v3 solution carried forward to v4.

sgellock avatar May 07 '19 18:05 sgellock

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

v-kydela avatar May 07 '19 18:05 v-kydela

we believe this is resolved and possible with existing mechanisms

sgellock avatar Jun 21 '19 20:06 sgellock