Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# The settings modal's breadcrumb root is the sidebar group, and it is not a link

- **Status:** Accepted
- **Revisions:** v1 2026-11-16 (initial)
- **Deciders:** UI team
- **Guard:** `ProfilePage.test.tsx` ("roots a panel breadcrumb at its sidebar group, not navigable")
- **Related:** open-metadata/OpenMetadata#37878

## Context
Each settings panel built its own breadcrumb trail and hard-coded the first crumb, usually
"Settings" and once "Workspace", so the root disagreed with the sidebar group the page sits under.
The root was also clickable, though it only repeated what the next crumb does.

## Decision
`ProfilePage` owns the first crumb. It renders the active item's sidebar group
(`PROFILE_NAV_GROUP_LABEL`: Account / Administration / Features / Workspace / Credentials) with
`isDisabled`, so it is plain text, not a link. `ProfileHeaderOverride.breadcrumbs`, and the override
a contributed tab pushes through `onHeaderChange`, stays a full trail that leads with a root crumb.
`ProfilePage` replaces that crumb by position. A panel that passes an empty trail gets only the
root.

## Consequences
Panels, including those contributed downstream, need no change and cannot get the root wrong.
A panel must still lead its trail with a placeholder root. A trail that starts directly with a page
crumb loses that crumb. Switching to "panels pass only the crumbs below the root" would make this
explicit, but every panel and every downstream contribution would have to change in the same
release, or they would render the root twice.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,53 @@ describe('Breadcrumbs', () => {
);
});

it('renders a disabled item as plain text even with onAction', () => {
const onAction = vi.fn();
render(
<Breadcrumbs
items={[
{ id: 'root', label: 'Workspace', isDisabled: true },
{ id: 'personas', label: 'Personas' },
{ id: 'detail', label: 'Detail' },
]}
onAction={onAction}
/>
);

expect(
screen.queryByRole('link', { name: 'Workspace' })
).not.toBeInTheDocument();
expect(screen.getByRole('link', { name: 'Personas' })).toBeInTheDocument();
});

it('keeps a disabled item inert after it collapses into the menu', async () => {
const onAction = vi.fn();
render(
<Breadcrumbs
items={[
{ id: 'root', label: 'Root' },
{ id: 'section', label: 'Section', isDisabled: true },
{ id: 'page', label: 'Page' },
{ id: 'detail', label: 'Detail' },
]}
maxItems={2}
onAction={onAction}
/>
);

act(() =>
screen.getByRole('button', { name: 'Show hidden breadcrumbs' }).click()
);
const section = await screen.findByText('Section');
act(() => section.click());

expect(section.closest('[role^="menuitem"]')).toHaveAttribute(
'aria-disabled',
'true'
);
expect(onAction).not.toHaveBeenCalledWith('section');
});

it('titles capped labels so a truncated name stays readable', () => {
render(<Breadcrumbs items={items} maxItemWidth={80} />);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export interface BreadcrumbItemType {
href?: string;
/** Optional leading icon, e.g. a home icon on the first crumb. */
icon?: FC<{ className?: string }>;
/** Render as plain text even when `href` or `onAction` is set, e.g. a section label. */
isDisabled?: boolean;
}

export interface BreadcrumbsProps extends HTMLAttributes<HTMLElement> {
Expand Down Expand Up @@ -240,6 +242,7 @@ const EllipsisMenu = ({
<Dropdown.Item
href={onAction ? undefined : item.href}
icon={item.icon}
isDisabled={item.isDisabled}
key={item.id}
label={toText(item.label, `Item ${index + 1}`)}
onAction={() => onAction?.(item.id)}
Expand Down Expand Up @@ -353,7 +356,8 @@ export const Breadcrumbs = ({
type={type}
onAction={onAction}
/>
) : item.href || (onAction && !isCurrent) ? (
) : !item.isDisabled &&
(item.href || (onAction && !isCurrent)) ? (
Comment thread
Rohit0301 marked this conversation as resolved.
Resolved
// React Aria disables the physical last crumb, so clear its
// context when href marks that crumb as a destination.
<LinkContext.Provider value={{}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test.describe(
).toHaveText('5');
await expect(
page.locator('[data-testid="access-block-time"]')
).toHaveText('500');
).toHaveText('500 Seconds');
await expect(
page.locator('[data-testid="jwt-token-expiry-time"]')
).toHaveText('5000 Seconds');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ test.describe(

await test.step('Teams tab shows empty state', async () => {
await clickDetailTab(page, 'teams');
await expect(page.getByText('No Teams found')).toBeVisible();
await expect(page.getByText('No Teams Found')).toBeVisible();
});

await test.step('Users tab shows pre-added user', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

import { act, fireEvent, render, screen } from '@testing-library/react';
import { ReactNode } from 'react';
import { ReactNode, useEffect } from 'react';

let mockHashState: { tab: string | null; subPath: string; params: object } = {
tab: null,
Expand Down Expand Up @@ -154,10 +154,19 @@ jest.mock('@openmetadata/ui-core-components', () => ({
<div data-testid="empty-placeholder">{title}</div>
),
FeaturedIcon: () => <span data-testid="featured-icon" />,
Breadcrumbs: ({ items }: { items?: { id: string; label: ReactNode }[] }) => (
Breadcrumbs: ({
items,
}: {
items?: { id: string; label: ReactNode; isDisabled?: boolean }[];
}) => (
<nav>
{items?.map((i) => (
<span key={i.id}>{i.label}</span>
<span
data-disabled={String(Boolean(i.isDisabled))}
data-testid={`crumb-${i.id}`}
key={i.id}>
{i.label}
</span>
))}
</nav>
),
Expand Down Expand Up @@ -261,6 +270,47 @@ describe('ProfilePage', () => {
expect(mockGetUserByName).not.toHaveBeenCalled();
});

it('roots a panel breadcrumb at its sidebar group, not navigable', async () => {
const WorkspacePanel = ({
onHeaderChange,
}: {
onHeaderChange: (override: object) => void;
}) => {
useEffect(() => {
onHeaderChange({
breadcrumbs: [
{ id: 'settings', label: 'label.setting-plural' },
{ id: 'my-connections', label: 'label.my-connection-plural' },
],
});
}, [onHeaderChange]);

return <div data-testid="content-my-connections" />;
};
mockGetContributions.mockReturnValue([
{
...myConnectionsContribution,
group: 'workspace',
component: WorkspacePanel,
},
]);
mockHashState = { tab: 'my-connections', subPath: '', params: {} };

await act(async () => {
render(<ProfilePage />);
});

expect(screen.getByTestId('crumb-root')).toHaveTextContent(
'label.workspace'
);
expect(screen.getByTestId('crumb-root')).toHaveAttribute(
'data-disabled',
'true'
);
expect(screen.queryByTestId('crumb-settings')).not.toBeInTheDocument();
expect(screen.getByTestId('crumb-my-connections')).toBeInTheDocument();
});

it('passes the username and logged-in flag to contributed tabs', async () => {
const condition = jest.fn().mockReturnValue(true);
mockGetContributions.mockReturnValue([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,12 @@ const ProfilePage: React.FC = () => {
const headerBreadcrumbRoot = t(PROFILE_NAV_GROUP_LABEL[activeItem.group]);
// Tie the breadcrumb to the nav item, not the (possibly user-name-overridden)
// title — so your own profile reads "Account > Profile".
const headerBreadcrumbs = headerOverride?.breadcrumbs ?? [
{ id: 'root', label: headerBreadcrumbRoot },
{ id: 'current', label: t(activeItem.label) },
// ADR:2026-11-16-settings-breadcrumb-root-is-the-sidebar-group
const headerBreadcrumbs = [
{ id: 'root', label: headerBreadcrumbRoot, isDisabled: true },
...(headerOverride?.breadcrumbs?.slice(1) ?? [
{ id: 'current', label: t(activeItem.label) },
]),
];
const headerBreadcrumbAction = headerOverride?.onBreadcrumbAction;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ export const PROFILE_NAV_GROUP_ORDER: ProfileNavGroup[] = [
* All fields are optional — panels provide only what they need to override.
*/
export interface ProfileHeaderOverride {
/**
* Full trail, root first. ProfilePage replaces the first crumb with the
* sidebar group label, rendered non-navigable
* (ADR:2026-11-16-settings-breadcrumb-root-is-the-sidebar-group).
*/
breadcrumbs?: BreadcrumbItemType[];
title?: string;
description?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ const AccessControlAuditLogsPanel: React.FC<
data-testid="export-audit-logs-button"
iconLeading={Download01}
ref={exportButtonRef}
size="xs"
onPress={() => setIsExportModalOpen(true)}>
{t('label.export')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const ApplicationsList: FC<ApplicationsViewProps> = ({
<Button
color="primary"
data-testid="browse-apps"
size="sm"
size="xs"
onPress={() => onNavigate({ type: 'marketplace' })}>
{t('label.browse-app-plural')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jest.mock('@openmetadata/ui-core-components', () => {
);

return {
Badge: ({ children }: { children: React.ReactNode }) => (
<span data-testid="badge">{children}</span>
),
Box: ({
children,
...props
Expand Down Expand Up @@ -88,6 +91,15 @@ describe('GovernanceLanding', () => {
).toBeInTheDocument();
});

it('marks only the intake forms card as deprecated', () => {
expect(
screen.getByTestId('governance-card-intake-forms')
).toHaveTextContent('label.deprecated');
expect(
screen.getByTestId('governance-card-glossary-relations')
).not.toHaveTextContent('label.deprecated');
});

it('calls onNavigate with glossary-list when the glossary card is clicked', () => {
fireEvent.click(screen.getByTestId('governance-card-glossary-relations'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/

import { Box, Card, Typography } from '@openmetadata/ui-core-components';
import { Badge, Box, Card, Typography } from '@openmetadata/ui-core-components';
import {
IntakeForms,
KnowledgePanels,
Expand All @@ -25,6 +25,7 @@ interface LandingCard {
descriptionKey: string;
icon: FC<{ className?: string }>;
id: string;
isDeprecated?: boolean;
titleKey: string;
view: GovernanceView;
}
Expand All @@ -42,6 +43,7 @@ const LANDING_CARDS: LandingCard[] = [
icon: IntakeForms,
titleKey: 'label.intake-form-plural',
descriptionKey: 'message.intake-form-plural-description',
isDeprecated: true,
view: { type: 'intake-list' },
},
];
Expand Down Expand Up @@ -90,12 +92,19 @@ const GovernanceLanding: FC<GovernanceLandingProps> = ({ onNavigate }) => {
<Icon className="tw:size-6" />
</Box>
<Box className="tw:min-w-0" direction="col" gap={1}>
<Typography
className="tw:text-primary"
size="text-sm"
weight="semibold">
{t(card.titleKey)}
</Typography>
<Box align="center" direction="row" gap={2}>
<Typography
className="tw:text-primary"
size="text-sm"
weight="semibold">
{t(card.titleKey)}
</Typography>
{card.isDeprecated && (
<Badge color="warning" size="sm" type="pill-color">
{t('label.deprecated')}
</Badge>
)}
</Box>
<Typography
className="tw:text-tertiary tw:line-clamp-2"
size="text-sm"
Expand Down
Loading
Loading