Skip to content

Commit 527f8a9

Browse files
bengotowclaude
authored andcommitted
fix: remove duplicate Catalog breadcrumb on asset detail pages (#21820)
I think it's easiest to see these two fixes in a quick demo: https://www.loom.com/share/ecec7b76aad44dd78115ac3d79a64ec0 - The assetOverviewBreadcrumbs array included an explicit {text: 'Catalog'} item followed by the ViewBreadcrumb component, which itself renders "Catalog / [view name]". This caused the breadcrumb trail to read "Catalog > Catalog / All Assets" instead of just "Catalog / All Assets". - The vertical positioning of the breadcrumbs moved as you moved from page to page --------- Co-authored-by: Claude <noreply@anthropic.com> Internal-RevId: 72e502e69554cb10daf90bfe8b8bd1715a2b8dc6
1 parent e647d4f commit 527f8a9

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

js_modules/ui-core/src/assets/catalog/AssetsCatalog.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ export const AssetsCatalog = React.memo(() => {
2424
}}
2525
>
2626
<Box
27-
padding={{top: 12, horizontal: 24}}
27+
padding={{top: 8, horizontal: 24}}
2828
flex={{direction: 'row', alignItems: 'center', justifyContent: 'space-between'}}
29-
border="top"
30-
style={{width: '100%'}}
29+
style={{width: '100%', minHeight: 44, marginBottom: -4}}
3130
>
3231
<ViewBreadcrumb />
3332
</Box>

js_modules/ui-core/src/shared/assets/AssetPageHeader.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,19 @@ export const AssetPageHeader = ({
102102
// items have the correct href values since we can't control the overflow
103103
// rendering. Here, however, we can do what we want, and we render with
104104
// react-router Link components that don't need the basePath.
105-
const pathWithoutBase = href ? href.replace(basePath, '') : '';
105+
if (href) {
106+
return (
107+
<TruncatedHeading key={href}>
108+
<BreadcrumbLink to={href.replace(basePath, '') || '#'}>
109+
{typeof text === 'string' ? <MiddleTruncate text={text} /> : text}
110+
</BreadcrumbLink>
111+
</TruncatedHeading>
112+
);
113+
}
114+
106115
return (
107116
<TruncatedHeading key={href}>
108-
<BreadcrumbLink to={pathWithoutBase || '#'}>
109-
{typeof text === 'string' ? <MiddleTruncate text={text} /> : text}
110-
</BreadcrumbLink>
117+
{typeof text === 'string' ? <MiddleTruncate text={text} /> : text}
111118
</TruncatedHeading>
112119
);
113120
}}

0 commit comments

Comments
 (0)