Replace YouTube iframe with clickable thumbnail

- Changed YouTube embed URL from embed format to watch format
- Added ThumbnailUrl property to YouTubeVideoEmbedProjection using YouTube's standard thumbnail URL
- Updated MessageGroupTemplate to render thumbnail image with link instead of iframe
- Updated CSS to style thumbnail appropriately
- Updated test to check for anchor link and thumbnail image instead of iframe

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-12 09:16:56 +00:00
parent d185363322
commit c3f89c45b1
4 changed files with 32 additions and 7 deletions
@@ -181,8 +181,24 @@ public class HtmlEmbedSpecs
);
// Assert
var iframeUrl = message.QuerySelector("iframe")?.GetAttribute("src");
iframeUrl.Should().StartWith("https://www.youtube.com/embed/qOWW4OlgbvE");
var youtubeLink = message
.QuerySelectorAll("a")
.FirstOrDefault(e =>
e.GetAttribute("href")?.Contains("youtube.com/watch?v=", StringComparison.Ordinal)
== true
);
youtubeLink.Should().NotBeNull();
youtubeLink?.GetAttribute("href").Should().Contain("qOWW4OlgbvE");
// Check that the thumbnail image exists
var thumbnail = youtubeLink
?.QuerySelectorAll("img")
.FirstOrDefault(e =>
e.GetAttribute("class")?.Contains("chatlog__embed-youtube-thumbnail") == true
);
thumbnail.Should().NotBeNull();
}
[Fact]