Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search results in chat box is cutting off tall items #1823

Open
catmanjan opened this issue Jul 4, 2023 · 32 comments
Open

Search results in chat box is cutting off tall items #1823

catmanjan opened this issue Jul 4, 2023 · 32 comments

Comments

@catmanjan
Copy link

catmanjan commented Jul 4, 2023

I logged this item before and it went away, but its happening again, we have search result cards which have Title, Subtitle, Text

If the Title is more than one line, the subtitle is cut off - it seems to be hardcoded to only show 4 lines

58b42906-8b81-4e8d-8b36-d3688322a59c

@ghost
Copy link

ghost commented Jul 4, 2023

Hi catmanjan! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

@ghost ghost added the needs triage 🔍 label Jul 4, 2023
@ghost ghost added this to Needs triage in Issue Triage Jul 4, 2023
@Prasad-MSFT
Copy link

@catmanjan - Thanks for raising this. We will check it and will get back to you shortly with our findings.

@Prasad-MSFT
Copy link

@catmanjan - We checked this at our end in MS Teams desktop client Microsoft Teams Version 1.6.00.17673 and it looked as below:
image

var previewcard = new ThumbnailCard
            {
                Title = "Adaptive Card supports only Incoming Webhook O365 Connector type and not any other O365 Connector types.For Adaptive Cards in Incoming Webhooks, all native Adaptive Card schema elements, except Action.Submit, are fully supported. You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces",
                Subtitle = "An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.Media elements are currently not supported in Adaptive Card on the Teams platform.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.",
                Text = "Teams platform supports v1.5 or earlier of Adaptive Card features for bot sent cards and action based message extensions.",
                Images = new List<CardImage> { new CardImage { Url = "https://fastly.picsum.photos/id/650/200/300.jpg?hmac=iNg9Umek-SwBR_yU0igvABZSTcRJFdhp1zyaqp0PdIw" } },

            };

@catmanjan
Copy link
Author

@Prasad-MSFT I seem to recall you couldn't reproduce the issue with one result in your search, in our case we have thousands

See screenshot showing latest version and issue still occurs

image

@ghost ghost moved this from Needs triage to Waiting For User Response in Issue Triage Jul 6, 2023
@Prasad-MSFT
Copy link

@catmanjan - As you can see in our case also the subtitle field text shows in single line below title text.
image

This behaviour seems to be by design.

@catmanjan
Copy link
Author

@Prasad-MSFT try it but return 100 cards instead of just 1.

@catmanjan
Copy link
Author

@Prasad-MSFT if you look in my screenshot the number of lines of text that are shown is variable depending on how many lines the title is.

I am sure you will be able to reproduce this if you returned several search results and compared how it displays to when you only return 1.

@Prasad-MSFT
Copy link

@catmanjan - We have tried with multiple search results and if you can notice from each row, the first two lines are being occupied by title field, followed by one line of subtitle
image

var previewcard = new ThumbnailCard
            {
                Title = "Adaptive Card supports only Incoming Webhook O365 Connector type and not any other O365 Connector types.For Adaptive Cards in Incoming Webhooks, all native Adaptive Card schema elements, except Action.Submit, are fully supported. You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces",
                Subtitle = "An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.Media elements are currently not supported in Adaptive Card on the Teams platform.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.",
                Text = "Teams platform supports v1.5 or earlier of Adaptive Card features for bot sent cards and action based message extensions.",
                Images = new List<CardImage> { new CardImage { Url = "https://fastly.picsum.photos/id/650/200/300.jpg?hmac=iNg9Umek-SwBR_yU0igvABZSTcRJFdhp1zyaqp0PdIw" } },

            };

@catmanjan
Copy link
Author

How many was multiple? Try 100

@Prasad-MSFT
Copy link

@catmanjan - We have more than 30 search results
image

@catmanjan
Copy link
Author

@Prasad-MSFT do you have more than 99?

@Prasad-MSFT
Copy link

No, it isn't. Do you mean to say it is not cutting off if the search result is nearly 30-40? Is it only showing cut off if its more than ~90? Did you check with ~30-40 search result?

@catmanjan
Copy link
Author

@Prasad-MSFT the behavior is different for a larger number of results - I don't know what that number is or why, it probably is related to whatever number Teams deems to be a "page" of results

Try 100 results as I have suggested above THREE times now and let me know what you see.

@Prasad-MSFT
Copy link

Okay @catmanjan, we will try that and also if you don't mind could you please share the code snippet which you are using having title, subtitle text having queryOptions to get more than 25 results (Currently by default is 25)?

@catmanjan
Copy link
Author

@Prasad-MSFT I don't have a code snippet, this is running in production

@Prasad-MSFT
Copy link

@catmanjan - In our code we are able to see nearly 25 search results. We couldn't show more than that. It would have been great if we get the code which implements showing more than by default 25 search results.

@catmanjan
Copy link
Author

@Prasad-MSFT this is production code so I can't give you a snippet, can you just generate 100 results and trigger paging to occur? I don't think we do anything special for this to happen - Teams seems to just detect that there are more than a page of results and then only server the first page and do a second request to get additional ones...

@Prasad-MSFT
Copy link

Prasad-MSFT commented Jul 14, 2023

@catmanjan - We have used this code

namespace Microsoft.BotBuilderSamples.Bots
{
    public class TeamsMessagingExtensionsSearchBot : TeamsActivityHandler
    {
        public readonly string _baseUrl;
        public TeamsMessagingExtensionsSearchBot(IConfiguration configuration) : base()
        {
            this._baseUrl = configuration["BaseUrl"];
        }

        protected override async Task<MessagingExtensionResponse> OnTeamsMessagingExtensionQueryAsync(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionQuery query, CancellationToken cancellationToken)
        {
            var text = query?.Parameters?[0]?.Value as string ?? string.Empty;

            switch (text)
            {
                case "adaptive card":
                    MessagingExtensionResponse response = GetAdaptiveCard();
                    return response;

                case "connector card":
                    MessagingExtensionResponse connectorCard = GetConnectorCard();
                    return connectorCard;

                case "result grid":
                    MessagingExtensionResponse resultGrid = GetResultGrid();
                    return resultGrid;
            }

            var packages = await FindPackages(text);

            // We take every row of the results and wrap them in cards wrapped in MessagingExtensionAttachment objects.
            // The Preview is optional, if it includes a Tap, that will trigger the OnTeamsMessagingExtensionSelectItemAsync event back on this bot.
            var attachments = packages.Select(package =>
            {
                var previewCard = new ThumbnailCard {
                    //Title = package.Item1,
                    Title = "Adaptive Card supports only Incoming Webhook O365 Connector type and not any other O365 Connector types.For Adaptive Cards in Incoming Webhooks, all native Adaptive Card schema elements, except Action.Submit, are fully supported. You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces.You can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly bracesYou can pass dynamic values in an Adaptive Card using the dollar symbol ($) and curly braces",
                    Subtitle = "An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.Media elements are currently not supported in Adaptive Card on the Teams platform.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.An Adaptive Card is a customizable card that can contain any combination of text, speech, images, buttons, and input fields.",
                    Text = "Teams platform supports v1.5 or earlier of Adaptive Card features for bot sent cards and action based message extensions.",
                    Images = new List<CardImage> { new CardImage { Url = "https://fastly.picsum.photos/id/650/200/300.jpg?hmac=iNg9Umek-SwBR_yU0igvABZSTcRJFdhp1zyaqp0PdIw" } },

                    Tap = new CardAction { Type = "invoke", Value = package } };

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

                var attachment = new MessagingExtensionAttachment
                {
                    ContentType = HeroCard.ContentType,
                    Content = new HeroCard { Title = package.Item1 },
                    Preview = previewCard.ToAttachment()
                };

                return attachment;
            }).ToList();

            // The list of MessagingExtensionAttachments must be wrapped in a MessagingExtensionResult wrapped in a MessagingExtensionResponse.
            return new MessagingExtensionResponse
            {
                ComposeExtension = new MessagingExtensionResult
                {
                    Type = "result",
                    AttachmentLayout = "list",
                    Attachments = attachments
                }
            };
        }

        protected override Task<MessagingExtensionResponse> OnTeamsMessagingExtensionSelectItemAsync(ITurnContext<IInvokeActivity> turnContext, JObject query, CancellationToken cancellationToken)
        {
            // The Preview card's Tap should have a Value property assigned, this will be returned to the bot in this event. 
            var (packageId, version, description, projectUrl, iconUrl) = query.ToObject<(string, string, string, string, string)>();

            // We take every row of the results and wrap them in cards wrapped in in MessagingExtensionAttachment objects.
            // The Preview is optional, if it includes a Tap, that will trigger the OnTeamsMessagingExtensionSelectItemAsync event back on this bot.

            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 }
                }
            });
        }

        private async Task<IEnumerable<(string, string, string, string, string)>> FindPackages(string text)
        {
            var allPackages = new List<(string, string, string, string, string)>();
            var pageSize = 100;
            var pageNumber = 0;

            while (true)
            {
                var obj = JObject.Parse(await (new HttpClient()).GetStringAsync($"https://azuresearch-usnc.nuget.org/query?q=id:{text}&prerelease=true&$top={pageSize}&$skip={pageNumber * pageSize}"));
                var packages = obj["data"].Select(item => (item["id"].ToString(), item["version"].ToString(), item["description"].ToString(), item["projectUrl"]?.ToString(), item["iconUrl"]?.ToString()));

                allPackages.AddRange(packages);

                if (packages.Count() < pageSize)
                {
                    break; // Reached the end of results
                }

                pageNumber++;
            }

            return allPackages;
        }

        public MessagingExtensionResponse GetAdaptiveCard()
        {
            var paths = new[] { ".", "Resources", "RestaurantCard.json" };
            string filepath = Path.Combine(paths);
            var previewcard = new ThumbnailCard
            {
                Title = "Adaptive Card",
                Text = "Please select to get Adaptive card"
            };
            var adaptiveList = FetchAdaptive(filepath);
            var attachment = new MessagingExtensionAttachment
            {
                ContentType = "application/vnd.microsoft.card.adaptive",
                Content = adaptiveList.Content,
                Preview = previewcard.ToAttachment()
            };

            return new MessagingExtensionResponse
            {
                ComposeExtension = new MessagingExtensionResult
                {
                    Type = "result",
                    AttachmentLayout = "list",
                    Attachments = new List<MessagingExtensionAttachment> { attachment }
                }
            };
        }
        public MessagingExtensionResponse GetConnectorCard()
        {
            var path = new[] { ".", "Resources", "connectorCard.json" };
            var filepath = Path.Combine(path);
            var previewcard = new ThumbnailCard
            {
                Title = "O365 Connector Card",
                Text = "Please select to get Connector card"
            };

            var connector = FetchConnector(filepath);
            var attachment = new MessagingExtensionAttachment
            {
                ContentType = O365ConnectorCard.ContentType,
                Content = connector.Content,
                Preview = previewcard.ToAttachment()
            };

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

        public Attachment FetchAdaptive(string filepath)
        {
            var adaptiveCardJson = File.ReadAllText(filepath);
            var adaptiveCardAttachment = new Attachment
            {
                ContentType = "application/vnd.microsoft.card.adaptive",
                Content = JsonConvert.DeserializeObject(adaptiveCardJson)
            };
            return adaptiveCardAttachment;
        }

        public Attachment FetchConnector(string filepath)
        {
            var connectorCardJson = File.ReadAllText(filepath);
            var connectorCardAttachment = new MessagingExtensionAttachment
            {
                ContentType = O365ConnectorCard.ContentType,
                Content = JsonConvert.DeserializeObject(connectorCardJson),

            };
            return connectorCardAttachment;
        }

        public MessagingExtensionResponse GetResultGrid()
        {
            var imageFiles = Directory.EnumerateFiles("wwwroot", "*.*", SearchOption.AllDirectories)
            .Where(s => s.EndsWith(".jpg"));

            List<MessagingExtensionAttachment> attachments = new List<MessagingExtensionAttachment>();

            foreach (string img in imageFiles)
            {
                var image = img.Split("\\");
                var thumbnailCard = new ThumbnailCard();
                thumbnailCard.Images = new List<CardImage>() { new CardImage(_baseUrl + "/" + image[1]) };
                var attachment = new MessagingExtensionAttachment
                {
                    ContentType = ThumbnailCard.ContentType,
                    Content = thumbnailCard,
                };
                attachments.Add(attachment);
            }
            return new MessagingExtensionResponse
            {
                ComposeExtension = new MessagingExtensionResult
                {
                    Type = "result",
                    AttachmentLayout = "grid",
                    Attachments = attachments
                }
            };
        }
    }
}

and it gives nearly 25 results on search. We are not sure how to generate more than 100 results. Though we have implemented loop, still it returns default result. Could you please let us know the way you are implementing? Is it the same way?

In response we are getting as below:

"value": {
        "commandId": "searchQuery",
        "parameters": [
            {
                "name": "initialRun",
                "value": "true"
            }
        ],
        "queryOptions": {
            "count": 25,
            "skip": 0
        }
    },

@catmanjan
Copy link
Author

@Prasad-MSFT I can see you set Title and Subtitle but nowhere do you set the Text

@Prasad-MSFT
Copy link

@catmanjan - That was the sample formatted code snippet which we shared just to show you how we are using loop to get more search results and adding pagination.

Anyway, I have updated the actual code snippet which we are using, You can refer that.

@catmanjan
Copy link
Author

@Prasad-MSFT okay here is my equivalent function - not sure what you'll need to cherry pick from it to reproduce the issue though...

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

                var imageType = "FOLDER";

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

                var secureEmoji = "";

                if (result.Secure)
                {
                    secureEmoji = @" 🛡";
                }

                var relevancyPart = "";

                if (result.Metadata.Score != null)
                {
                    relevancyPart = $" | Relevancy: {(int) result.Metadata.Score}%";
                }

                // the adapativeMetadataElements below are the ones that will be appear after selecting a search result
                var adaptiveMetadataElements = new List<AdaptiveElement>
                {
                    new AdaptiveTextBlock()
                    {
                        Text = $"[{result.Title!.Raw}]({result.Url.Raw})",
                        Size = AdaptiveTextSize.Medium,
                        Weight = AdaptiveTextWeight.Bolder,
                        Spacing = AdaptiveSpacing.None
                    },
                    new AdaptiveTextBlock()
                    {
                        Text = $"Modified: {result.Metadata!.LastUpdated:d MMMM yyyy} | Creator: {result.CreatedBy?.Raw}",
                        Size = AdaptiveTextSize.Small,
                        Weight = AdaptiveTextWeight.Lighter,
                        Spacing = AdaptiveSpacing.None,
                        Wrap = true
                    },
                    new AdaptiveTextBlock()
                    {
                        Text = $"{result.Breadcrumb?.Raw}{secureEmoji}",
                        Size = AdaptiveTextSize.Small,
                        Weight = AdaptiveTextWeight.Lighter,
                        Spacing = AdaptiveSpacing.None,
                        Wrap = true
                    }
                };

                // thumbnailCard is what appears in search results right after entering a query
                // thumbnailCard is identical to card, but Title is never a link, as links are not clickable in compose action search results
                var thumbnailCard = new ThumbnailCard
                {
                    Title = $"<div style=\"font-weight:600; word-break:break-word;\" title=\"Click here to view options\">{result.Title?.Raw}</div>",
                    Subtitle = $"<div style=\"word-break:break-word;\" title=\"Click here to view options\">{result.Body?.Snippet}</div>",
                    Text = $"<div style=\"word-break:break-word; white-space:nowrap; overflow:hidden;\" title=\"Click here to view options\">Modified: {result.Metadata!.LastUpdated:d MMMM yyyy} | Creator: {result.CreatedBy?.Raw}{relevancyPart}<br>{result.Breadcrumb?.Raw}{secureEmoji}</div>",
                    Images = new List<CardImage> { new CardImage { Url = $"{_hydraUrl}/icon/{imageType}" } }
                };

                var adaptiveCard = new AdaptiveCard(new AdaptiveSchemaVersion(1, 3))
                {
                    Body = new List<AdaptiveElement>()
                    {
                        new AdaptiveColumnSet()
                        {
                            Columns = new List<AdaptiveColumn>()
                            {
                                // Icon Column
                                new AdaptiveColumn()
                                {
                                    Height = AdaptiveHeight.Auto,
                                    Width = AdaptiveColumnWidth.Auto,
                                    Items = new List<AdaptiveElement>()
                                    {
                                        new AdaptiveImage()
                                        {
                                            Url = new Uri($"{_hydraUrl}/icon/{imageType}"),
                                            Size = AdaptiveImageSize.Medium,
                                            Style = AdaptiveImageStyle.Default
                                        }
                                    }
                                },
                                // metadata column
                                new AdaptiveColumn()
                                {
                                    Height = AdaptiveHeight.Auto,
                                    Width = AdaptiveColumnWidth.Stretch,
                                    Items = adaptiveMetadataElements
                                }
                            }
                        },
                        new AdaptiveTextBlock()
                        {
                            Text = result.Body.Snippet?.Replace("<b>", "").Replace("</b>", ""),
                            Size = AdaptiveTextSize.Default,
                            Weight = AdaptiveTextWeight.Default,
                            Wrap = true
                        }
                    }
                };

                var actions = new List<AdaptiveAction>();

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

                    if (!string.IsNullOrEmpty(result.EditUrl?.Raw) && !string.IsNullOrEmpty(protocol))
                    {
                        var editUrl = HttpUtility.UrlEncode($"{protocol}:ofe|u|{result.EditUrl.Raw}");

                        actions.Add(new AdaptiveOpenUrlAction()
                        {
                            Title = "Edit",
                            Url = new Uri($"{_teamsBotUrl}/launch.html?link={editUrl}")
                        });
                    }

                    // manage is only for items with a file and not in content manager
                    if (!result.Secure)
                    {
                        var downloadUrl = HttpUtility.UrlEncode(_hydraUrl + "/api/v1/file/download?ContentSourceId=" + result.Metadata?.ContentSourceId + "&Id=" + result.Metadata?.Id);
                        var callbackUrl = HttpUtility.UrlEncode($"{_hydraUrl}/api/v1/manage");
                        var manageUrl = HttpUtility.UrlEncode($"{_rmWorkspaceUrl}/external/record/IngressForm?Url={downloadUrl}&ContentSourceId={result.Metadata.ContentSourceId}&Id={result.Metadata.Id}&CallbackUrl={callbackUrl}");
                        var tokenUrl = $"{_hydraUrl}/api/v1/token/redirect?url={manageUrl}";

                        // only non CM records can be managed
                        actions.Add(new AdaptiveOpenUrlAction()
                        {
                            Title = "Protect Document",
                            Url = new Uri(tokenUrl)
                        });
                    }
                }

                if (result.Secure)
                {
                    // this is a CM document so we should show the properties form instead
                    var propertiesUrl = $"{_rmWorkspaceUrl}/external/record/IngressForm?Uri={result.Metadata.Id}";

                    // only CM records can show a properties
                    actions.Add(new AdaptiveOpenUrlAction()
                    {
                        Title = "Record Properties",
                        Url = new Uri(propertiesUrl)
                    });
                }

                // item is previewable.
                if (ExtensionHasPreview(result.Extension.Raw))
                {
                    /*
                     * To do a popup view we can make use of a deeplink which functions like the action below and we just set the url to be of the format:
                     * 
                     * https://teams.microsoft.com/l/task/{appid}?url={url}&height=700&width=1000&title={Some title which will appear under the app's name}
                     * 
                     * The height and width doesn't seem to be modifyable after the window is launched so we want to pick something sensible.
                     */

                    var previewUrl = $"{_hydraUrl}/api/v1/preview?ContentSourceId={result.Metadata.ContentSourceId}&DocumentId={result.Metadata.Id}";

                    // add "deeplink" preview
                    actions.Add(new AdaptiveOpenUrlAction()
                    {
                        Title = "Preview",
                        Url = new Uri($"https://teams.microsoft.com/l/task/{_microsoftAppId}?url={HttpUtility.UrlEncode(previewUrl)}&height=700&width=1000&title=Preview&inTeamsSSO=True")
                    });
                }

                // add actions to card
                adaptiveCard.Actions = actions;

                var attachment = new MessagingExtensionAttachment
                {
                    ContentType = AdaptiveCard.ContentType,
                    Content = adaptiveCard,
                    // this function correctly adds the content type for the preview
                    Preview = thumbnailCard.ToAttachment()
                };

                return attachment;
            });

            return new MessagingExtensionResponse
            {
                ComposeExtension = new MessagingExtensionResult
                {
                    Type = "result",
                    AttachmentLayout = "list",
                    Attachments = attachments.ToList()
                }
            };

@catmanjan
Copy link
Author

catmanjan commented Jul 20, 2023

@Prasad-MSFT in our Text we have a <br> so that may be the issue?

Note that this behavior is different on the web version of Teams which shows as many lines as it needs...

@Prasad-MSFT
Copy link

@catmanjan - I don't think <br> is causing any issue and I am afraid we are not able to repro the issue still.
And also do you mean to say your issue only happens in Teams desktop client? It does work in web?
If that's the case, please do share the snapshot of both marking the difference, so that we can act further or raise bug for this

@catmanjan
Copy link
Author

@Prasad-MSFT yes the Teams desktop client only shows 4 lines maximum as my original screenshot shows - my web version of teams seems to impose no limit whatsoever and will show 20 lines...

Here is the web version, and the desktop version is in the original ticket

image

@Prasad-MSFT
Copy link

Yes @catmanjan - Looking at the provided screenshot it seems like it behaves differently in web and desktop client.
Will it be possible for you to share any deployed app manifest or demo credentials to test, so that engineering team can check the root cause of the issue and suggest accordingly? (Asking this because we don't have repro, so it will be difficult for engineering team to analyse only with screenshot provided)

@catmanjan
Copy link
Author

@Prasad-MSFT no I can't - but I'm happy to be invited to a screen sharing session where I can let them take control of my machine.

@Prasad-MSFT
Copy link

If that's not possible @catmanjan, please do share a screen record showing the behaviour of both web and desktop client, so that we can pass on that to engineering team.

@catmanjan
Copy link
Author

See attached, now its gone the other way - the web version shows less text than the desktop version,....

screen-recorder-fri-jul-28-2023-10-43-55.webm

@Prasad-MSFT
Copy link

We have already raised bug with your previously provided screenshots. Now as per your response it behaves other way around. Thats quite strange
Not sure why there is discrepancy in behaviour.
Anyway, as we have already raised bug, we will inform you once we get any further update from engineering team. Thanks!

@catmanjan
Copy link
Author

bump

@catmanjan
Copy link
Author

HELLOOOOOO

@Prasad-MSFT
Copy link

Apologies. We still haven't got any update from engineering team. We have updated the severity of the bug and hopefully will hear back soon from engineering team. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue Triage
  
Waiting For User Response
Development

No branches or pull requests

4 participants