Skip to content

Conversation

@andrewconnell
Copy link
Contributor

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 is correct, the implementation isn't.

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.
@andrewconnell andrewconnell changed the title Change AttachmentLayout type to replace 'carousel' with correct value: 'grid' [🐞fix] Change AttachmentLayout type to replace 'carousel' with correct value: 'grid' Oct 24, 2025
@heyitsaamir heyitsaamir merged commit e60c260 into microsoft:main Oct 25, 2025
5 checks passed
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]>
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