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

[UWP Renderer] Update ActionSet fallback #8233

Merged
merged 16 commits into from
Mar 20, 2023

Conversation

anna-dingler
Copy link
Contributor

@anna-dingler anna-dingler commented Jan 17, 2023

Related Issue

Fixes #8323

Description

When attempting to handle the fallback scenario for an action, we throw an E_FAIL error if no mechanism is provided (default).

while (!renderer)
{
auto actionTypeString = action.ActionTypeString();
renderer = actionRegistration.Get(actionTypeString);
if (!renderer)
{
switch (action.FallbackType())
{
case winrt::FallbackType::Drop:
XamlHelpers::WarnForFallbackDrop(renderContext, actionTypeString);
return nullptr;
case winrt::FallbackType::Content:
action = action.FallbackContent();
XamlHelpers::WarnForFallbackContentElement(renderContext, actionTypeString, action.ActionTypeString());
break; // Go again
case winrt::FallbackType::None:
default:
throw winrt::hresult_error(E_FAIL);
}
}
}

This error is never handled, and an error is shown in the visualizer.

image

I added a try/catch block surrounding this method call so that we continue rendering even if we drop the action.

I also updated the actionType when getting FallbackContent.

Sample Card

https://github.com/microsoft/AdaptiveCards/blob/main/samples/v1.2/Elements/ActionFallback.json

How Verified

Verified manually on the AdaptiveCards Visualizer.

actionFallback2

Microsoft Reviewers: Open in CodeFlow

anna-dingler and others added 6 commits December 16, 2022 00:41
* Update custom.props for object model release

* Updated Xcode version (#8222)

* removed build step as they are redundant (#8201)

* removed build step as they are redundant

* added pod installation step

Co-authored-by: Joseph Woo <[email protected]>
* Update custom.props for object model release

* Updated Xcode version (#8222)

* removed build step as they are redundant (#8201)

* removed build step as they are redundant

* added pod installation step

* Add a null check for inline Actions

Co-authored-by: Joseph Woo <[email protected]>
@ghost ghost added the no-recent-activity label Jan 22, 2023
@ghost
Copy link

ghost commented Jan 22, 2023

Hi @anna-dingler. This pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@anna-dingler anna-dingler changed the base branch from release/uwp-v3.1.0 to main February 21, 2023 23:48
@microsoft-github-policy-service
Copy link
Contributor

Staleness reset by anna-dingler

@anna-dingler anna-dingler merged commit 50a7c52 into main Mar 20, 2023
@anna-dingler anna-dingler deleted the anna/updateActionSetFallback branch March 20, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UWP Renderer] Card does not render if there is a faulty action without a fallback mechanism.
3 participants