[PR #8048] [MERGED] fix: improve the link menu in read-only mode #8280

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/8048
Author: @asjqkkkk
Created: 6/10/2025
Status: Merged
Merged: 6/12/2025
Merged by: @LucasXu0

Base: mainHead: fix/lr/issues


📝 Commits (2)

  • 464fcc0 fix: improve the link menu in read-only mode
  • 29378d9 chore: change the tooltip of database fullscreen icon

📊 Changes

8 files changed (+86 additions, -40 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/toolbar/view_database_button.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_hover_menu.dart (+33 -16)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_menu.dart (+31 -21)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_preview_menu.dart (+6 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_block.dart (+4 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_error_preview.dart (+2 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_preview.dart (+8 -1)
📝 frontend/resources/translations/en-US.json (+1 -0)

📄 Description

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

Centralize read-only handling in link menus by introducing an editable flag, disabling interactive actions and popovers while preserving copy functionality.

Bug Fixes:

  • Disable convert, edit, remove, and more-option popovers when the editor is in read-only mode.
  • Restrict mention and custom link preview menus to only allow the copy action in read-only mode.

Enhancements:

  • Introduce an editable flag in link and mention widgets to toggle interactive behavior based on editor state.
  • Add a getTapCallback utility and transparent hover styling to centrally disable buttons in read-only mode.
  • Propagate the editable state through link embed, hover, and mention components to unify behavior across menus.

🔄 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/8048 **Author:** [@asjqkkkk](https://github.com/asjqkkkk) **Created:** 6/10/2025 **Status:** ✅ Merged **Merged:** 6/12/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `fix/lr/issues` --- ### 📝 Commits (2) - [`464fcc0`](https://github.com/AppFlowy-IO/AppFlowy/commit/464fcc0d940df8a29c5ae18774183b2af97057b2) fix: improve the link menu in read-only mode - [`29378d9`](https://github.com/AppFlowy-IO/AppFlowy/commit/29378d961fa173f84ab05092203e81da45add5c4) chore: change the tooltip of database fullscreen icon ### 📊 Changes **8 files changed** (+86 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/toolbar/view_database_button.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_hover_menu.dart` (+33 -16) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_menu.dart` (+31 -21) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/link_preview_menu.dart` (+6 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_block.dart` (+4 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_error_preview.dart` (+2 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_link_preview.dart` (+8 -1) 📝 `frontend/resources/translations/en-US.json` (+1 -0) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### 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. - [ ] 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 Centralize read-only handling in link menus by introducing an editable flag, disabling interactive actions and popovers while preserving copy functionality. Bug Fixes: - Disable convert, edit, remove, and more-option popovers when the editor is in read-only mode. - Restrict mention and custom link preview menus to only allow the copy action in read-only mode. Enhancements: - Introduce an `editable` flag in link and mention widgets to toggle interactive behavior based on editor state. - Add a `getTapCallback` utility and transparent hover styling to centrally disable buttons in read-only mode. - Propagate the `editable` state through link embed, hover, and mention components to unify behavior across menus. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:23:27 +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#8280
No description provided.