Skip to content

Update Adaptive Cards package#379

Open
corinagum wants to merge 6 commits intomainfrom
cg/ac-gen-versionfix
Open

Update Adaptive Cards package#379
corinagum wants to merge 6 commits intomainfrom
cg/ac-gen-versionfix

Conversation

@corinagum
Copy link
Contributor

@corinagum corinagum commented Mar 18, 2026

  • Fixes error where cards would not render in mobile when AC version was not set - default version 1.5 will be applied
  • Updated generated Adaptive Cards core file Core.cs from latest codegen output
  • Updated InvokeAction.cs to use new IUnion type for InvokeSubmitActionData value parameter
  • Marked IMBackAction, InvokeAction, MessageBackAction, SignInAction, and TaskFetchAction with [Obsolete], pointing to their generated replacements
  • Other default values added: isEnabled, action mode defaults to "primary", action style "default, requires defaults to new HostCapabilities.
  • msteams added to several types: AdaptiveCard, SubmitAction, Image, SubmitActionData
  • New required constructor parameters: AdaptiveCard(body), ChoiceSetInput(choices)
  • StyleEnum class removed (replaced by ChoiceSetInputStyle)

Copilot AI review requested due to automatic review settings March 18, 2026 23:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Microsoft.Teams.Cards Adaptive Cards action helpers to align with newly generated Teams-specific *SubmitActionData models, and begins deprecating the legacy convenience action types.

Changes:

  • Marked legacy *Action helper classes as obsolete in favor of generated *SubmitActionData replacements.
  • Updated InvokeAction to construct InvokeSubmitActionData using the new IUnion-based value type.
  • Added/updated XML docs to reflect the deprecation guidance.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs Added [Obsolete] + deprecation docs directing to TaskFetchSubmitActionData.
Libraries/Microsoft.Teams.Cards/Actions/SignInAction.cs Added [Obsolete] + deprecation docs directing to SigninSubmitActionData.
Libraries/Microsoft.Teams.Cards/Actions/MessageBackAction.cs Added [Obsolete] + deprecation docs directing to MessageBackSubmitActionData.
Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs Added [Obsolete] and updated InvokeSubmitActionData construction to use Union<object, CollabStageInvokeDataValue>.
Libraries/Microsoft.Teams.Cards/Actions/IMBackAction.cs Added [Obsolete] + deprecation docs directing to ImBackSubmitActionData.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 19, 2026 21:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Teams Adaptive Cards library to the latest generated model output and migrates usage away from deprecated hand-written action types toward generated submit-action data types.

Changes:

  • Updated tests to use new required constructors (e.g., AdaptiveCard(body), ChoiceSetInput(choices)).
  • Updated the Dialogs sample to launch task modules via Action.Submit + TaskFetchSubmitActionData instead of TaskFetchAction.
  • Marked legacy action helper classes (IMBackAction, InvokeAction, MessageBackAction, SignInAction, TaskFetchAction) as [Obsolete] and pointed to generated replacements.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Tests/Microsoft.Teams.Cards.Tests/AdaptiveCardsTest.cs Migrates test card construction to new required constructors.
Samples/Samples.Dialogs/Program.cs Switches task/fetch launching to generated submit-action data; adds helper factory.
Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs Marks legacy TaskFetchAction obsolete in favor of generated submit-action data.
Libraries/Microsoft.Teams.Cards/Actions/SignInAction.cs Marks legacy SignInAction obsolete in favor of generated submit-action data.
Libraries/Microsoft.Teams.Cards/Actions/MessageBackAction.cs Marks legacy MessageBackAction obsolete in favor of generated submit-action data.
Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs Marks legacy InvokeAction obsolete; updates to new union-based value shape.
Libraries/Microsoft.Teams.Cards/Actions/IMBackAction.cs Marks legacy IMBackAction obsolete in favor of generated submit-action data.
Comments suppressed due to low confidence (1)

Samples/Samples.Dialogs/Program.cs:176

  • AdaptiveCard no longer has a parameterless constructor (it now requires the body list in its constructor). This new Microsoft.Teams.Cards.AdaptiveCard { Body = ... } initialization will fail to compile; switch to constructing the card with the body list via the constructor and keep Actions/other properties in the object initializer.
static Microsoft.Teams.Cards.AdaptiveCard CreateDialogLauncherCard()
{
    var card = new Microsoft.Teams.Cards.AdaptiveCard
    {
        Body = new List<Microsoft.Teams.Cards.CardElement>
        {
            new Microsoft.Teams.Cards.TextBlock("Select the examples you want to see!")
            {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants