[🐞fix] Change AttachmentLayout type to replace 'carousel' with correct value: 'grid'#381
Merged
Merged
Conversation
Fixes the incorrect option `carousel` in type `AttachmentLayout`. If you use this, Teams doesn't render a response in a search-based message extension. The [comment where this is used](https://github.com/microsoft/teams.ts/blob/main/packages/api/src/models/messaging-extension/messaging-extension-result.ts#L31) is correct, the implementation isn't.
lilyydu
approved these changes
Oct 24, 2025
heyitsaamir
approved these changes
Oct 24, 2025
This was referenced Oct 24, 2025
heyitsaamir
added a commit
that referenced
this pull request
Oct 29, 2025
…h correct value: 'grid'" (And add MessagingExtensionAttachmentLayout) (#382) Reverts #381 This is a bit of mess - * There is an `AttachmentLayout` that exists on `Activity` which should be `list | carousel`. * There is an `AttachmentLayout` that exists on `MessageExtension` which should be `list | grid`.
heyitsaamir
added a commit
to microsoft/teams.py
that referenced
this pull request
Oct 30, 2025
Aligns with <a href="https://github.com/microsoft/teams.ts/pull/381">teams.ts PR #381</a> to add "grid" layout support for messaging extensions while maintaining backward compatibility. ## Changes - **New Enum**: Created `MessagingExtensionAttachmentLayout` with values `LIST = "list"` and `GRID = "grid"` - **Updated Type**: `MessagingExtensionResult.attachment_layout` now uses `MessagingExtensionAttachmentLayout` instead of `AttachmentLayout` - **Preserved Original**: `AttachmentLayout` remains unchanged with `LIST` and `CAROUSEL` for backward compatibility - **Exports**: Added `MessagingExtensionAttachmentLayout` to `messaging_extension/__init__.py` - **Test Updates**: Updated test applications to use the new enum type ## Usage ```python from microsoft.teams.api.models import ( MessagingExtensionAttachmentLayout, MessagingExtensionResult ) result = MessagingExtensionResult( attachment_layout=MessagingExtensionAttachmentLayout.GRID, # New GRID option attachments=[...] ) # AttachmentLayout.CAROUSEL still available for other use cases from microsoft.teams.api.models import AttachmentLayout # Existing code using AttachmentLayout.CAROUSEL continues to work ``` **Note**: This change maintains backward compatibility. Existing code using `AttachmentLayout.CAROUSEL` is not affected. Only messaging extension code needs to migrate to the new `MessagingExtensionAttachmentLayout` type. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > can you change AttachmentLayout to be list | grid instead of list | carousel. Link <a href="microsoft/teams.ts#381" rel="noreferrer noopener" title="microsoft/teams.ts#381" target="_blank">https://github.com/microsoft/teams.ts/pull/381</a> in the PR description. <attachment id="app-preview-card-psc7b00c7e591949669b47bbed5c303ae2"></attachment> </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: heyitsaamir <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the incorrect option
carouselin typeAttachmentLayout. If you use this, Teams doesn't render a response in a search-based message extension.The comment where this is used is correct, the implementation isn't.