Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

Introduce a new messaging extension-specific attachment layout type with grid support alongside list, aligning with teams.ts PR #381.

Changes

  • New MessageExtensions.AttachmentLayout: Created a new type specifically for messaging extensions with List and Grid constants
  • MessageExtensions.Result: Updated to use the new MessageExtensions.AttachmentLayout type instead of Api.Attachment.Layout
  • Attachment.Layout: Preserved the original type with List and Carousel constants unchanged
  • Samples: Updated sample code to use the new MessageExtensions.AttachmentLayout type
  • Documentation: Added comprehensive README for the MessageExtensions sample with Teams manifest configuration instructions

Usage

var result = new MessageExtensions.Result
{
    Type = ResultType.Result,
    AttachmentLayout = MessageExtensions.AttachmentLayout.Grid,  // New messaging extension-specific type
    Attachments = attachments
};

This approach separates concerns:

  • General Attachment.Layout keeps List and Carousel for general attachments
  • Messaging-extension-specific MessageExtensions.AttachmentLayout has List and Grid for messaging extensions

Documentation

The new README (Samples/Samples.MessageExtensions/README.md) provides:

  • Complete setup instructions for Azure Bot Service
  • Teams app manifest configuration with all message extension commands
  • Local development setup with dev tunnels or ngrok
  • Detailed usage examples for all message extension types
  • Troubleshooting guide

> [!WARNING]
>
>

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 changed the title [WIP] Change AttachmentLayout to list and grid Change AttachmentLayout from carousel to grid Oct 24, 2025
Copilot AI requested a review from heyitsaamir October 24, 2025 23:51
Copilot finished work on behalf of heyitsaamir October 24, 2025 23:51
@heyitsaamir heyitsaamir marked this pull request as ready for review October 24, 2025 23:57
@heyitsaamir
Copy link
Collaborator

@copilot remove the tests. they're not helpful.

Copy link
Contributor Author

Copilot AI commented Oct 25, 2025

@copilot remove the tests. they're not helpful.

Removed in 2a95369

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • token.botframework.com
    • Triggering command: /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/teams.net/teams.net/Tests/Microsoft.Teams.Apps.Tests/bin/Debug/net9.0/Microsoft.Teams.Apps.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/teams.net/teams.net/Tests/Microsoft.Teams.Apps.Tests/bin/Debug/net9.0/Microsoft.Teams.Apps.Tests.deps.json /home/REDACTED/work/teams.net/teams.net/Tests/Microsoft.Teams.Apps.Tests/bin/Debug/net9.0/testhost.dll --port 40369 --endpoint 127.0.0.1:040369 --role client --parentprocessid 3842 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of heyitsaamir October 25, 2025 00:02
@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 ne...

Done in 5182bb1. Reverted Attachment.Layout to have Carousel, created new MessageExtensions.AttachmentLayout type with List and Grid, and updated Result.cs and sample code to use the new type.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • token.botframework.com

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Change AttachmentLayout from carousel to grid Add MessageExtensions.AttachmentLayout type with grid support Oct 30, 2025
Copilot finished work on behalf of heyitsaamir October 30, 2025 03:46
@heyitsaamir
Copy link
Collaborator

I attest that no verification is required

aacebo
aacebo previously approved these changes Nov 6, 2025
@rido-min
Copy link
Member

@copilot add a README with instructions to configure the Teams Manifest to validate the MessageExtensions sample

Copy link
Contributor Author

Copilot AI commented Nov 10, 2025

@copilot add a README with instructions to configure the Teams Manifest to validate the MessageExtensions sample

Added comprehensive README in 3d75a6a with:

  • Complete Teams manifest configuration for all message extension features
  • Azure Bot Service setup instructions
  • Local development setup with dev tunnels/ngrok
  • Step-by-step app installation guide
  • Usage examples and troubleshooting

Copilot AI requested a review from rido-min November 10, 2025 16:06
Copilot finished work on behalf of rido-min November 10, 2025 16:06
@rido-min
Copy link
Member

@heyitsaamir When using AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.Grid, I got an invisible grid (but clickable).

Can we update the sample code to show how to use this new layout?

@heyitsaamir
Copy link
Collaborator

@heyitsaamir When using AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.Grid, I got an invisible grid (but clickable).

Can we update the sample code to show how to use this new layout?

@rido-min As discussed offline, the reason is that the thumbnail field is required for it ti show up in Grid mode

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.

4 participants