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

Customise initial suggestions in Navigation Link to show Pages by default #35104

Open
tellthemachines opened this issue Sep 24, 2021 · 3 comments
Labels
[Block] Navigation Link Affects the Navigation Link Block [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Enhancement A suggestion for improvement.

Comments

@tellthemachines
Copy link
Contributor

What problem does this address?

Prompted by experiments and discussions around Navigation Link block defaults and variations in #34899 and #35056.

When inserting a Navigation Link with no specific variation, the link control should show Pages by default in the initial suggestions. We want to optimise Navigation Link for adding Pages, because that is likely the most used type, while still providing the flexibility to search for other post types or taxonomies in the link control search bar.

What is your proposed solution?

Look into Link Control component to see if any changes are needed there, or if we can pass it parameters to customise the initial suggestions query. (I haven't looked into this beyond noticing there is a showInitialSuggestions prop for LinkControl that is a boolean, and it's not obvious from the list of props if those suggestions can be customised.)

Ideally we'd be able to provide LinkControl with query parameters for the initial suggestions, without limiting subsequent queries from the search bar to those particular parameters.

@tellthemachines tellthemachines added [Block] Navigation Link Affects the Navigation Link Block [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Sep 24, 2021
@jasmussen
Copy link
Contributor

Thank you. One of the challenges with the URL dialog is that it always shows the most recent items, with no option to browse deeper without search. Based on much older explorations by @shaunandrews, can we actually show a scrollable list of pages?

page link

If there are more than n items in total, we could revert back to recent pages (though still show more than 3).

As posted elsewhere, if we know what block type opens the URL dialog, it would be nice to tailor it to that post type:

all

@tellthemachines
Copy link
Contributor Author

Based on much older explorations by @shaunandrews, can we actually show a scrollable list of pages?

We can do that! In fact, scroll is already enabled in the Navigation editor if you'd like to test it 😄

@jasmussen
Copy link
Contributor

jasmussen commented Sep 29, 2021

In fact, scroll is already enabled in the Navigation editor if you'd like to test it 😄

Nice:
Screenshot 2021-09-29 at 09 53 21

For such a constrained context as this, and to ensure both contrast and that the scrollbar doesn't fade out on some systems, I do wish we could leverage a custom styled scrollbar. But last I looked into this, in order to work well, we'd need the scrollbar-gutter feature implemented.

More importantly than scroll, though, I feel like the key problem to solve here is that showing the n most recently published items and then falling back to search, is not a good experience when building page structures. You have to remember the page structure and then re-create it. I understand that inferring what to show based on link variations is maybe not ideal, but it would be great if we found some creative solution that offered a hierarchical list of pages for the nav menu.

Edit: today I learned that ⌘+Enter submits the comment. Therefore most of the above was added in an edit. Sorry about that.

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Link Affects the Navigation Link Block [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants