-
Notifications
You must be signed in to change notification settings - Fork 683
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
[feature] category breadcrumbs #1949
Conversation
|
@sirugh I think the implementation and behavior is good based on the fact that GraphQL cannot determine the specific path a shopper took to arrive at the PDP.
|
Consider dropping the back button? Users have a physical back button in their device, browser UI, or gestures. Also probably a good idea to keep the breadcrumbs left aligned, and provide wrapping or overflow because IRL category names get long and they will overflow or wrap (sometimes so badly to the point that you decide to drop breadcrumbs). |
0ed7a59
to
398d5b7
Compare
@schensley updates: |
Hey @schensley, do you have an opinion on the @brendanfalkowski suggestion? On the one hand, It's a best practice for us to keep the navigation obvious. Not all interactions are routable, so not everything works with a browser-based "Back" swipe. But this one does! We don't have Back buttons everywhere. Should we omit this one, or put them everywhere? One argument for explicit Back buttons is that a PWA can be installed to the Home screen. When that happens, the browser navigation goes away! The Back swipe still works (unless something has captured the gesture) but it's still a different runtime, so we shouldn't rely too much on that. |
@zetlen I have since removed the |
A few notes on the UI/UX as we work through this design.
|
|
@schensley added non-functional text for current page to end of breadcrumbs. Also made it so the entire text wraps. See below pictures: |
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.
Given your fondness for Toast, I think we should rename these to Croutons. /s
I think this looks great, just some minor tweaks so we're not hard-coding ourselves into .html
routing (which is already present in existing components). Happy to chat about usages of useMemo
too; I think there is a bigger cost to overusing than not, but that's up for debate.
…_within_ the breadcrumb component rather than in the parent component
@@ -43,6 +45,7 @@ const CategoryContent = props => { | |||
const modal = filters ? <FilterModal filters={filters} /> : null; | |||
return ( | |||
<Fragment> | |||
<Breadcrumbs categoryId={categoryId} /> |
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.
Display breadcrumbs with this one simple prop!
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.
Approved, but would like your general thought about this design.
With moving the data fetch to the component, the re-render after data returns is very noticeable. Is this a state we should always handle? Common pattern is to display an indicator, but I'm foreseeing a future where a pages initial render is a ton of tiny loading indicators everywhere. The alternative of not rendering anything until data returns doesn't seem any better, and would cause layout push. What's the ideal solution here?
- Current State: Partial render (Home /) then re-paint with data
- ^^^ but with indicator until data
- No partial render, render indicator/skel until data
- Render nothing until data
I'd prefer rendering a skeleton until the data returns, so it doesn't shift. Aside — we started developing breadcrumbs before this feature started, and made a couple different UX choices.
This ends up working a lot better on small screens, and doesn't get overloaded until three categories down. |
@brendanfalkowski interesting. I ended up just implementing the design @schensley and I discussed but I think we could iterate on it. I don't think there's any rush to get this feature just yet so we may as well try to get it right the first time! |
@tjwiebell Ah. I can return an empty, styled div so it's height is sized appropriately. It will still cause long (wrapping) crumbs to cause a pop-in though. We can't know the number of links or the length of the text so this is a difficult one. We could always show the last two crumbs in a link and just put some indicator of such before? |
Another thing you can do to shorten the breadcrumb line is omitting the last crumb or putting a non-link (e.g. "here"). Whether it's a category, product, or CMS page that last crumb is usually redundant because the very next thing on screen is an H1 with the same text. This makes a major difference on the product page because unlike categories product names can easily be 50+ characters alone if they have to distinguish variants. |
3b8db1a
to
5b55b9f
Compare
Description
Breadcrumbs endpoint, after 2.3.4, will return
category_url_path
which we can use to generate the link for the breadcrumb. For now, this is just rendering Links and dividers.Related Issue
Closes PWA-98.
Acceptance
Verification Stakeholders
@schensley
Specification
Verification Steps
Home
.Bottoms -> Skirts
). It should render and you should see breadcrumbs for it.Screenshots / Screen Captures (if appropriate)
Checklist