-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action.ToggleVisibility #1729
Comments
If you're proposing adding Action.ToggleVisibility as an element that card authors can use, that's actually not what Windows wants. Hosts on Windows want to control the expand/collapse content themselves so they can achieve consistency - they don't want the authors controlling that (other than the ShowCard action). For example, in notifications, the collapsed view is always just the title/subtitle, and then expanded view adds the hero image, body, and actions. The card author has zero control over this. The host has all the control. |
Hey @dclaux can you share some visual examples of this? Since Outlook has this, just grab some screenshots of an example of how it's being used, that'll help for discussing this! Thanks! |
Here is a sample card. It initially renders like this: The first leg of the trip is clickable. When clicked, the card expands: Try for yourself by pasting the below payload in Outlook's Card Playground.
|
Is it possible to use the property |
@manuelschlegel no that is currently not possible. |
Closing. Documentation is being tracked separately. |
Can you please check this issue related to this feature, I have Power Virtual Agent bot running on Teams. Images are not being displayed(rather displayed as hyperlinks) under accordion in adaptive card. Same content displays images if it is rendered through simple message. Content containing image rendered through accordion, Content containing images rendered through simple message, Adaptive card JSON with accordion is as below, { |
✔️ Android (#2208)
✔️ iOS (#2207)
✔️ TS (#2415)
✔️ UWP (#2206)
🔄 Designer (#2503)
Solves requests
Examples
Needed
Possible design
Action.ToggleVisibility
Introduce a new Action.ToggleVisibility action type that makes it possible to dynamically show/hide a set of elements in a card as the user clicks on the associated button/UI element. The action is defined as follows:
Items in the targetElements array can either be:
- A string, in which case the items represents the id of an element,
- An object with elementId: string and isVisible: boolean properties
When executed, the above action will:
- Toggle the visibility of the elements with Ids "id1" and "id2"
- Make element with Id "id3" visible (even if it already is)
- Make element with Id "id4" invisible (even if it already is)
Action.ToggleVisibility works in conjunction with the isVisible property (see below.)
lly touch the left and right edges of the card, which is not desirable. To compensate, its "padding" property is set to "default."
Open Question: What if an author has two Action.ToggleVisibility actions, and they're each toggling different elements, but they don't want both of their elements shown at once? The author would have to make sure their action hides the elements that the other action showed? Maybe not important though? Tough to know without knowing common use cases.
isVisible property
All element types would support an
isVisible
property that would make it possible to design cards with elements that are initially hidden. Used in conjunction with the Action.ToggleVisibility action type, it makes it possible to support scenarios where portions of a card can be expanded/collapsed.Host Config
No changes.
Down-level impact (authors)
High. Down-level clients will display all elements, including ones that should be hidden, leading to potentially unusable cards.
Host burden
No impact. Works for free.
Renderer Requirements
Needed
Auto-generated task status
The text was updated successfully, but these errors were encountered: