-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix: the link name should be a required field #7915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis pull request enforces that the link name is a required field by updating the logic to use the link itself as the display text if the name is empty, and adds integration tests to verify these behaviors. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @asjqkkkk - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -186,8 +186,11 @@ class _LinkHoverTriggerState extends State<LinkHoverTrigger> { | |||
linkInfo: LinkInfo(name: title, link: href, isPage: isPage), | |||
onDismiss: () => editMenuController.close(), | |||
onApply: (info) => editorState.applyLink(selection, info), | |||
onRemoveLink: (linkinfo) => | |||
onRemoveAndReplaceLink(editorState, selection, linkinfo.name), | |||
onRemoveLink: (linkinfo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Extract display-text fallback into a LinkInfo helper
The fallback linkinfo.name.isEmpty ? linkinfo.link : linkinfo.name
is duplicated here and in link_extension. Add a LinkInfo.displayText
getter to centralize this logic.
Feature Preview
PR Checklist
Summary by Sourcery
Require the link name field for links, defaulting to the link URL if the name is empty, and add tests to validate link editing and removal scenarios.
Bug Fixes:
Tests: