-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[feature]: product page breadcrumbs #1960
Conversation
|
18b3479
to
73f994c
Compare
I just pushed some big changes to this PR. Rather than have a dropdown for breadcrumbs when there were multiple possible categories on a PDP I now:
Note that the method of selection of which category breadcrumbs to display can cause a jarring display if a user navigated to the PDP by one route and are then shown a different breadcrumb set. See the gifs in the description. |
|
||
// Return the first category id of the potential leaf categories. | ||
// This can potentially be jarring if the user navigated to a product and | ||
// the breadcrumbs don't represent that navigation path. |
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 don't think it'll be jarring at all. Breadcrumbs should be a canonical path to the product as understood by the server (or in this case, estimated by the client using a simple heuristic: first category wins). We don't need to be in the business of showing the user their navigation history. That's what browser history and browser chrome are for.
At any rate, I like this a lot more than the dropdown.
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.
Well I certainly don't want to lead opinion through this comment -- I can remove it and simply say "Until we can get the single canonical breadcrumb path to a product we will just select the first leaf category"
17046a7
to
f504db6
Compare
ffd13b4
to
a13fbe2
Compare
@@ -1,5 +1,11 @@ | |||
fragment ProductDetails on ProductInterface { | |||
__typename | |||
categories { |
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.
As an FYI we should add a comment in here at the top saying that updates to this fragment should be mirrored in getProductDetail
and vice versa.
<Breadcrumbs | ||
categoryId={breadcrumbCategoryId} | ||
currentProduct={productDetails.name} | ||
/> |
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 and the returned prop are the only changes. Everything just shifted cause of the <Fragment>
.
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.
Looks great, have some minor suggestions for optimization and readability.
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.
Hansel and Gretel would be proud, nice work 🍞 🍞 🍞
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.
See #1960 (review)
Description
Based on #1949. This PR adds breadcrumbs to the product page. Main differences:
If a product has multiple categories it will display a dropdown with multiple options.Related Issue
Closes PWA-99.
Acceptance
Verification Stakeholders
@jimbo @schensley
Specification
Verification Steps
Screenshots / Screen Captures (if appropriate)
Checklist