From f4e0d83598a1c128a81c6ce7de10e99f6bc122d9 Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Tue, 21 Nov 2023 14:39:52 +0100 Subject: [PATCH] [Serverless] Increase root breadcrumb width to reduce elipsis (#171515) ## Summary close https://github.com/elastic/kibana/issues/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: Screenshot 2023-11-20 at 11 53 13 After: Screenshot 2023-11-20 at 11 52 31 --- .../src/project_navigation/breadcrumbs.tsx | 2 ++ .../project_navigation_service.test.ts | 9 +++++++++ .../src/ui/project/breadcrumbs.tsx | 15 ++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx index 8bd690fba8a7e..089613939c833 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/breadcrumbs.tsx @@ -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: ( { "popoverProps": Object { "panelPaddingSize": "none", }, + "style": Object { + "maxWidth": "320px", + }, "text": "Project", }, Object { @@ -176,6 +179,9 @@ describe('breadcrumbs', () => { "popoverProps": Object { "panelPaddingSize": "none", }, + "style": Object { + "maxWidth": "320px", + }, "text": "Project", }, Object { @@ -232,6 +238,9 @@ describe('breadcrumbs', () => { "popoverProps": Object { "panelPaddingSize": "none", }, + "style": Object { + "maxWidth": "320px", + }, "text": "Project", }, Object { diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/project/breadcrumbs.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/breadcrumbs.tsx index 4ce22ba727e11..0d453290ba3c4 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/project/breadcrumbs.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/breadcrumbs.tsx @@ -43,5 +43,18 @@ export function Breadcrumbs({ breadcrumbs$ }: Props) { }; }); - return ; + return ( + + ); }