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

Store: Clean up header on smaller screens #22541

Merged
merged 16 commits into from
Mar 15, 2018
Merged

Conversation

ryelle
Copy link
Member

@ryelle ryelle commented Feb 16, 2018

This PR is just an idea – rather than drop down to icons-only for the action header on smaller screens, or a split button (which we would have to use for all sizes), why not bring back the small site header, and conditionally drop the breadcrumbs?

orders

There are more screenshots in this gallery, some are at 320px wide, and some are around 430px.

Technical details

I've unhidden the SidebarNavigation (that top section with the site icon, name, and section title) on the store screens, and fixed an issue where it was being called twice on a few screens. This also updates ActionHeader to add classes when there are action buttons, and specifically when there are multiple actions (which requires the buttons to be passed as an array).

On screens smaller than 480px wide, if the ActionHeader has…

  • One action, we do nothing - show both breadcrumbs and action button (see order list, product list)
  • Multiple actions, we hide the breadcrumbs (see edit product, single order)
  • No actions, we hide the entire bar, as it's duplicated from the SidebarNavigation above it (see reviews, dashboard)

There is an issue with the section title not updating correctly, I have another PR for that #22501

This was just an idea I had while trying out the orders mobile styling from #17910 – the < from the SidebarNavigation was acting janky (it stayed in place while the page scrolled), so I went to fix that & found this entire component 🙂

@ryelle ryelle added the Store label Feb 16, 2018
@matticbot
Copy link
Contributor

@ryelle ryelle self-assigned this Feb 16, 2018
@ryelle ryelle requested review from jameskoster, kellychoffman and a team February 16, 2018 17:08
@ryelle ryelle added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR labels Feb 16, 2018
@timmyc
Copy link
Contributor

timmyc commented Feb 16, 2018

Screenshots look fab! Eagerly awaiting the designer feedback on this one. Also /cc @shaunandrews for any thoughts on how smaller viewports might handle the new sidebar navigation concepts... maybe he has some designs around this already too.

@shaunandrews
Copy link
Contributor

maybe he has some designs around this already too.

I don't have anything for this yet — we'll likely be using the SidebarNavigation for a while longer. At some point, we may combine it with the sidebar rather than having it as a separate component people need to remember to include.

Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

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

Overall i'm really like how this is working/looking - nice job @ryelle!

I did notice a few minor oddities. The first being when editing an existing product - there is a range between breakpoints where the action button, in this case 'Update' is cut off and off screen. Also note the redundant display of the fact you are Editing a Product:

update-product

Here is another instance where we show the current page/tab action 3x - seems a bit overkill:

shipping 3

I did browse through all views - orders, products, promotions, reviews, and settings and everything was looking quite nice.

@jameskoster
Copy link
Contributor

Nice idea!

I agree with Timmy about the repetition, and I think there's some value in the breadcrumbs so I'd like to see us keep them if possible. How about something that combines the smaller site header / crumbs? Then keep the primary action button in the header and have secondary actions 1 click away via an ellipsis button.

header

@ryelle
Copy link
Member Author

ryelle commented Feb 19, 2018

Trying this out – which means totally refactoring how the ActionHeader component works, but in a good way 🙂 So far it looks like this:

screen shot 2018-02-19 at 2 18 30 pm
screen shot 2018-02-19 at 2 17 53 pm

I'll have to adjust how it looks on larger screens, and I'll switch the actions to a SplitButton. I'll also try to add some smart space detection like the SectionNav does, so the buttons only collapse down at the right time. Switching this back to In Progress while I continue to work on it.

@ryelle ryelle added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR labels Feb 19, 2018
@jameskoster
Copy link
Contributor

Looks good, nice work! :)

I know I'm splitting hairs and it might be more trouble than it's worth, but...

Orders / Order #315 Details

Could just be

Orders / #315

I know we might end up with wrapping on products with long names but it'd be nice if we could strive to avoid it. We might also consider putting a max-width in the crumb trail and fading the overflow to totally rule out wrapping as an alternative.

@timmyc
Copy link
Contributor

timmyc commented Feb 20, 2018

That is looking fantastic @ryelle 😍

@ryelle ryelle force-pushed the update/store-header-small-screen branch from bf39fd8 to 72a5d32 Compare February 22, 2018 16:41
@ryelle
Copy link
Member Author

ryelle commented Feb 22, 2018

Ok, I've got the SplitButton working, it should switch down to the split button when the buttons run out of room. There is a small margin of size where the buttons get cut off, but I want to get feedback on this approach before hammering on CSS more.

Single order with open dropdown
order order-dd
Single button does not split No button does nothing 🙂
settings dashboard

Other sizes:

order-med

order-large

There are some issues that should be fixed in following PRs, maybe with some CSS-savy designer help?

The product category label is too long, pushes off the button At 320px, the split button wraps
prod-category edit-prod-320

@timmyc
Copy link
Contributor

timmyc commented Feb 22, 2018

I think the split button works quite nicely here - but will defer to @kellychoffman / @jameskoster 😁

@kellychoffman
Copy link
Member

Looks amazing! Agree we should fix those other issues in separate PRs.

@ryelle
Copy link
Member Author

ryelle commented Mar 9, 2018

@kellychoffman @jameskoster @shaunandrews @timmyc – I don't think I got a final 👍 / 👎 on whether this should be merged, which is partially my fault since I didn't flip it back to needs review. Knowing that it's not perfect, should this be merged as-is?

@ryelle ryelle force-pushed the update/store-header-small-screen branch from 7a9f27e to fbb79fd Compare March 9, 2018 16:06
@ryelle ryelle added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Mar 9, 2018
@jameskoster
Copy link
Contributor

Thumbs up from me.

I would echo that "Order #318 details" could just be "#318" which would help with potential wrapping.

"Products / Edit Product" could probably be "Products / Edit" as well.

But yeah, we can do that in separate PRs.

Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

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

Took it for another spin, looks great.

@timmyc timmyc added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 12, 2018
@kellychoffman
Copy link
Member

Getting this at around 400px width in Chrome when I shrink my window down:

screen shot 2018-03-13 at 12 54 55 pm

@jameskoster
Copy link
Contributor

Getting this at around 400px width in Chrome when I shrink my window down:

That would be fixed by my suggestion above. If it's not too much work it might be worth including @ryelle

@ryelle ryelle merged commit db309d2 into master Mar 15, 2018
@ryelle
Copy link
Member Author

ryelle commented Mar 15, 2018

That would be fixed by my suggestion above.

Since it's not a single line/single file change, I'd rather see it in a different PR. That also wouldn't fix the issue in the Product / Category page, which was the other issue I mentioned above

@ryelle ryelle deleted the update/store-header-small-screen branch March 15, 2018 14:09
lsinger added a commit that referenced this pull request Mar 15, 2018
alisterscott added a commit to Automattic/wp-e2e-tests that referenced this pull request Mar 16, 2018
Includes fixes for this new toolbar view: Automattic/wp-calypso#22541

To test
`env BROWSERSIZE=desktop ./node_modules/.bin/mocha specs-woocommerce`
`env BROWSERSIZE=mobile ./node_modules/.bin/mocha specs-woocommerce`
alisterscott added a commit to Automattic/wp-e2e-tests that referenced this pull request Mar 19, 2018
Includes fixes for this new toolbar view: Automattic/wp-calypso#22541

To test
`env BROWSERSIZE=desktop ./node_modules/.bin/mocha specs-woocommerce`
`env BROWSERSIZE=mobile ./node_modules/.bin/mocha specs-woocommerce`
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.

6 participants