Skip to content

Commit 6445eda

Browse files
tsullivankibanamachineDosantmgadewollweronikaolejniczak
authored
[Workspace Chrome] Visual Improvements (elastic#245898)
## Summary Update the look and feel of the Solution chrome. Epic: elastic/kibana-team#2106 Includes elastic#245099 **Changes:** | Area | Change |-|- | Navigation collapse button | <li>moved from the chrome header to the navigation footer | Application space, App menu bar | <li>globally consistent white background (due to changes in EUI v110)<br><li>drop shadow | Application space| <li>Spacing at the bottom and right sides between the app content<br>Spacing when the navigation side panel shows (conditionally) | Global header background | <li>shaded ### Things to test 1. dark mode 2. the expanded/collapsed nav 3. secondary nav panel 4. embedded console button at the bottom of the screen (Elasticsearch space) 5. high contrast mode ## Screenshots **Before** 1. <img width="1835" height="1101" alt="image" src="https://github.com/user-attachments/assets/75a1ded1-f102-42ec-bc7e-804c27b4455b" /> 6. <img width="1835" height="1101" alt="image" src="https://github.com/user-attachments/assets/5301dd03-4cdb-4cd3-8fba-517adfd26b29" /> 7. <img width="1835" height="1101" alt="image" src="https://github.com/user-attachments/assets/b69c176b-7a8a-4d1f-879f-970010381483" /> **After** 1. <img width="1836" height="1100" alt="image" src="https://github.com/user-attachments/assets/7d2b9d75-ee83-4893-83f4-9a6561fd1e04" /> 2. <img width="1835" height="1100" alt="image" src="https://github.com/user-attachments/assets/ae70825b-a52c-43b5-867f-3efd02681c60" /> 3. <img width="1835" height="1100" alt="image" src="https://github.com/user-attachments/assets/177d896c-8e9b-4810-839c-934ea9c7a3a8" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Audit all Kibana pages for consistency of stylistic changes - ~~[ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~~ - ~~[ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~~ - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - ~~[ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~~ - ~~[ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.~~ - ~~[ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed~~ - ~~[ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~~ - ~~[ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.~~ ### Identify risks ~~Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.~~ ~~Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.~~ - ~~[ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)~~ - ~~[ ] ...~~ --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Anton Dosov <anton.dosov@elastic.co> Co-authored-by: Lene Gadewoll <lene.gadewoll@elastic.co> Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co> Co-authored-by: Jorge Oliveira <jorge.oliveira@elastic.co> Co-authored-by: ek-so <eksomail@gmail.com> Co-authored-by: Kate Sosedova <36230123+ek-so@users.noreply.github.com>
1 parent 2300d2d commit 6445eda

53 files changed

Lines changed: 788 additions & 370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/core/packages/chrome/browser-internal/src/chrome_service.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ import { handleSystemColorModeChange } from './handle_system_colormode_change';
7373
import { AppMenuBar } from './ui/project/app_menu';
7474
import { GridLayoutProjectSideNav } from './ui/project/sidenav/grid_layout_sidenav';
7575
import { FixedLayoutProjectSideNav } from './ui/project/sidenav/fixed_layout_sidenav';
76-
import { SideNavCollapseButton } from './ui/project/sidenav/collapse_button';
7776
import type { NavigationProps } from './ui/project/sidenav/types';
7877

7978
const IS_SIDENAV_COLLAPSED_KEY = 'core.chrome.isSideNavCollapsed';
@@ -422,6 +421,7 @@ export class ChromeService {
422421
dataTestSubj$: activeDataTestSubj$,
423422
isFeedbackBtnVisible$: this.isFeedbackBtnVisible$,
424423
feedbackUrlParams$,
424+
onToggleCollapsed: setIsSideNavCollapsed,
425425
};
426426

427427
const getProjectHeader = ({
@@ -471,19 +471,13 @@ export class ChromeService {
471471
kibanaVersion={injectedMetadata.getKibanaVersion()}
472472
prependBasePath={http.basePath.prepend}
473473
>
474-
{includeSideNav ? (
474+
{includeSideNav && (
475475
<Router history={application.history}>
476476
<FixedLayoutProjectSideNav
477477
isCollapsed$={this.isSideNavCollapsed$}
478-
toggle={setIsSideNavCollapsed}
479478
navProps={navProps}
480479
/>
481480
</Router>
482-
) : (
483-
<SideNavCollapseButton
484-
isCollapsed={this.isSideNavCollapsed$}
485-
toggle={setIsSideNavCollapsed}
486-
/>
487481
)}
488482
</ProjectHeader>
489483
);

src/core/packages/chrome/browser-internal/src/ui/project/app_menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const useAppMenuBarStyles = (euiTheme: UseEuiTheme['euiTheme']) =>
3737
justifyContent: 'end',
3838
alignItems: 'center',
3939
padding: `0 ${euiTheme.size.s}`,
40-
background: euiTheme.colors.body,
40+
background: euiTheme.colors.backgroundBasePlain,
4141
borderBottom: euiTheme.border.thin,
4242
marginBottom: `-${euiTheme.border.width.thin}`,
4343
};

src/core/packages/chrome/browser-internal/src/ui/project/header.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,13 @@ const getHeaderCss = ({ size, colors }: EuiThemeComputed) => ({
5252
display: flex;
5353
align-items: center;
5454
justify-content: center;
55-
min-width: 56px; /* 56 = 40 + 8 + 8 */
55+
min-width: ${size.xxl};
5656
cursor: pointer;
5757
`,
5858
logo: css`
5959
min-width: 0; /* overrides min-width: 40px */
6060
padding: 0;
6161
`,
62-
spinner: css`
63-
position: relative;
64-
left: 4px;
65-
top: 2px;
66-
`,
6762
},
6863
leftHeaderSection: css`
6964
// needed to enable breadcrumbs truncation
@@ -202,7 +197,7 @@ const Logo = ({
202197
{loadingCount === 0 ? (
203198
renderLogo()
204199
) : (
205-
<a onClick={navigateHome} href={fullHref} css={logoCss.spinner}>
200+
<a onClick={navigateHome} href={fullHref}>
206201
<EuiLoadingSpinner
207202
size="l"
208203
aria-hidden={false}
@@ -231,8 +226,11 @@ export const ProjectHeader = ({
231226
const headerCss = getHeaderCss(euiTheme);
232227
const { logo: logoCss } = headerCss;
233228

234-
const topBarStyles = css`
229+
const topBarStyles = () => css`
235230
box-shadow: none !important;
231+
background-color: ${euiTheme.colors.backgroundTransparent};
232+
border-bottom-color: ${euiTheme.colors.backgroundTransparent};
233+
padding-inline: 4px 8px;
236234
`;
237235

238236
return (

src/core/packages/chrome/browser-internal/src/ui/project/sidenav/fixed_layout_sidenav.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,23 @@ import type { BehaviorSubject } from 'rxjs';
1515
import { css, Global } from '@emotion/react';
1616

1717
import { Navigation } from './navigation';
18-
import { SideNavCollapseButton } from './collapse_button';
1918
import type { NavigationProps } from './types';
2019

2120
interface CollapsibleNavigationProps {
22-
toggle: (isVisible: boolean) => void;
2321
isCollapsed$: BehaviorSubject<boolean>;
2422
navProps: NavigationProps;
2523
}
2624

2725
export const FixedLayoutProjectSideNav: FunctionComponent<CollapsibleNavigationProps> = ({
28-
toggle,
2926
isCollapsed$,
3027
navProps,
3128
}) => {
3229
const isCollapsed = useObservable(isCollapsed$, isCollapsed$.getValue());
3330

3431
return (
35-
<>
36-
<SideNavCollapseButton isCollapsed={isCollapsed} toggle={toggle} />
37-
<CollapsibleNavigationFlyout>
38-
{({ setWidth }) => (
39-
<Navigation {...navProps} isCollapsed={isCollapsed} setWidth={setWidth} />
40-
)}
41-
</CollapsibleNavigationFlyout>
42-
</>
32+
<CollapsibleNavigationFlyout>
33+
{({ setWidth }) => <Navigation {...navProps} isCollapsed={isCollapsed} setWidth={setWidth} />}
34+
</CollapsibleNavigationFlyout>
4335
);
4436
};
4537

src/core/packages/chrome/browser-internal/src/ui/project/sidenav/navigation/navigation.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export interface ChromeNavigationProps {
4949
dataTestSubj$?: Observable<string | undefined>;
5050

5151
feedbackUrlParams$: Observable<URLSearchParams | undefined>;
52+
53+
// collapse toggle callback
54+
onToggleCollapsed: (isCollapsed: boolean) => void;
5255
}
5356

5457
export const Navigation = (props: ChromeNavigationProps) => {
@@ -75,6 +78,7 @@ export const Navigation = (props: ChromeNavigationProps) => {
7578
}
7679
isCollapsed={props.isCollapsed}
7780
setWidth={props.setWidth}
81+
onToggleCollapsed={props.onToggleCollapsed}
7882
activeItemId={activeItemId}
7983
data-test-subj={classnames(dataTestSubj, 'projectSideNav', 'projectSideNavV2')}
8084
/>

src/core/packages/chrome/browser-internal/src/ui/project/sidenav/navigation/navigation_feedback_snippet.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,17 @@ export const NavigationFeedbackSnippet = ({
6363
const { euiTheme } = useEuiTheme();
6464

6565
return (
66-
<FeedbackSnippet
66+
<div
6767
css={css`
68-
border-top: ${euiTheme.border.width.thin} ${euiTheme.colors.borderBaseSubdued} solid;
68+
border-top: ${euiTheme.border.width.thin} solid ${euiTheme.colors.borderBaseSubdued};
6969
`}
70-
feedbackButtonMessage={feedbackButtonMessage}
71-
feedbackSnippetId={feedbackSnippetId}
72-
promptViewMessage={promptViewMessage}
73-
surveyUrl={feedbackSurveyUrl}
74-
/>
70+
>
71+
<FeedbackSnippet
72+
feedbackButtonMessage={feedbackButtonMessage}
73+
feedbackSnippetId={feedbackSnippetId}
74+
promptViewMessage={promptViewMessage}
75+
surveyUrl={feedbackSurveyUrl}
76+
/>
77+
</div>
7578
);
7679
};

src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.styles.ts

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,45 @@
99

1010
import { css } from '@emotion/react';
1111
import { layoutVar, layoutLevels } from '@kbn/core-chrome-layout-constants';
12+
import { euiOverflowScroll, euiShadow } from '@elastic/eui';
13+
import { getHighContrastBorder } from '@kbn/core-chrome-layout-utils';
1214
import type { EmotionFn } from '../types';
1315

14-
const root: EmotionFn = ({ euiTheme }) =>
16+
const root: EmotionFn = (useEuiTheme) =>
1517
css`
1618
grid-area: application;
17-
height: 100%;
18-
position: relative;
19-
width: 100%;
19+
20+
height: calc(100% - ${layoutVar('application.marginBottom')});
21+
width: calc(100% - ${layoutVar('application.marginRight')});
22+
margin-bottom: ${layoutVar('application.marginBottom')};
23+
margin-right: ${layoutVar('application.marginRight')};
24+
2025
z-index: ${layoutLevels.content};
2126
27+
position: relative;
2228
display: flex;
2329
flex-direction: column;
2430
31+
background-color: ${useEuiTheme.euiTheme.colors.backgroundBasePlain};
32+
border-radius: ${useEuiTheme.euiTheme.border.radius.medium};
33+
border: ${getHighContrastBorder(useEuiTheme)};
34+
${euiShadow(useEuiTheme, 'xs', { border: 'none' })};
35+
2536
&:focus-visible {
26-
border: 2px solid ${euiTheme.colors.textParagraph};
37+
border: 2px solid ${useEuiTheme.euiTheme.colors.textParagraph};
38+
}
39+
40+
// only restrict overflow scroll on screen (not print) to allow for full page printing
41+
@media screen {
42+
${euiOverflowScroll(useEuiTheme, { direction: 'y' })};
43+
// reset the height back to respect the margin bottom
44+
height: calc(100% - ${layoutVar('application.marginBottom')});
45+
46+
// Hide scrollbar
47+
scrollbar-width: none; /* Firefox */
48+
&::-webkit-scrollbar {
49+
display: none; /* Chrome, Safari, Edge */
50+
}
2751
}
2852
`;
2953

src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import type { ReactNode } from 'react';
1111
import React from 'react';
1212

13-
import { css } from '@emotion/react';
14-
import { useEuiOverflowScroll } from '@elastic/eui';
1513
import { APP_MAIN_SCROLL_CONTAINER_ID } from '@kbn/core-chrome-layout-constants';
1614

1715
import { styles } from './layout_application.styles';
@@ -31,16 +29,9 @@ export const LayoutApplication = ({
3129
topBar?: ReactNode;
3230
bottomBar?: ReactNode;
3331
}) => {
34-
// only restrict overflow scroll on screen (not print) to allow for full page printing
35-
const overflow = css`
36-
@media screen {
37-
${useEuiOverflowScroll('y')};
38-
}
39-
`;
40-
4132
return (
4233
<div
43-
css={[styles.root, overflow]}
34+
css={styles.root}
4435
id={APP_MAIN_SCROLL_CONTAINER_ID}
4536
className="kbnChromeLayoutApplication"
4637
data-test-subj="kbnChromeLayoutApplication"

src/core/packages/chrome/layout/core-chrome-layout-components/layout.types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export interface LayoutDimensions {
2323
sidebarWidth: number;
2424
applicationTopBarHeight: number;
2525
applicationBottomBarHeight: number;
26+
applicationMarginBottom: number;
27+
applicationMarginRight: number;
2628
}
2729

2830
/**

src/core/packages/chrome/layout/core-chrome-layout-components/layout_config_context.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export type LayoutConfig = Pick<
2424
| 'sidebarWidth'
2525
| 'applicationTopBarHeight'
2626
| 'applicationBottomBarHeight'
27+
| 'applicationMarginBottom'
28+
| 'applicationMarginRight'
2729
>;
2830

2931
/**

0 commit comments

Comments
 (0)