Skip to content
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

LinkControl: Provides better way to see the full URLs #61589

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

amitraj2203
Copy link
Contributor

What?

Fixes: #61158

Why?

Using the 'Copy link' button tooltip to display the full URL of the link is a no-go for accessibility. Fir example, a very long URL displayed within a tooltip isn't a great user experience.

How?

This PR introduces a new function, trimLongURL, which employs various URL processing techniques which is similar to Classic Permalink editing UI. It intelligently shortens long URLs for improved display.

Testing Instructions

  1. Open a post or page.
  2. Edit it and add the navigation block.
  3. Within the navigation block, click on any of the page link
  4. Click on the Links which is available in Block Toolbar

Screenshots or screencast

Earlier to see the full URL, we have to use the tooltip:
image


After:
image

@amitraj2203 amitraj2203 requested a review from getdave as a code owner May 11, 2024 09:56
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: amitraj2203 <amitraj2203@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@amitraj2203 amitraj2203 changed the title LinkControl: Trims URL for better way to see the full URLs LinkControl: Provides better way to see the full URLs May 12, 2024
@afercia afercia added [Type] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LinkControl: Provide better way to see the full URLs
2 participants