[PR #7731] [MERGED] fix: link_preview launch review issues #8074

Closed
opened 2026-03-23 23:22:29 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7731
Author: @asjqkkkk
Created: 4/11/2025
Status: Merged
Merged: 4/14/2025
Merged by: @LucasXu0

Base: mainHead: fix/link_preview


📝 Commits (10+)

  • 3bc85c2 fix: some link_preview launch review issues
  • ed41672 fix: some UI issues
  • e710fc1 chore: pasting a link will not check whether it is an image
  • 8a892cc fix: copy link to block not supported well
  • 5668f02 fix: mention UI issues
  • acb1c5a feat: support get youtube channel info
  • be3b0a8 chore: update translation
  • 321bdf1 feat: add shadow in appflowy theme
  • 686b50e chore: remove AFThemeExtensionV2
  • 7dfad56 fix: some UI issues

📊 Changes

48 files changed (+838 additions, -550 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/document/document_copy_and_paste_test.dart (+3 -13)
📝 frontend/appflowy_flutter/integration_test/desktop/document/document_link_preview_test.dart (+5 -4)
📝 frontend/appflowy_flutter/lib/core/helpers/url_launcher.dart (+12 -10)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart (+0 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart (+5 -11)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_toolbar_item.dart (+6 -5)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/delta/text_delta_extension.dart (+7 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_create_menu.dart (+11 -14)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart (+74 -50)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_menu.dart (+34 -12)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_parser.dart (+43 -27)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview.dart (+67 -63)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview_block_component.dart (+94 -104)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/default_selectable_mixin.dart (+77 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_parsers/default_parser.dart (+88 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_parsers/youtube_parser.dart (+86 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_preview_cache.dart (+0 -25)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/paste_as/paste_as_menu.dart (+23 -17)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_block.dart (+26 -10)

...and 28 more files

📄 Description

Fix :

  • Revise the error message when an embed cannot be loaded properly
  • Make Embed clickable
  • After pasted as a URL, the enter key isn’t available
  • Can not have 2 columns of bookmarks by dragging 1 column next to another one
  • Bookmark and Embed within a callout doesn’t look good in darkmode
  • Open a link that doesn’t include https will not show errors
  • Remove AFThemeExtensionV2
  • The site name should be appended after the logo
  • Copy link to block not supported well
  • GitHub logo in darkmode has a contrast problem

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Improve link preview and embed functionality in the document editor, addressing various usability and visual issues

New Features:

  • Add selectable mixin for link preview and embed components
  • Implement more robust link parsing and loading mechanism

Bug Fixes:

  • Fix error handling for link previews and embeds
  • Improve URL loading and error display
  • Resolve issues with link preview in dark mode callouts
  • Fix URL launching for links without https scheme

Enhancements:

  • Make link previews and embeds more interactive
  • Add better error state handling for link loading
  • Improve link preview and embed UI responsiveness
  • Enhance link preview clickability

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/7731 **Author:** [@asjqkkkk](https://github.com/asjqkkkk) **Created:** 4/11/2025 **Status:** ✅ Merged **Merged:** 4/14/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `fix/link_preview` --- ### 📝 Commits (10+) - [`3bc85c2`](https://github.com/AppFlowy-IO/AppFlowy/commit/3bc85c2423d4ea88a3cf09527bdb9580e090146d) fix: some link_preview launch review issues - [`ed41672`](https://github.com/AppFlowy-IO/AppFlowy/commit/ed41672e6b660e3a5a866c37b11cfd08e70c20cb) fix: some UI issues - [`e710fc1`](https://github.com/AppFlowy-IO/AppFlowy/commit/e710fc1d5ca8046d49e5a88e114689e1da07eea3) chore: pasting a link will not check whether it is an image - [`8a892cc`](https://github.com/AppFlowy-IO/AppFlowy/commit/8a892cc1cd6217f6c869efa5a10807ef1ac173c2) fix: copy link to block not supported well - [`5668f02`](https://github.com/AppFlowy-IO/AppFlowy/commit/5668f02e069ebde32fbe8b1d600f655edefc21a4) fix: mention UI issues - [`acb1c5a`](https://github.com/AppFlowy-IO/AppFlowy/commit/acb1c5a22d647c5d34b016aa179ca4d5b3bc8cdb) feat: support get youtube channel info - [`be3b0a8`](https://github.com/AppFlowy-IO/AppFlowy/commit/be3b0a8cdcda0cf7b5a0bbfa8cbf8ee1f1e9092d) chore: update translation - [`321bdf1`](https://github.com/AppFlowy-IO/AppFlowy/commit/321bdf1cc50c9adb5bf0b7277b483cfa3526c0b4) feat: add shadow in appflowy theme - [`686b50e`](https://github.com/AppFlowy-IO/AppFlowy/commit/686b50ed3db1f344d8e4ee31db5d5374e010be0d) chore: remove AFThemeExtensionV2 - [`7dfad56`](https://github.com/AppFlowy-IO/AppFlowy/commit/7dfad567ed9c053d84559c0a49803adc5f99f72f) fix: some UI issues ### 📊 Changes **48 files changed** (+838 additions, -550 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_copy_and_paste_test.dart` (+3 -13) 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_link_preview_test.dart` (+5 -4) 📝 `frontend/appflowy_flutter/lib/core/helpers/url_launcher.dart` (+12 -10) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart` (+0 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart` (+5 -11) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_toolbar_item.dart` (+6 -5) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/delta/text_delta_extension.dart` (+7 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_create_menu.dart` (+11 -14) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart` (+74 -50) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_menu.dart` (+34 -12) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_parser.dart` (+43 -27) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview.dart` (+67 -63) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview_block_component.dart` (+94 -104) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/default_selectable_mixin.dart` (+77 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_parsers/default_parser.dart` (+88 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_parsers/youtube_parser.dart` (+86 -0) ➖ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_preview_cache.dart` (+0 -25) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/paste_as/paste_as_menu.dart` (+23 -17) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_block.dart` (+26 -10) _...and 28 more files_ </details> ### 📄 Description Fix : - Revise the error message when an embed cannot be loaded properly - Make Embed clickable - After pasted as a URL, the enter key isn’t available - Can not have 2 columns of bookmarks by dragging 1 column next to another one - Bookmark and Embed within a callout doesn’t look good in darkmode - Open a link that doesn’t include https will not show errors - Remove AFThemeExtensionV2 - The site name should be appended after the logo - Copy link to block not supported well - GitHub logo in darkmode has a contrast problem ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [ ] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. ## Summary by Sourcery Improve link preview and embed functionality in the document editor, addressing various usability and visual issues New Features: - Add selectable mixin for link preview and embed components - Implement more robust link parsing and loading mechanism Bug Fixes: - Fix error handling for link previews and embeds - Improve URL loading and error display - Resolve issues with link preview in dark mode callouts - Fix URL launching for links without https scheme Enhancements: - Make link previews and embeds more interactive - Add better error state handling for link loading - Improve link preview and embed UI responsiveness - Enhance link preview clickability --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:22:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8074
No description provided.