Conversation
There was a problem hiding this comment.
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
*Actionhelper classes as obsolete in favor of generated*SubmitActionDatareplacements. - Updated
InvokeActionto constructInvokeSubmitActionDatausing the newIUnion-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.
There was a problem hiding this comment.
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+TaskFetchSubmitActionDatainstead ofTaskFetchAction. - 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
AdaptiveCardno longer has a parameterless constructor (it now requires the body list in its constructor). Thisnew Microsoft.Teams.Cards.AdaptiveCard { Body = ... }initialization will fail to compile; switch to constructing the card with the body list via the constructor and keepActions/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.
427b5e2 to
0a66ce0
Compare
There was a problem hiding this comment.
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.AdaptiveCardno longer has a parameterless constructor (it now requires the body list via constructor).CreateDialogLauncherCard()still instantiates it with an object initializer and setsBodyafterward, which will fail to compile. Update this sample to call the newAdaptiveCard(...)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.
0a66ce0 to
e8a5efa
Compare
e8a5efa to
ae6f466
Compare
There was a problem hiding this comment.
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
AdaptiveCardno longer has an implicit parameterless constructor (it now has an explicitAdaptiveCard(params IList<CardElement> body)ctor in Core.cs). Thenew 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 setActions/Schemaas 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.
Core.csfrom latest codegen outputInvokeAction.csto use newIUniontype forInvokeSubmitActionDatavalue parameterIMBackAction,InvokeAction,MessageBackAction,SignInAction, andTaskFetchActionwith [Obsolete], pointing to their generated replacementsmsteamsadded to several types:AdaptiveCard,SubmitAction,Image,SubmitActionDataAdaptiveCard(body),ChoiceSetInput(choices)StyleEnumclass removed (replaced byChoiceSetInputStyle)