[PR #7692] [MERGED] feat: revamp link preivew #8044

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7692
Author: @asjqkkkk
Created: 4/7/2025
Status: Merged
Merged: 4/10/2025
Merged by: @LucasXu0

Base: mainHead: feat/link_preview


📝 Commits (10+)

  • 4e39e66 feat: revamp link preivew
  • 973a731 feat: add convert to menu for link hover menu
  • 1d98960 feat: add mention link
  • 338c676 feat: support convert preview to mention
  • c5fe9fc feat: add embed link preview
  • 1612b87 fix: some test erros
  • 136e0db Merge branch 'main' into feat/link_preview
  • e21b48b fix: test errors
  • 3eb5b12 fix: some UI issues
  • 8c3ff9f chore: add test for url

📊 Changes

38 files changed (+3564 additions, -167 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/document/document_copy_and_paste_test.dart (+29 -15)
frontend/appflowy_flutter/integration_test/desktop/document/document_link_preview_test.dart (+452 -0)
📝 frontend/appflowy_flutter/integration_test/desktop/document/document_test_runner_4.dart (+2 -0)
📝 frontend/appflowy_flutter/integration_test/desktop/uncategorized/emoji_shortcut_test.dart (+4 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart (+3 -16)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dart (+5 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_html.dart (+2 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_plain_text.dart (+26 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_create_menu.dart (+5 -2)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_hover_menu.dart (+152 -8)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_replace_menu.dart (+184 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart (+286 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_menu.dart (+332 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_parser.dart (+135 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview.dart (+89 -27)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview_block_component.dart (+204 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_preview_menu.dart (+173 -75)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/paste_as/paste_as_menu.dart (+253 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/shared.dart (+172 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_block.dart (+16 -0)

...and 18 more files

📄 Description

  • Type Selection
    • Paste as menu (URL, Mention, Bookmark, Embed)
  • URL
    • Convert to menu(Mention, Bookmark, Embed)
  • Mention
    • Mention link UI(loading, complete)
    • Hover to show the preview menu
      • Internal links preview
      • External links preview
    • Implement Convert to menu(URL, Bookmark, Embed, Remove Link)
  • Bookmark
    • Bookmark UI(default, complete)
    • More options menu(Mention, URL, Embed, Copy Link, Replace, Reload, Remove Link)
  • Embed
    • Embed UI(default, complete)
    • More options menu(Alignment, Open link, Replace, Reload, Remove Link)
      • Alignment
    • Convert to menu(Mention, URL, Bookmark)
    • Fullscreen

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

Revamp the link preview functionality in the document editor, introducing a more flexible and feature-rich link preview system with enhanced UI and interaction capabilities.

New Features:

  • Implement a new link preview menu with multiple conversion options
  • Add a 'Paste as' menu for link types
  • Introduce enhanced link preview UI with loading and error states

Enhancements:

  • Improve link preview component with more robust handling of different link states
  • Add more interactive menu options for link preview
  • Enhance link preview styling and responsiveness

Chores:

  • Refactor link preview and embed block components
  • Update theme and styling configurations

Summary by Sourcery

Revamp the link preview functionality in the document editor, introducing a more flexible and feature-rich link preview system with enhanced UI and interaction capabilities.

New Features:

  • Implement a comprehensive link preview menu with multiple conversion options
  • Add 'Paste as' menu for different link types (URL, Mention, Bookmark, Embed)
  • Introduce enhanced link preview UI with loading and error states
  • Add support for external link mentions

Enhancements:

  • Improve link preview component with more robust handling of different link states
  • Add interactive menu options for link preview
  • Enhance link preview styling and responsiveness
  • Implement flexible link conversion between different types

Chores:

  • Refactor link preview and embed block components
  • Update theme and styling configurations
  • Improve link parsing and caching mechanisms

🔄 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/7692 **Author:** [@asjqkkkk](https://github.com/asjqkkkk) **Created:** 4/7/2025 **Status:** ✅ Merged **Merged:** 4/10/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `feat/link_preview` --- ### 📝 Commits (10+) - [`4e39e66`](https://github.com/AppFlowy-IO/AppFlowy/commit/4e39e66f4b33c6bebfd4d620ef5b5c92722d06fd) feat: revamp link preivew - [`973a731`](https://github.com/AppFlowy-IO/AppFlowy/commit/973a731b6964cd9297907eb0f4b29a2bf71f63e5) feat: add convert to menu for link hover menu - [`1d98960`](https://github.com/AppFlowy-IO/AppFlowy/commit/1d98960fbe456b3be1924cf0f5aa1de7997fb428) feat: add mention link - [`338c676`](https://github.com/AppFlowy-IO/AppFlowy/commit/338c676c83c47de4b884af817ffc57bc8754a8b4) feat: support convert preview to mention - [`c5fe9fc`](https://github.com/AppFlowy-IO/AppFlowy/commit/c5fe9fcc02c2e385b1e725b22bbfa2ee79ee4de2) feat: add embed link preview - [`1612b87`](https://github.com/AppFlowy-IO/AppFlowy/commit/1612b870c38bcc6f6a424f08c1895464fc3d5224) fix: some test erros - [`136e0db`](https://github.com/AppFlowy-IO/AppFlowy/commit/136e0dbb7da710590936bd68eaa7cfa62b46761e) Merge branch 'main' into feat/link_preview - [`e21b48b`](https://github.com/AppFlowy-IO/AppFlowy/commit/e21b48b7d373c78e2334ae502a2f43d682a4ed50) fix: test errors - [`3eb5b12`](https://github.com/AppFlowy-IO/AppFlowy/commit/3eb5b12a53c537f122742ca9a695f08e60af6f1b) fix: some UI issues - [`8c3ff9f`](https://github.com/AppFlowy-IO/AppFlowy/commit/8c3ff9fa8f6ca0ec80ba4a4406302c8716975103) chore: add test for url ### 📊 Changes **38 files changed** (+3564 additions, -167 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_copy_and_paste_test.dart` (+29 -15) ➕ `frontend/appflowy_flutter/integration_test/desktop/document/document_link_preview_test.dart` (+452 -0) 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_test_runner_4.dart` (+2 -0) 📝 `frontend/appflowy_flutter/integration_test/desktop/uncategorized/emoji_shortcut_test.dart` (+4 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart` (+3 -16) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dart` (+5 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_html.dart` (+2 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_plain_text.dart` (+26 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_create_menu.dart` (+5 -2) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_hover_menu.dart` (+152 -8) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_replace_menu.dart` (+184 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart` (+286 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_menu.dart` (+332 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_parser.dart` (+135 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview.dart` (+89 -27) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview_block_component.dart` (+204 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_preview_menu.dart` (+173 -75) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/paste_as/paste_as_menu.dart` (+253 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/shared.dart` (+172 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_block.dart` (+16 -0) _...and 18 more files_ </details> ### 📄 Description - [x] Type Selection - [x] `Paste as` menu (URL, Mention, Bookmark, Embed) - [x] URL - [x] `Convert to` menu(Mention, Bookmark, Embed) - [x] Mention - [x] Mention link UI(loading, complete) - [x] Hover to show the preview menu - [ ] Internal links preview - [x] External links preview - [x] Implement `Convert to` menu(URL, Bookmark, Embed, Remove Link) - [x] Bookmark - [x] Bookmark UI(default, complete) - [x] `More options` menu(Mention, URL, Embed, Copy Link, Replace, Reload, Remove Link) - [x] Embed - [x] Embed UI(default, complete) - [x] `More options` menu(Alignment, Open link, Replace, Reload, Remove Link) - [ ] Alignment - [x] `Convert to` menu(Mention, URL, Bookmark) - [ ] Fullscreen ### 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 - [x] 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. - [x] 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 Revamp the link preview functionality in the document editor, introducing a more flexible and feature-rich link preview system with enhanced UI and interaction capabilities. New Features: - Implement a new link preview menu with multiple conversion options - Add a 'Paste as' menu for link types - Introduce enhanced link preview UI with loading and error states Enhancements: - Improve link preview component with more robust handling of different link states - Add more interactive menu options for link preview - Enhance link preview styling and responsiveness Chores: - Refactor link preview and embed block components - Update theme and styling configurations ## Summary by Sourcery Revamp the link preview functionality in the document editor, introducing a more flexible and feature-rich link preview system with enhanced UI and interaction capabilities. New Features: - Implement a comprehensive link preview menu with multiple conversion options - Add 'Paste as' menu for different link types (URL, Mention, Bookmark, Embed) - Introduce enhanced link preview UI with loading and error states - Add support for external link mentions Enhancements: - Improve link preview component with more robust handling of different link states - Add interactive menu options for link preview - Enhance link preview styling and responsiveness - Implement flexible link conversion between different types Chores: - Refactor link preview and embed block components - Update theme and styling configurations - Improve link parsing and caching mechanisms --- <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:21 +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#8044
No description provided.