question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ActionSet element type to render actions anywhere

See original GitHub issue
Release Renderer status Tasks status
1.2 ✔️ .NET (#2438)
✔️ Android (#2439)
✔️ iOS (#2440)
✔️ TS (#2441)
✔️ UWP (#2225)
✔️ Shared (#2437)

Solves requests

  • Be able to use actions (buttons) anywhere within card body (#2027)

Summary

Allow authors to place an “action bar” (or multiple) anywhere within the card body, by introducing an ActionSet element, which takes an array of actions.

This is rendered identically to the existing actions bar - meaning the host gets to choose the button orientation (horizontal/vertical) and alignment (left/center/right/stretch). This lets authors create the cards they want, while still achieving that host consistency of how the buttons are oriented and aligned.

Note that the maxActions from host config is also enforced. The maxActions only apply to a single ActionSet… so if you have two ActionSets and maxActions is 5, you can have 10 buttons on your card.

Schema

New element, ActionSet

Property Type Required Description
type "ActionSet" Yes The type of the element
id string No A unique identifier associated with the element.
spacing string No Controls the amount of spacing between this element and the preceding element.
separator bool No When true, draw a separating line at the top of the element.
actions Action[] Yes The actions to be displayed.
<strike>horizontalAlignment</strike> <strike>string</strike> <strike>No</strike> Does NOT have horizontalAlignment property, since it wouldn’t do anything, since hosts get to pick the alignment of buttons. If an author wanted to force the buttons to the left, they could place it in a ColumnSet.

Example

...
                {
                    "type": "ActionSet",
                    "actions": [
                        {
                            "type": "Action.OpenUrl",
                            "title": "Set due date",
                            "url": "https://msn.com"
                        },
                        {
                            "type": "Action.OpenUrl",
                            "title": "View",
                            "url": "https://msn.com"
                        }
                    ]
                },
                {
                    "type": "FactSet",
                    "facts": [
                        {
                            "title": "Board:",
                            "value": "Adaptive Card"
                        },
                        {
                            "title": "List:",
                            "value": "Backlog"
                        },
                        {
                            "title": "Assigned to:",
                            "value": "Matt Hidinger"
                        },
                        {
                            "title": "Due date:",
                            "value": "Not set"
                        }
                    ]
                }

Examples with different host configs. Note that author doesn’t get to control the alignment.

Host config Example
Horizontal, stretch image
Horizontal, left image
Vertical, center image
Vertical, right image

Host Config

No changes.

Down-level impact

Medium. ActionSet will be dropped.

Host burden

Theoretically no burden.

Renderer requirements

  • A renderer MUST render the ActionSet using everything from the actions HostConfig except the spacing (the author picks the spacing).
    • Apply the maxActions limit independently to each ActionSet
    • Use the buttonSpacing between buttons
    • Respect the showCard host settings
    • Use the actionsOrientation and actionAlignment
  • A renderer MUST treat ShowCards as follows…
    • Each individual ActionSet behaves independently of others. Thus, if there are 2 ActionSets (and the bottom action bar), each of these three can all have a ShowCard visible at once. Interacting with ShowCards on one ActionSet does NOT cause a different ActionSet’s ShowCard to disappear.
  • (More requirements needed, not complete list)

Auto-generated task status

  • Shared
  • .NET
  • Android
  • iOS
  • TS
  • UWP

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
yaronismcommented, Feb 7, 2018

Hi @matthidinger,

We are using MSBF and using this capability with one of our customers which is production. Out of a sudden you decided to remove this feature and their chatbot stopped functioning due to this unilateral decision. Please bring it back ASAP. You can mark it as deprecated but please don’t just exclude things which were part from the product before.

1reaction
dclauxcommented, Feb 7, 2018

For folks using the TypeScript renderer (as in rendering cards using the TypeScript renderer in your own application, not sending cards to clients that use the TypeScript renderer to render them) you can already enable support for ActionSet using this one liner:

AdaptiveCard.elementTypeRegistry.registerType("ActionSet", () => { return new Adaptive.ActionSet(); });
Read more comments on GitHub >

github_iconTop Results From Across the Web

ActionSet element type to render actions anywhere #877
Allow authors to place an "action bar" (or multiple) anywhere within the card body, by introducing an ActionSet element, which takes an array...
Read more >
ActionSet actions properties
The ActionSet component performs multiple actions and each action has distinct properties. You can update the properties to modify the behavior ...
Read more >
ActionSet
Displays a set of actions. Introduced in version 1.2. Property, Type, Required, Description, Version. type, "ActionSet" ...
Read more >
Design actionable message cards using Adaptive Card ...
Aside from the fact that ActionSet can be placed anywhere in the card, it behaves exactly like the actions property of an AdaptiveCard...
Read more >
Action Set Advanced Options
By default the Apply trigger to entire page option is checked, which allows a hover anywhere on the page to trigger the creative....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found