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

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

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 <[email protected]>
Co-authored-by: SainathPoojary <[email protected]>
Co-authored-by: noisysocks <[email protected]>
Co-authored-by: fabiankaegy <[email protected]>
Co-authored-by: getdave <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: richtabor <[email protected]>

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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