Commit graph

59 commits

Author SHA1 Message Date
Copilot 72f9e981de Replace YouTube iframe embeds with clickable thumbnails (#1474)
Some checks failed
main / pack (DiscordChatExporter.Cli, DiscordChatExporter.Cli, win-x86) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, linux-arm) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, linux-arm64) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, linux-musl-x64) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, linux-x64) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, osx-arm64) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, osx-x64) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, win-arm64) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, win-x64) (push) Has been cancelled
main / pack (DiscordChatExporter.Gui, DiscordChatExporter, win-x86) (push) Has been cancelled
main / release (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, linux-arm) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, linux-arm64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, linux-musl-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, linux-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, osx-arm64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, osx-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, win-arm64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, win-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Cli, DiscordChatExporter.Cli, win-x86) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, linux-arm) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, linux-arm64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, linux-musl-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, linux-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, osx-arm64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, osx-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, win-arm64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, win-x64) (push) Has been cancelled
main / deploy (DiscordChatExporter.Gui, DiscordChatExporter, win-x86) (push) Has been cancelled
main / notify (push) Has been cancelled
* Initial plan

* 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>

* Address code review feedback

- Use hqdefault.jpg instead of maxresdefault.jpg (guaranteed to exist for all videos)
- Extract thumbnail URL logic to GetThumbnailUrl method for better testability

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>

* Simplify YouTube embed test to focus on data not structure

- Remove checks for HTML structure (class names, nested elements)
- Focus on verifying YouTube URL with correct video ID exists
- Follow same pattern as other embed tests (Spotify, Twitch)

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>

* Fix data-canonical-url and improve test specificity

- Use canonical (non-proxy) URL for data-canonical-url attribute
- Extract thumbnailUrl to local variable to avoid duplicate calls
- Update test to check for img with video ID in src, avoiding false positives
- Test now verifies the actual thumbnail data rather than any link

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>

* Inline thumbnail URL logic directly into attributes

- Remove GetThumbnailUrl method from YouTubeVideoEmbedProjection
- Remove local variables from template
- Put coalescing logic directly in src and data-canonical-url attributes

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
2026-02-12 19:04:17 +02:00
Tyrrrz 6fb197cf0b Refactor 2025-04-02 00:34:52 +03:00
Leonardo Mosquera 7add81a472
Don't consider it an error if there is nothing to export (#1349) 2025-04-02 00:14:35 +03:00
Tyrrrz f31e73bb7a Unify whitespace characters to fix tests 2025-02-04 00:17:57 +02:00
Oleksii Holub 789e5af8ba
Include inline emoji in JSON export (#1311) 2024-11-06 19:23:40 +02:00
Tyrrrz 09e0b3f133 Format stuff 2024-10-26 21:41:16 +03:00
Oleksii Holub b9c1c47474
Migrate to Avalonia (#1220) 2024-04-27 04:17:46 +03:00
Oleksii Holub 7c04db40f8
Skip Twitch clip projections because they can't be rendered locally (#1200) 2024-02-13 18:59:51 +02:00
Oleksii Holub 4588bd0496
Add support for Twitch embed projections (#1199) 2024-02-13 18:48:15 +02:00
Tyrrrz 9b8985a920 Fix tests 2024-01-18 20:39:54 +02:00
Tyrrrz 014712b747 Reorder tests 2024-01-18 20:25:30 +02:00
Oleksii Holub d8e43d89be
Add support for has:invite filter that matches messages with guild invites (#1188) 2024-01-18 20:24:25 +02:00
Tyrrrz 982ba6a76c Fix tests 2024-01-11 23:28:11 +02:00
Tyrrrz 182f24846b Use new array syntax 2024-01-11 22:21:53 +02:00
Tyrrrz 4e3deb409c Update NuGet packages 2023-12-29 00:08:16 +02:00
Tyrrrz 062427d143 Make test assertions more relaxed in terms of user-made content URLs 2023-12-26 02:40:50 +02:00
Tyrrrz fbfff4e51f Make tests more resilient 2023-09-28 19:18:52 +03:00
Oleksii Holub 59344cedbe
Replace the date format option with a locale option (#1130) 2023-09-07 14:34:08 +03:00
Tyrrrz 20f58963a6 Use CSharpier 2023-08-22 21:17:19 +03:00
Tyrrrz d02649773e Fix tests 2023-06-08 16:53:03 +03:00
Tyrrrz e7310274ba Clean up tests 2023-05-25 18:51:49 +03:00
Tyrrrz a4111c184e Better test naming 2023-05-20 07:32:21 +03:00
Tyrrrz 31c7ae9312 Refactor 2023-05-20 07:09:19 +03:00
Tyrrrz 8bc1bcaf16 Render linked videos as embeds in HTML
Related to #1012
2023-03-10 16:17:35 +02:00
Tyrrrz 95c5a43f6e Fix more sticker tests 2023-02-23 01:05:26 +02:00
Tyrrrz 91afded824 Fix sticker tests 2023-02-23 01:04:29 +02:00
Tyrrrz d9a78d8e27 Add support for replies to app interactions
Closes #569
2023-02-16 01:50:24 +02:00
Tyrrrz 191294b4fe Render guild invites in HTML
Closes #649
2023-02-14 21:22:07 +02:00
Tyrrrz 2a5e09bf07 Use a fixed timezone in tests 2023-02-12 17:43:45 +02:00
Tyrrrz d99958a9b1 Add support for different formats in the timestamp markdown node
Closes #662
2023-02-12 16:12:41 +02:00
Tyrrrz 53b8927fce Get rid of xUnit fixtures 2023-02-11 23:12:15 +02:00
Tyrrrz 049338009e Render server cross-posts properly
Closes #633
2023-02-09 18:44:24 +02:00
Oleksii Holub e7d80688aa Fix tests 2023-02-08 18:36:03 +02:00
Oleksii Holub 90c68e3cde More namespace refactoring 2023-02-06 15:57:08 +02:00
Oleksii Holub 9dc81b93da Refactor test namespaces 2023-02-06 15:43:04 +02:00
Tyrrrz 560a069c35 Refactor, rename the concept of "download media" to "download assets", including related mentions 2022-10-29 17:39:53 +03:00
Tyrrrz 9c2a26aa82 Fix tests 2022-09-13 18:32:31 +03:00
Tyrrrz f376028d76 Add tests for gifv embeds 2022-09-13 18:09:56 +03:00
Oleksii Holub 23e1850d15 Render consecutive twitter embeds as on
Closes #695
2022-06-30 20:56:44 +03:00
Oleksii Holub 057902f919 More test stuff 2022-06-30 19:07:11 +03:00
Oleksii Holub 565fb53d3b Cleanup tests 2022-06-30 18:13:14 +03:00
Oleksii Holub edba9f36a7 Hide message content in HTML when linking to an image
Closes #695
2022-06-29 21:43:43 +03:00
Oleksii Holub 356b1a6afd Don't use records for spec classes 2022-06-29 20:49:51 +03:00
Oleksii Holub 70edc8989c Add test for plain image embed 2022-06-29 20:38:48 +03:00
Oleksii Holub 9182c3d934 Fix tests 2022-06-29 12:59:20 +03:00
Oleksii Holub 3661c42df4 Fix tests by fixing typo in last commit 2022-06-10 22:32:16 +03:00
Oleksii Holub 005c1786ec Fix tests 2022-06-10 22:23:20 +03:00
Oleksii Holub 17b548d679 Add test for last change 2022-05-18 20:19:46 +03:00
Oleksii Holub 71876febf8 Use attachment description as alt text in html
Closes #805
2022-04-09 02:52:57 +03:00
Oleksii Holub eb0c61e173 Try to fix remaining test 2022-04-09 02:35:07 +03:00