Teams command bar integration bot shows See More and See Less button for no reason

Copper Contributor

Teams command bar integration bot shows "See More" and "See Less" button for no reason

 

Clicking the buttons has no effect

 

How do we remove these buttons? Seems to appear no matter what length the message is

 

https://i.imgur.com/SmagXGz.png 

16 Replies
@catmanjan2010 - Could you please sharevthe repro steps to repro this issue?

@Nivedipa-MSFT develop a command bar integration which returns the following card

 

            var card = new ThumbnailCard
            {
                Title = "title",
                Subtitle = "subtitle",
                Text = "text",
                Images = new List<CardImage> { new CardImage { Url = $"someimagehere" } }
            };

            return new MessagingExtensionResponse
            {
                ComposeExtension = new MessagingExtensionResult
                {
                    Type = "result",
                    AttachmentLayout = "list",
                    Attachments = new[]
                    {
                        new MessagingExtensionAttachment
                        {
                            ContentType = ThumbnailCard.ContentType,
                            Content = card,
                            Preview = card.ToAttachment()
                        }
                    }
                }
            };

 

 

no matter how long the strings you provide are the see more/see less buttons appear 

@catmanjan2010 - Could you please elaborate on command bar integration? Share any document reference?
Are you trying to implement messaging extension and in preview you are getting this see less and see more options?
Could you please share how you are doing command bar integration?
It helps us to repro the issue.

@catmanjan2010 - We have tested this, but we are not getting any see more and see less button.

NivedipaMSFT_0-1667214394013.png


And used below code:

var card = new ThumbnailCard
{
Title = $"{packageId}, {version}",
Subtitle = description,
Buttons = new List<CardAction>
{
new CardAction { Type = ActionTypes.OpenUrl, Title = "Nuget Package", Value = $"https://www.nuget.org/packages/{packageId}" },
new CardAction { Type = ActionTypes.OpenUrl, Title = "Project", Value = projectUrl },
},
};

if (!string.IsNullOrEmpty(iconUrl))
{
card.Images = new List<CardImage>() { new CardImage(iconUrl, "Icon") };
}

var attachment = new MessagingExtensionAttachment
{
ContentType = ThumbnailCard.ContentType,
Content = card,
};

return Task.FromResult(new MessagingExtensionResponse
{
ComposeExtension = new MessagingExtensionResult
{
Type = "result",
AttachmentLayout = "list",
Attachments = new List<MessagingExtensionAttachment> { attachment }
}
});


Could you please update Teams version and check again. 

Looks like you're sending chat messages, my screenshot and original post says I am reproducing the issue in the command bar.
@catmanjan2010 - In messaging extension search in preview message we are not getting see more and see less option.
Could you please share your screen recording for getting know whichever we are doing it's the right way or not?

@Nivedipa-MSFT I notice in your sample you are not setting the Text parameter, I believe this is what is causing the issue:

catmanjan2010_0-1667510120898.png

 

 

@catmanjan2010 - We have tested with text property but still we are not getting see more and see less button.

 

NivedipaMSFT_0-1667823762612.png

We have tested this on Teams Desktop version 1.5.00.30306 and web version.

We have used below code

var card = new ThumbnailCard
{
Title = $"{packageId}, {version}",
Text="This is adaptive card",
Subtitle = description,
Images = new List<CardImage> { new CardImage { Url = $"https://raw.githubusercontent.com/microsoft/botframework-sdk/master/icon.png" } }

};

if (!string.IsNullOrEmpty(iconUrl))
{
card.Images = new List<CardImage>() { new CardImage(iconUrl, "Icon") };
}

var attachment = new MessagingExtensionAttachment
{
ContentType = ThumbnailCard.ContentType,
Content = card,
};

return Task.FromResult(new MessagingExtensionResponse
{
ComposeExtension = new MessagingExtensionResult
{
Type = "result",
AttachmentLayout = "list",
Attachments = new List<MessagingExtensionAttachment> { attachment }
}
});


Could you please share your card code to test at our end?

@Nivedipa-MSFT Here is a screenshot of what I see, I am not sure what element is causing it but its definitely happening

 

The only difference I see between mine and yours is my add in name appears in my card, I have a custom size image and buttons

 

Untitled.png

 

var attachments = response.Results.Select(result =>
{
	var buttons = new List<CardAction>();
	var titleString = result.Title?.Raw;

	// check for links
	if (!string.IsNullOrEmpty(result.Extension?.Raw))
	{
		var protocol = result.Extension.Raw.ToOfficeProtocol();

		if (!string.IsNullOrEmpty(result.EditUrl?.Raw) && !string.IsNullOrEmpty(protocol))
		{
			buttons.Add(new CardAction(
				"openUrl",
				"Edit",
				image: $"{_hydraUri}/icon/{result.Icon.Raw}",
				value: $"{_teamsBotUri}/launch.html?link="));
		}
	}

	buttons.Add(new CardAction("openUrl", "Manage", value: $"{_teamsBotUri}/Manage"));

	if (!string.IsNullOrEmpty(result.Url.Raw))
	{
		titleString = $"<a href='{result.Url.Raw}'>{titleString}</a>";
	}

	var imageType = "FOLDER";

	if (result.Icon != null)
	{
		imageType = result.Icon.Raw;
	}

	var card = new ThumbnailCard
	{
		Title = titleString,
		Subtitle = result.Body?.Snippet,
		Text = result.Metadata?.ContentSourceId,
		Images = new List<CardImage> { new CardImage { Url = $"{_hydraUri}/icon/{imageType}" } },
		Buttons = buttons
	};

	var attachment = new MessagingExtensionAttachment
	{
		ContentType = ThumbnailCard.ContentType,
		Content = card,
		Preview = card.ToAttachment()
	};

	return attachment;
});

return new MessagingExtensionResponse
{
	ComposeExtension = new MessagingExtensionResult
	{
		Type = "result",
		AttachmentLayout = "list",
		Attachments = attachments.ToList()
	}
};
@catmanjan2010 - Could you please share the Teams version on which you are testing this?
You have Microsoft Teams Version 1.5.00.28567 (64-bit). It was last updated on 01/11/2022.
@catmanjan2010 - Could you please share your custom size images so we can test with these images?

@Nivedipa-MSFT the image file is 256x256 but when its drawn in teams it seems to be auto scaled

@catmanjan2010 - We have tested this image with fixed size 256x256 but still we are not getting see more button.
Please refer below image. Are you testing this on public version of Teams?

NivedipaMSFT_5-1669360884705.png

 

@catmanjan2010 - Could you please confirm if you are using public version or any other version of Teams?