-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Identify the site frontpage in link UI search results #36493
Conversation
This PR changes the editor settings. We need to be very careful to avoid typing performance degradation. |
Size Change: +142 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
@@ -138,6 +145,7 @@ function useBlockEditorSettings( settings, hasTemplate ) { | |||
outlineMode: hasTemplate, | |||
__experimentalCreatePageEntity: createPageEntity, | |||
__experimentalUserCanCreatePages: userCanCreatePages, | |||
pageOnFront, |
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.
@adamziel Would you mind confidence checking me here? A previous PR I created introduced a typing performance degradation because the useMemo
was recomputed too frequently. Do you see any possibility of this change causing that?
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.
On the first sight it seems safe – I don't suppose pageOnFront will change that often. What's your previous PR? I'd like to compare the two.
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.
This one (owch!)
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.
I commented with my assessment there. pageOnFront
seems to be be safe as it is a number, not a function (As long as it's not a NaN
). Full disclosure, I didn't test it before writing this comment.
@@ -283,6 +283,7 @@ $preview-image-height: 140px; | |||
font-size: 0.9em; | |||
background-color: $gray-100; | |||
border-radius: 2px; | |||
white-space: nowrap; // tags shouldn't go over two lines. |
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.
@javierarce I updated it
@javierarce I think some of the misalignment here looks less than optimal... |
Oh, true :/ And it looks worse when the page is surrounded by more items. I'd suggest getting rid of the icon. We could try to find a different way to highlight that particular item, but as a first step, I think we could just rely on the tag (which, now that I think about it, I think shouldn't be capitalized). |
Yeh it's a shame because felt the icon was doing a good job of highlighting it. But yes we can use Let's iterate. I need a 👍 from a tech review next because this PR touches editor settings and that's liable to introduce perf regressions. |
39eb4bd
to
50b8c0b
Compare
@javierarce I removed the icon and made the tag lowercase. |
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.
Checked this PR again and works fine 🚀
Seeking a Technical review here now. |
Description
This PR scratches a personal itch.
When searching for a page using the Link UI it is not always clear which one of the results is your "Home" page (i.e. the one set as "Front page" in WPAdmin
Settings -> Reading
.This PR updates the UI to
Front page
on that search result.This makes it a lot easier to see when you have the correct page. The primary use case is when your page is called
Home
and you search for "Home" - it's now a lot clearer that you are about to set the correct page.How has this been tested?
Home
.Make me one please
.Settings -> Reading
.Home
page to be the Front page.Make me one please
page as the front page.Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).