Skip to content

Update Adaptive Cards package#379

Merged
corinagum merged 5 commits intomainfrom
cg/ac-gen-versionfix
Apr 2, 2026
Merged

Update Adaptive Cards package#379
corinagum merged 5 commits intomainfrom
cg/ac-gen-versionfix

Conversation

@corinagum
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs
Comment thread Libraries/Microsoft.Teams.Cards/Actions/InvokeAction.cs
Copilot AI review requested due to automatic review settings March 19, 2026 21:35
Copy link
Copy Markdown
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.

Copilot AI review requested due to automatic review settings April 1, 2026 18:34
@corinagum corinagum force-pushed the cg/ac-gen-versionfix branch from 427b5e2 to 0a66ce0 Compare April 1, 2026 18:34
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

Samples/Samples.Dialogs/Program.cs:174

  • Microsoft.Teams.Cards.AdaptiveCard no longer has a parameterless constructor (it now requires the body list via constructor). CreateDialogLauncherCard() still instantiates it with an object initializer and sets Body afterward, which will fail to compile. Update this sample to call the new AdaptiveCard(...) constructor and keep the rest of the initializer the same.
static Microsoft.Teams.Cards.AdaptiveCard CreateDialogLauncherCard()
{
    var card = new Microsoft.Teams.Cards.AdaptiveCard
    {
        Body = new List<Microsoft.Teams.Cards.CardElement>
        {

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

Comment thread Libraries/Microsoft.Teams.Cards/Core.cs
@corinagum corinagum force-pushed the cg/ac-gen-versionfix branch from 0a66ce0 to e8a5efa Compare April 1, 2026 21:17
Copy link
Copy Markdown
Collaborator

@singhk97 singhk97 left a comment

Choose a reason for hiding this comment

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

lgtm

Copilot AI review requested due to automatic review settings April 2, 2026 19:47
@corinagum corinagum force-pushed the cg/ac-gen-versionfix branch from e8a5efa to ae6f466 Compare April 2, 2026 19:47
@corinagum corinagum merged commit f22fb58 into main Apr 2, 2026
9 checks passed
@corinagum corinagum deleted the cg/ac-gen-versionfix branch April 2, 2026 19:49
Copy link
Copy Markdown
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

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

Comments suppressed due to low confidence (1)

Samples/Samples.Dialogs/Program.cs:174

  • AdaptiveCard no longer has an implicit parameterless constructor (it now has an explicit AdaptiveCard(params IList<CardElement> body) ctor in Core.cs). The new AdaptiveCard { ... } object-initializer form requires an accessible parameterless ctor, so this will not compile. Construct the card with the required body parameter (e.g., call the ctor with the body list and then set Actions/Schema as needed).
static Microsoft.Teams.Cards.AdaptiveCard CreateDialogLauncherCard()
{
    var card = new Microsoft.Teams.Cards.AdaptiveCard
    {
        Body = new List<Microsoft.Teams.Cards.CardElement>
        {

💡 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.

3 participants