Skip to content

Commit

Permalink
[Serverless] Increase root breadcrumb width to reduce elipsis (#171515)
Browse files Browse the repository at this point in the history
## Summary

close #170758

This PR increases root breadcrumb max width from 160 to 320px to fit
more of project titles. It also slightly adjusts number of visible
breadcrumbs per breakpoint to account for potentially 2x longer root
breadcrumb. Note that responsiveness is still not ideal as the system
doesn't actually calculate the width of each breadcrumb.


Before: 

<img width="1267" alt="Screenshot 2023-11-20 at 11 53 13"
src="https://github.com/elastic/kibana/assets/7784120/6d2ba8d2-5bc0-4f85-a87a-a4185ae901f7">


After: 

<img width="1284" alt="Screenshot 2023-11-20 at 11 52 31"
src="https://github.com/elastic/kibana/assets/7784120/90a57e58-6836-4465-a21e-78f72dc4953e">
  • Loading branch information
Dosant authored Nov 21, 2023
1 parent f51e6cd commit f4e0d83
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ function buildRootCrumb({
i18n.translate('core.ui.primaryNav.cloud.projectLabel', {
defaultMessage: 'Project',
}),
// increase the max-width of the root breadcrumb to not truncate too soon
style: { maxWidth: '320px' },
popoverContent: (
<EuiContextMenuPanel
size="s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ describe('breadcrumbs', () => {
"popoverProps": Object {
"panelPaddingSize": "none",
},
"style": Object {
"maxWidth": "320px",
},
"text": "Project",
},
Object {
Expand Down Expand Up @@ -176,6 +179,9 @@ describe('breadcrumbs', () => {
"popoverProps": Object {
"panelPaddingSize": "none",
},
"style": Object {
"maxWidth": "320px",
},
"text": "Project",
},
Object {
Expand Down Expand Up @@ -232,6 +238,9 @@ describe('breadcrumbs', () => {
"popoverProps": Object {
"panelPaddingSize": "none",
},
"style": Object {
"maxWidth": "320px",
},
"text": "Project",
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,18 @@ export function Breadcrumbs({ breadcrumbs$ }: Props) {
};
});

return <EuiBreadcrumbs breadcrumbs={crumbs} max={10} data-test-subj="breadcrumbs" />;
return (
<EuiBreadcrumbs
breadcrumbs={crumbs}
data-test-subj="breadcrumbs"
// reduce number of visible breadcrumbs due to increased max-width of the root breadcrumbs
responsive={{
xs: 1,
s: 2,
m: 3,
l: 4,
xl: 7,
}}
/>
);
}

0 comments on commit f4e0d83

Please sign in to comment.