Skip to content
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 isEnabled property #4670

Closed
productboard-ac opened this issue Aug 26, 2020 · 6 comments
Closed

Action isEnabled property #4670

productboard-ac opened this issue Aug 26, 2020 · 6 comments

Comments

@productboard-ac
Copy link
Collaborator

productboard-ac commented Aug 26, 2020

Description

In some scenarios, multiple actions might be presented in a card in an Outlook Actionable Message. As the user presses invokes these actions, the card might be refreshed and some of the actions that were previously available might not be available anymore.

Let's take the example of a card with two mutually exclusive actions, A and B (clicking A makes B unavailable, and the other way around):

  • Initial card has buttons for both A and B
  • User click A
  • The card gets refreshed
  • In that refreshed card, the button for A is replaced by a label reading "Done!"
  • But what about B? There are two things that can be done:
    • Either B is still there. When the user clicks it, they get an error that B cannot be done anymore because A was done before
    • Or B is gone

Describe the solution you'd like

In some cases, neither of the above two solutions are great, especially if B is visually represented as a button. What should really happen is:

  • B is still there, but is disabled (both visually and functionally)

This allows the user to understand that clicking on A lead to not being able to click on B anymore, using a known UI pattern.

Design

The goal of this feature is to make it possible to craft cards in which actions are permanently disabled. If an action is marked as disabled, there is no way to re-enable it by simply interacting with the card on the client.

We will add a boolean isEnabled property to all actions. isEnabled defaults to true. When set to false, the card element associated with the action is functionally and visually disabled:

  • Buttons have a disabled appearance and do not respond to clicks/taps/keyboard invocation. That includes action buttons for the card's actions property, for an ActionSet's actions as well as for the inlineAction of a TextInput.
  • Images or other elements with a disabled selectAction look and behave as if they had no selectAction. They should be rendered per platform as disabled buttons for the purposes of exposing that state to the accessibility tree. The exception is disabled text runs with select actions. Because there is no concept of a "disabled hyperlink", disabled select actions will render as plain text with no link.

Visuals for disabled buttons (just like for enabled buttons) are up to each SDK and platform. Developers should be able to customize the visuals of disabled buttons using native styling; there will not be any HostConfig changes for this.

Downlevel clients which do not understand the isEnabled property will simply ignore it which mean the actions will remain enabled. It is up to the card author to deal with this constraint and craft their card so as to provide an acceptable user experience.

@productboard-ac
Copy link
Collaborator Author

@ghost ghost added the Feature label Aug 26, 2020
@ghost
Copy link

ghost commented Aug 26, 2020

ProductBoard auto-generated feature.

@matthidinger
Copy link
Member

This work is currently tracked in #4257

@shalinijoshi19
Copy link
Member

Dup# 4257

@matthidinger
Copy link
Member

Re-opening since this one tracks the overall feature and will serve as the parent for the other SDK issues

@matthidinger matthidinger reopened this Sep 3, 2020
@matthidinger
Copy link
Member

This will also resolve #3857

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants