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

Admin bar: Update the Edit Site link #69271

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

Conversation

carolinan
Copy link
Contributor

What?

Partial for #63785
Closes #63784 (based on #63785 (comment))

This PR changes the Edit Site link in the admin bar to point to the top level (the "home") of the Site Editor, instead of opening the current template.

Based on feedback in https://core.trac.wordpress.org/ticket/62368, the Edit Site link also shows in the admin area.
Showing the link while in the admin area makes the admin bar more consistent and makes it easier to use, since you can use your muscle memory.

This PR replaces two stale PR's: #66894 and #63835

How?

By using the filter, the current menu item is replaced, since they share the same id: "site-editor" (There is no need to remove the current menu item first, it is replaced).
The template global and the query args are removed, since they are no longer needed.
The capitalization is changed to Edit Site, to match a change that is already merged in to 6.8: https://core.trac.wordpress.org/ticket/62971

I used 41 as the priority, because it is what was used when the menu item was first added to Gutenberg, in a compat file that has since been deleted. I am not entirely sure what this is based on, but it is probably because themes have priority 40.

Testing Instructions

Activate a block theme.
Confirm that the Edit Site link shows in the admin bar, and that it leads to the Site Editor, without opening a specific template.
Activate a classic theme and confirm that the link does not show.

Screenshots or screencast

This screenshot shows the new link in the admin bar while in the admin area:
image

@carolinan carolinan added the [Type] Enhancement A suggestion for improvement. label Feb 21, 2025
@carolinan carolinan marked this pull request as ready for review February 21, 2025 03:23
Copy link

github-actions bot commented Feb 21, 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: carolinan <[email protected]>
Co-authored-by: shail-mehta <[email protected]>
Co-authored-by: ndiego <[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.

Copy link

Flaky tests detected in 9e2d9b1.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13449892303
📝 Reported issues:

@carolinan carolinan requested a review from richtabor February 21, 2025 11:27
@shail-mehta
Copy link
Member

shail-mehta commented Feb 23, 2025

With Block Theme (Active TT5 Theme):

with-tt5-theme

If Classic Theme Active: (TT1 Theme)

with-classic-theme

@t-hamano t-hamano added the General Interface Parts of the UI which don't fall neatly under other labels. label Feb 26, 2025
@carolinan
Copy link
Contributor Author

carolinan commented Feb 26, 2025

@karmatosed @richtabor @WordPress/gutenberg-design
Hi, the feedback I am looking for regarding this PR is if it is acceptable from your design perspective to show the Edit Site link in the toolbar in the admin area.

Personally I prefer it to show in the admin area, (because I don't have to think). But I believe this is a change where there may be a difference of opinion and I don't want to commit a change that will then be a surprise.

@carolinan carolinan added the Needs Design Feedback Needs general design feedback. label Feb 26, 2025
@carolinan carolinan requested a review from karmatosed February 26, 2025 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When set to a static page "Edit site" should open the assigned homepage
3 participants