Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

Aligns with teams.ts PR #381 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

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.

Original prompt

can you change AttachmentLayout to be list | grid instead of list | carousel. Link microsoft/teams.ts#381 in the PR description.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits October 24, 2025 23:17
Copilot AI changed the title [WIP] Change AttachmentLayout to list or grid format Change AttachmentLayout enum from "carousel" to "grid" Oct 24, 2025
Copilot AI requested a review from heyitsaamir October 24, 2025 23:23
Copilot finished work on behalf of heyitsaamir October 24, 2025 23:23
@heyitsaamir
Copy link
Collaborator

@copilot these are not helpful tests. Remove them.

Copy link
Contributor Author

Copilot AI commented Oct 24, 2025

@copilot these are not helpful tests. Remove them.

Removed the test file in commit 1509aa2.

@heyitsaamir heyitsaamir marked this pull request as ready for review October 24, 2025 23:34
Copilot AI review requested due to automatic review settings October 24, 2025 23:34
Copilot finished work on behalf of heyitsaamir October 24, 2025 23:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the AttachmentLayout enum to align with the TypeScript implementation in teams.ts PR #381, changing the enum value from "carousel" to "grid".

Key changes:

  • Updated AttachmentLayout.CAROUSEL to AttachmentLayout.GRID with value "grid"
  • Updated docstring in the with_attachment_layout method to reflect the new enum value

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/api/src/microsoft/teams/api/models/attachment/attachment_layout.py Changed enum member from CAROUSEL = "carousel" to GRID = "grid"
packages/api/src/microsoft/teams/api/activities/message/message.py Updated docstring to reference "grid" instead of "carousel"

@heyitsaamir
Copy link
Collaborator

@copilot revert this change. Then introduce a NEW type called MessagingExtensionAttachmentLayout, and use THAT for the attachmentLayout in MessagingExtensionResult. Don't forget to export types as needed in __init__s.

Copy link
Contributor Author

Copilot AI commented Oct 30, 2025

@copilot revert this change. Then introduce a NEW type called MessagingExtensionAttachmentLayout, and use THAT for the attachmentLayout in MessagingExtensionResult. Don't forget to export types as nee...

Reverted AttachmentLayout back to CAROUSEL and created new MessagingExtensionAttachmentLayout enum with GRID. Updated MessagingExtensionResult to use the new type and exported it in __init__.py files. Changes in commit 37a6a70.

Copilot AI changed the title Change AttachmentLayout enum from "carousel" to "grid" Add MessagingExtensionAttachmentLayout enum with "grid" support Oct 30, 2025
Copilot AI requested a review from heyitsaamir October 30, 2025 03:45
Copilot finished work on behalf of heyitsaamir October 30, 2025 03:45
@heyitsaamir heyitsaamir merged commit 2c6822c into main Oct 30, 2025
9 of 12 checks passed
@heyitsaamir heyitsaamir deleted the copilot/update-attachment-layout-options branch October 30, 2025 04:10
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