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

[EuiBreadcrumbs] Always show collapsed items & Amsterdam update to [EuiHeaderBreadcrumbs] #3578

Merged
merged 13 commits into from
Jun 10, 2020

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jun 8, 2020

Part 3/3 for next iteration of K8 support (Amsterdam breadcrumbs)

Digging into the styles and render of EuiBreadcrumbs led me down the path add some enhancements/changes to the component itself.

1. Always show collapsed items when max is set

I removed the old showMaxPopover prop and instead made this the default render method of the breadcrumbs. It's a much better design to allow users to always be able to navigate all breadcrumbs at any time.

It also changes the display of the collapsed item slightly to simply show a down arrow next to the ellipsis.

Before
Screen Shot 2020-06-08 at 16 13 52 PM

After
Screen Shot 2020-06-08 at 16 14 54 PM

2. Responsive breadcrumbs always show collapsed items

Before, the responsive nature of breadcrumbs would hide the display of items with CSS as the window width got smaller. Again this meant that the user could never view or get to the earlier breadcrumbs in the list which could then become mostly unhelpful for them.

Screen Recording 2020-06-08 at 04 20 PM

Now, I'm adjusting max property depending on the width of the browser and the current breakpoint (if responsive is true of course).

Screen Recording 2020-06-08 at 04 21 PM

Which also lead me to need the creation of a global responsive/breakpoint service/helper so that it's also easy for consumers to override the specific breakpoints.

3. Amsterdam theme

Because we found usages of EuiBreadcrumbs outside of the header, for example in EuiControlBar, we decided to only update the EuiHeaderBreadcrumbs to the more stylized version for Amsterdam.

Screen Shot 2020-06-08 at 16 26 38 PM

Screen Shot 2020-06-08 at 16 26 50 PM

Other Code Considerations

A. I didn't consider the removal of showMaxPopover to be a breaking change since this behavior is always on now. It will just alert consumers that the prop no longer exists.
B. Renamed Breadcrumb prop export to EuiBreadcrumb (is this considered a break?)
C. Created a euiButtonDefaultStyle() mixin for Amsterdam's transparent background style buttons for reuse on other components like the header breadcrumbs.
D. This doesn't tackle any accessibility issues since it's already become such a large PR. We can do a follow-up. cc @myasonik

Breaking change:

Changed breadcrumb TS type exported name from Breadcrumb to EuiBreadcrumb

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Safari and Firefox
  • Props have proper autodocs
  • Added documentation
  • Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

cchaos added 4 commits June 5, 2020 15:57
- Added BREAKPOINTS and breakpoint types in `/services`
- Add all props and fixup examples
- Breadcrumb become EuiBreadcrumb
- Fixes contrast for EuiControlBar’s usage (not perfect)
Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Functional changes look fantastic 🎉

Before I jump too far into the review, the only thing that looked a bit odd to me visually was using the caret dropdown for the ... stuff. I preferred the original way where it was more buttonized so you didn't need the caret.

I'm guessing this change was made because amsterdam buttonizes all the breadcrumbs, so it was hard to make it look distinct. Could we potentially just make that button a little darker or something to call it out a little more. I'm just trying to be thoughtful towards the space. Only other alternative I have is to maybe use a more involved icon rather than the text + icon treatment we're using here?

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3578/

@cchaos
Copy link
Contributor Author

cchaos commented Jun 8, 2020

FYI, I decided I wanted to change how I'm declaring BREAKPOINTS and how EuiBreadcrumbs handles the custom responsiveness. Working on that now and finalizing the changes. Just a heads up :)

cchaos and others added 3 commits June 8, 2020 18:45
And then how EuiBreadcrumbs handle the custom responsive option
@cchaos
Copy link
Contributor Author

cchaos commented Jun 8, 2020

@snide Yeah we talked about it quite a bit in Slack and ended up on this particular display because it:

  1. Didn't call too much attention to itself. This doesn't need to be a super important since apps shouldn't rely solely on breadcrumbs for navigation
  2. It works well when visually combined with truncated items like so:
    image

Also it was quite cumbersome to try to get the new style to work on both links and badges and was easier to just make them all links.

@cchaos
Copy link
Contributor Author

cchaos commented Jun 8, 2020

Also, I've pushed the changes that I talked about and this should be reviewable again. 🙇‍♀️

@myasonik
Copy link
Contributor

myasonik commented Jun 8, 2020

Haven't reviewed this at all yet but I don't imagine there'll be many a11y concerns roughly knowing what was happening here before.

Do you want me to review and leave comments on this PR that you can then do whatever with or do you want me to open a new issue for any that come up?

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3578/

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Few small items, overall the change look great

src/components/breadcrumbs/breadcrumbs.tsx Outdated Show resolved Hide resolved
src/components/breadcrumbs/breadcrumbs.tsx Outdated Show resolved Hide resolved
src/components/breadcrumbs/breadcrumbs.tsx Outdated Show resolved Hide resolved
src/services/responsive.ts Outdated Show resolved Hide resolved
@cchaos
Copy link
Contributor Author

cchaos commented Jun 9, 2020

Do you want me to review and leave comments on this PR that you can then do whatever with or do you want me to open a new issue for any that come up?

@myasonik I'd like to push any a11y specific issues for a follow up PR, so yes maybe one meta issue for breadcrumb accessibility would be great. So no need to review this particular PR, but could be a starting to point to look at the overall accessibility of the component.

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3578/

- Fixing some test suites
- Fixing aria-current when no href
- Making sure `max` overrides larger breakpoint values
Comment on lines +8 to +10
export const BreadcrumbResponsiveMaxCount: FunctionComponent<
EuiBreadcrumbResponsiveMaxCount
> = () => <div />;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chandlerprall I can't seem to get this one to show up in the props table

Copy link
Contributor

Choose a reason for hiding this comment

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

It's working for me - try stopping your dev server, rm -rf .cache-loader, and re-start the server. Alternatively, try changing BreadcrumbProps's div to a span - this is often enough to flush the webpack cache for a specific prop object.

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Might want to adjust the header breadcrumbs when not in amersterdam. Likely can just turn off the left padding for :first-child

Code looks good. We're getting pretty overwritey in amsterdam. I don't know a way around it, so I'm looking in another direction 😄

image

image

src/components/breadcrumbs/_breadcrumbs.scss Outdated Show resolved Hide resolved
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3578/

@cchaos
Copy link
Contributor Author

cchaos commented Jun 9, 2020

Might want to adjust the header breadcrumbs when not in amersterdam. Likely can just turn off the left padding for :first-child

There is no padding in the non-Amsterdam version. What you're seeing is produced by the lack of divider, so I added the border in so you can see how it actually lines up.

Screen Shot 2020-06-09 at 16 11 00 PM

@cchaos cchaos requested a review from chandlerprall June 9, 2020 20:17
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3578/

@cchaos cchaos requested a review from snide June 9, 2020 21:23
Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Changes LGTM!

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation and fixes. LGTM

@cchaos cchaos merged commit 0b5d6d2 into elastic:master Jun 10, 2020
@cchaos cchaos deleted the k8/amsterdam/breadcrumbs branch June 10, 2020 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants