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

Link Control: Add content and media filtering tabs #68439

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

Infinite-Null
Copy link
Contributor

@Infinite-Null Infinite-Null commented Dec 31, 2024

Closes: #63683

What?

This update adds tab-based filtering to the link control interface, introducing "Content" and "Media" tabs to better organize link suggestions.

Why?

The current link control interface displays all link suggestions in a single list, making it challenging for users to find specific types of content quickly. By introducing tabs to filter between content types and media, we can improve the user experience by:

  • Making it easier to find specific types of content
  • Creating a clearer mental model of content organization

How?

  • Added two new tabs to the link control interface:

    • "Content" tab (default) - displays all post types and taxonomies
    • "Media" tab - displays only media items
  • Implemented tab-based filtering using the existing WordPress tab control component

Testing Instructions

  1. Open the Block Editor

  2. Insert any block that supports links (e.g., Paragraph)

  3. Click the link button from the block toolbar

  4. Verify that you see two tabs: "Content" and "Media"

  5. Test the Content tab:

    • Confirm it shows posts, pages, and other content types
    • Verify search functionality works within this context
  6. Test the Media tab:

    • Confirm it only shows media items
    • Verify search functionality filters media items appropriately

Screencast

Screen.Recording.2025-01-02.at.11.45.51.AM.mov

@Infinite-Null Infinite-Null marked this pull request as ready for review January 2, 2025 06:54
Copy link

github-actions bot commented Jan 2, 2025

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: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: SainathPoojary <sainathpoojary@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: noisysocks <noisysocks@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>

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

@Infinite-Null
Copy link
Contributor Author

I've implemented a solution in this PR that introduces "Content" and "Media" tabs to help users more efficiently find and select links.

I would greatly appreciate you could test and review this implementation. Please let me know if you'd like me to make any adjustments.

Looking forward to your feedback.

cc: @jameskoster, @getdave, @jasmussen, @t-hamano, @richtabor, @noisysocks, @fabiankaegy, @SainathPoojary

@SainathPoojary
Copy link
Contributor

Thank you for this PR! I’ve tested it and everything is working well for me. The implementation feels seamless.

2025-01-02.12-45-27.mp4

@getdave
Copy link
Contributor

getdave commented Jan 9, 2025

This looks like a good initial implementation.

I'd love to be able to dig into this but unfortunately I won't have the time to look into this in the near future as I have reduced availability over the upcoming months.

@Mamaduka Mamaduka added [Type] Regression Related to a regression in the latest release [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Jan 13, 2025
@adamsilverstein
Copy link
Member

Have you thought about the edge case where there are no items in the media library (for example a new install)?

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) [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give posts (any type) higher priority in link search results
5 participants