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

Add breadcrumbs to cli/commands. #336

Merged
merged 7 commits into from
Dec 1, 2023
Merged

Conversation

StevenDufresne
Copy link
Contributor

This PR adds the breadcrumbs to cli/commands.

I realized after logging an issue that the designs don't have the breadcrumb. However, I don't understand why this page would not have it when the block-editor handbook landing page and other landing pages have it.
It's also linked in deeper nested pages as the parent and last production currently has the breadcrumb there.

Screenshot

localhost_8888_cli_commands_ (1)

Nested Page

localhost_8888_cli_commands_admin_

@StevenDufresne StevenDufresne linked an issue Nov 6, 2023 that may be closed by this pull request
@StevenDufresne
Copy link
Contributor Author

@ndiego Thoughts?

@adamwoodnz adamwoodnz requested a review from a team November 6, 2023 05:37
@adamwoodnz
Copy link
Contributor

If we do add this we'll need to adjust the vertical position of the ToC; it should align with the title.

@adamwoodnz adamwoodnz added this to the MVP milestone Nov 6, 2023
@StevenDufresne
Copy link
Contributor Author

I'm getting no table of contents on the staging env (well, i'm getting the back to top).

Screenshot 2023-11-06 at 2 59 39 PM

@StevenDufresne
Copy link
Contributor Author

Also, if we implement #312, then I imagine it will just work...?

@adamwoodnz
Copy link
Contributor

adamwoodnz commented Nov 6, 2023

Also, if we implement #312, then I imagine it will just work...?

That search bar with bottom border is only for handbook pages if I understand it correctly.

@fcoveram
Copy link

fcoveram commented Nov 6, 2023

…I don't understand why this page would not have it when the block-editor handbook landing page and other landing pages have it.

Breadcrumbs appear from the third level and beyond (Home / Level 2 / Level 3). The idea was to avoid duplicative content as in level 2's pages local nav shows the current page in bold. So in the nested page example, it's correct to show it.

That search bar with bottom border is only for handbook pages if I understand it correctly.

Yes. ← Updating this response as this comment informs about an update of this component. The bottom border in Articles should be removed.

@adamwoodnz
Copy link
Contributor

So in the nested page example, it's correct to show it.

Ah ok, so I think we only need to add this to single-command.html

@StevenDufresne
Copy link
Contributor Author

Breadcrumbs appear from the third level and beyond (Home / Level 2 / Level 3). The idea was to avoid duplicative content as in level 2's pages local nav shows the current page in bold. So in the nested page example, it's correct to show it.

@fcoveram Does that mean it shouldn't be in the block editor handbook?

Screenshot 2023-11-07 at 2 22 54 PM

@fcoveram
Copy link

fcoveram commented Nov 7, 2023

@fcoveram Does that mean it shouldn't be in the block editor handbook?

Exactly.

To assess the change impact, which site sections will have this change? I'm thinking of Developers, Showcase, About WordPress, and News.

The idea of showing it from level 3 is to diminish location redundancy. But in the case of Articles, it feels weird landing on its main page without breadcrumb and then seeing it in all internal pages.

@renintw
Copy link
Contributor

renintw commented Nov 9, 2023

Summarizing the breadcrumb behaviors I've observed while working on another ticket.

Handbook
Only put two here. All handbooks have the same look.
image

level2 level3
Screenshot 2023-11-10 at 12 42 30 AM Screenshot 2023-11-10 at 12 42 37 AM
Screenshot 2023-11-10 at 12 43 21 AM Screenshot 2023-11-10 at 12 43 28 AM

Resource
If clicking on Resource in the breadcrumbs, it would redirect back to Dashicons.
Same in production, visiting Resource page would redirect to Dashicons page.
And there's no breadcrumbs on production, but there's a title though.

local/staging production
Screenshot 2023-11-10 at 12 45 28 AM Screenshot 2023-11-10 at 12 45 35 AM

Reference

local/staging production
Screenshot 2023-11-10 at 12 46 02 AM Screenshot 2023-11-10 at 12 46 08 AM

Functions
Only put Functions CPT here. Other CPTs have the same look.
image

In production, it has 4 levels.
We don't need the 'Reference' level? => Done Adding back.

level2 level3
local/staging Screenshot 2023-11-10 at 12 46 58 AM Screenshot 2023-11-10 at 12 47 25 AM
production Screenshot 2023-11-10 at 12 47 06 AM Screenshot 2023-11-10 at 1 31 58 AM

Taxonomy
There are overall three taxonomies - since, packages, files
image

Same here, in production, it has 4 levels.
We don't need the 'Reference' level? => Done Adding back.

local/staging, files production
Screenshot 2023-11-10 at 12 47 59 AM Screenshot 2023-11-10 at 12 48 07 AM

There's breadcrumbs on packages page, but isn't on since page. => Done Adding back.

packages since
Screenshot 2023-11-10 at 12 48 21 AM Screenshot 2023-11-10 at 1 45 06 AM

The files and since pages can be accessed through the links as indicated below.
Not sure how to access the packages page.

image

CLI/Commands

I guess this is the most standard one in terms of design.
It only renders breadcrumbs when it's level 3.
It also makes sense not to include Reference in breadcrumbs on CLI/Commands page because there's a button on homepage linking to the page.

level2 level3
local/staging Screenshot 2023-11-10 at 12 54 49 AM Screenshot 2023-11-10 at 12 55 07 AM
production Screenshot 2023-11-10 at 12 54 58 AM Screenshot 2023-11-10 at 12 55 11 AM

@adamwoodnz adamwoodnz removed their request for review November 14, 2023 06:46
@adamwoodnz adamwoodnz removed their assignment Nov 20, 2023
@adamwoodnz adamwoodnz marked this pull request as draft November 20, 2023 21:17
@adamwoodnz adamwoodnz removed the request for review from renintw November 21, 2023 04:02
@adamwoodnz adamwoodnz self-requested a review November 21, 2023 04:02
@renintw
Copy link
Contributor

renintw commented Nov 28, 2023

Currently, most of the pages on developer sites display breadcrumbs at 2 levels.
And to be more specific, CLI-Commands page is the only one that doesn’t display at 2 levels.

And after chatting with @fcoveram, we agree that it makes sense to display the breadcrumbs from Home / Level 1. This is also what we have in Showcase for the site details pages.

Note: In our discussion, it was mentioned that how we describe the levels is slightly off.
All the comments above are labeled as Home / Level 2 / Level 3, but they should actually be Home / Level 1 / Level 2.

@renintw renintw force-pushed the try/add-breadcrumb-to-cli branch from 2dea02c to aad6ff7 Compare November 28, 2023 15:03
@renintw
Copy link
Contributor

renintw commented Nov 28, 2023

@adamwoodnz

I have already added the pages missing the Home/Level1 breadcrumbs.
To test, you can refer to the comments above, where I have marked them with ✅.

Additionally, I have temporarily re-added the 'reference' to the breadcrumbs for now.
Without 'reference', the process becomes a bit odd, as users won't be able to navigate back to the reference page from any CPT pages.

Screenshot 2023-11-29 at 1 37 46 AM

However, this PR mentions the original reason for its removal. (Ref)

@StevenDufresne, is this still a concern? Is the reason we need to remove the 'reference' from the breadcrumbs due to the i18n issue, such as the breadcrumbs being too long?

Update
According to Steve's feedback,
It was removed because the page was gone.
Now it can be brought back.

@renintw renintw marked this pull request as ready for review November 28, 2023 17:02
@fcoveram
Copy link

Thanks @renintw for addressing this.

The idea was to avoid duplicative content as in level 1’s pages local nav shows the current page in bold.

That statement shared by me days ago is slightly incorrect. There are L1 pages not displayed in the local nav menu, so displaying them is safer than not. That's the rationale behind this decision.

Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, I like how this simplifies the template setup.

A couple of comments inline.

One more adjustment required now that the CLI Command archive has breadcrumbs; we need to remove this custom ToC spacing rule: https://github.com/WordPress/wporg-developer/blob/trunk/source/wp-content/themes/wporg-developer-2023/src/style/style.scss#L407

Removing that should fix the misaligned ToC and H1:

Screenshot 2023-11-30 at 10 06 48 AM

Since the CLI Command archive has breadcrumbs now,
The misaligned ToC and H1 can be fixed through removing it.
@renintw
Copy link
Contributor

renintw commented Nov 30, 2023

Updated Screenshot

image

@renintw renintw requested a review from adamwoodnz November 30, 2023 15:56
Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@renintw renintw merged commit eafc7a8 into trunk Dec 1, 2023
1 check passed
@renintw renintw deleted the try/add-breadcrumb-to-cli branch December 1, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: Breadcrumb missing.
4 participants