@copilot In Microsoft.Teams.Api, AttachmentLayout needs to be TWO types, not one renamed type. Background: teams.ts attempted the rename in microsoft/teams.ts#381 (merged 2025-10-25) and then REVERTED it in microsoft/teams.ts#382 (merged 2025-10-29) once it became clear that:
- Activity / Message layout on the wire is
list | carousel
- MessageExtension Result layout on the wire is
list | grid
- Needs to be done for /Libraries and /core
Current teams.ts main reflects this split — see packages/api/src/models/attachment/attachment-layout.ts ('list' | 'carousel') and
packages/api/src/models/messaging-extension/messaging-extension-attachment-layout.ts ('list' | 'grid').
Mirror that split in teams.net. Specifically:
-
Leave Libraries/Microsoft.Teams.Api/Attachment.cs Layout class unchanged — it must keep List and Carousel (for Activity/Message use). Do NOT rename Carousel to Grid.
-
Add a new strong-enum type Microsoft.Teams.Api.MessageExtensions.AttachmentLayout with only List ("list") and Grid ("grid"), following the existing StringEnum pattern used elsewhere (e.g., the existing Attachment.Layout). Place it under Libraries/Microsoft.Teams.Api/MessageExtensions/ alongside Attachment.cs (which already extends Api.Attachment — same parallel-type pattern applies here).
-
Change Libraries/Microsoft.Teams.Api/MessageExtensions/Result.cs:45 from Api.Attachment.Layout? to the new MessageExtensions.AttachmentLayout?.
-
Do NOT touch:
Libraries/Microsoft.Teams.Api/Messages/Message.cs (still uses Attachment.Layout — correct)
Libraries/Microsoft.Teams.Api/Activities/Message/MessageActivity.cs (still uses Attachment.Layout — correct)
- samples or tests unless required by step 3
-
Run dotnet build and dotnet format before pushing. Ensure the new file ends with a trailing newline.
This is a NON-breaking change (the new type is additive; Result.AttachmentLayout's assignable values were already constrained to list/grid in practice, and the property type on a JSON-serialized class swap is source-compatible for typical usage where callers passed Attachment.Layout.List).
In the PR description, link both microsoft/teams.ts#381 and microsoft/teams.ts#382, and explicitly note that #381 was reverted. This is the context that was lost in #193 and #488.
@copilot In Microsoft.Teams.Api, AttachmentLayout needs to be TWO types, not one renamed type. Background: teams.ts attempted the rename in microsoft/teams.ts#381 (merged 2025-10-25) and then REVERTED it in microsoft/teams.ts#382 (merged 2025-10-29) once it became clear that:
list | carousellist | gridCurrent teams.ts main reflects this split — see packages/api/src/models/attachment/attachment-layout.ts (
'list' | 'carousel') andpackages/api/src/models/messaging-extension/messaging-extension-attachment-layout.ts (
'list' | 'grid').Mirror that split in teams.net. Specifically:
Leave
Libraries/Microsoft.Teams.Api/Attachment.csLayoutclass unchanged — it must keepListandCarousel(for Activity/Message use). Do NOT rename Carousel to Grid.Add a new strong-enum type
Microsoft.Teams.Api.MessageExtensions.AttachmentLayoutwith onlyList("list") andGrid("grid"), following the existingStringEnumpattern used elsewhere (e.g., the existingAttachment.Layout). Place it underLibraries/Microsoft.Teams.Api/MessageExtensions/alongsideAttachment.cs(which already extendsApi.Attachment— same parallel-type pattern applies here).Change
Libraries/Microsoft.Teams.Api/MessageExtensions/Result.cs:45fromApi.Attachment.Layout?to the newMessageExtensions.AttachmentLayout?.Do NOT touch:
Libraries/Microsoft.Teams.Api/Messages/Message.cs(still usesAttachment.Layout— correct)Libraries/Microsoft.Teams.Api/Activities/Message/MessageActivity.cs(still usesAttachment.Layout— correct)Run
dotnet buildanddotnet formatbefore pushing. Ensure the new file ends with a trailing newline.This is a NON-breaking change (the new type is additive;
Result.AttachmentLayout's assignable values were already constrained to list/grid in practice, and the property type on a JSON-serialized class swap is source-compatible for typical usage where callers passedAttachment.Layout.List).In the PR description, link both microsoft/teams.ts#381 and microsoft/teams.ts#382, and explicitly note that #381 was reverted. This is the context that was lost in #193 and #488.