diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/MiddleTruncate.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/MiddleTruncate.tsx index b86624ebd1008..0ed910c14c891 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/MiddleTruncate.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/MiddleTruncate.tsx @@ -38,7 +38,7 @@ export const MiddleTruncate = ({text, showTitle = true}: Props) => { // Use a layout effect to trigger the process of calculating the truncated text, for the // initial render. - React.useEffect(() => { + React.useLayoutEffect(() => { window.requestAnimationFrame(calculateTargetStyle); }, [calculateTargetStyle]); diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/PageHeader.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/PageHeader.tsx index 3de87bda4b45d..7bb00ae5705cf 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/PageHeader.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/PageHeader.tsx @@ -48,5 +48,6 @@ const PageHeaderContainer = styled(Box)` */ .bp5-breadcrumbs { height: auto; + min-height: 30px; } `; diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/__stories__/MiddleTruncate.stories.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/__stories__/MiddleTruncate.stories.tsx index 4a5aef68936ab..554b0754bdbce 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/__stories__/MiddleTruncate.stories.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/__stories__/MiddleTruncate.stories.tsx @@ -1,6 +1,9 @@ +// eslint-disable-next-line no-restricted-imports +import {Breadcrumbs2 as Breadcrumbs} from '@blueprintjs/popover2'; import {Meta} from '@storybook/react'; import faker from 'faker'; import {useMemo, useRef, useState} from 'react'; +import styled from 'styled-components'; import {Box} from '../Box'; import {Colors} from '../Color'; @@ -8,6 +11,7 @@ import {Icon} from '../Icon'; import {MiddleTruncate} from '../MiddleTruncate'; import {Slider} from '../Slider'; import {Tag} from '../Tag'; +import {Heading, Title} from '../Text'; // eslint-disable-next-line import/no-default-export export default { @@ -240,3 +244,62 @@ export const Containers = () => { > ); }; + +export const BreadcrumbsScenario = () => { + const breadcrumbs = [ + {text: 's3', href: '#'}, + {text: 'superdomain_1', href: '#'}, + {text: 'subdomain_1', href: '#'}, + {text: 'subsubsubsubdosubsubsubsubdoma', href: '#'}, + {text: 'asset1', href: '#'}, + ]; + return ( +