Add MessageExtensions.AttachmentLayout (list|grid); keep Attachment.Layout (list|carousel)#488
Add MessageExtensions.AttachmentLayout (list|grid); keep Attachment.Layout (list|carousel)#488Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/microsoft/teams.net/sessions/23017044-2ca1-46f9-9a18-5d084e4a18fc Co-authored-by: corinagum <14900841+corinagum@users.noreply.github.com>
|
@copilot accidental loss of context: 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:
Current teams.ts main reflects this split — see packages/api/src/models/attachment/attachment-layout.ts ( Mirror that split in teams.net. Specifically:
This is a NON-breaking change (the new type is additive; 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. |
Agent-Logs-Url: https://github.com/microsoft/teams.net/sessions/815d7134-0c52-4af0-96a0-275388419bdf Co-authored-by: corinagum <14900841+corinagum@users.noreply.github.com>
Done in 3bccf7d. Reverted Note on the trailing-newline guidance: the repo's |
Splits attachment layout into two distinct types to match the wire protocol, mirroring the equivalent split in teams.ts:
Attachment.Layout(Activity / Message):list | carousel— unchangedMessageExtensions.AttachmentLayout(MessageExtension Result):list | grid— newRelated:
carousel→grid(reverted)The context that the rename was reverted upstream was lost in #193 and #488; this PR mirrors the final teams.ts shape rather than the reverted rename.
Changes
Libraries/Microsoft.Teams.Api/Attachment.cs: unchanged —LayoutkeepsListandCarousel(correct for Activity/Message wire format).Libraries/Microsoft.Teams.Api/MessageExtensions/AttachmentLayout.cs(new): addsMessageExtensions.AttachmentLayout : StringEnumwithList("list") andGrid("grid"), following the existingStringEnumpattern (matchesAttachment.LayoutandMessageExtensions.ResultType).Libraries/Microsoft.Teams.Api/MessageExtensions/Result.cs:AttachmentLayoutproperty type changed fromApi.Attachment.Layout?to the newMessageExtensions.AttachmentLayout?.Samples/Samples.MessageExtensions/Program.cs: updated the sixAttachmentLayout = ...Listassignments to referenceMicrosoft.Teams.Api.MessageExtensions.AttachmentLayout.List(required becauseLibraries/andSamples/build withTreatWarningsAsErrors).Libraries/Microsoft.Teams.Api/Messages/Message.csandLibraries/Microsoft.Teams.Api/Activities/Message/MessageActivity.csare intentionally left unchanged (still useAttachment.Layout, which is correct).Notes
This is additive at the API surface —
Attachment.Layoutis unchanged, and the only consumer whose property type changed (MessageExtensions.Result.AttachmentLayout) is source-compatible for the typical... = AttachmentLayout.Listusage pattern.dotnet buildanddotnet formatpass on the changed files. The newAttachmentLayout.csfile follows the repo's prevailing convention of no trailing newline (enforced bydotnet format'sFINALNEWLINErule across the rest ofMicrosoft.Teams.Api).