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
@@ -1,7 +1,7 @@
# Components migrated from Ant Design adopt the core component's styling

- **Status:** Accepted
- **Revisions:** v1 2026-10-11 (initial) · v2 2026-10-23 (landing-page segmented controls exception) · v3 2026-10-26 (conversation drawer reply count and message exception) · v4 2026-10-30 (Data mode asset rows and legend labels exception)
- **Revisions:** v1 2026-10-11 (initial) · v2 2026-10-23 (landing-page segmented controls exception) · v3 2026-10-26 (conversation drawer reply count and message exception) · v4 2026-10-30 (Data mode asset rows and legend labels exception) · v5 2026-11-02 (persona customize editor tree rows and category cards exception)
- **Deciders:** Harshit Shah
- **Guard:** reviewer
- **Related:** ADR:2026-10-11-antd-imports-are-frozen-by-eslint-suppressions, open-metadata/openmetadata-collate#6884, open-metadata/openmetadata-collate#6891, open-metadata/OpenMetadata#35209
Expand Down Expand Up @@ -54,3 +54,11 @@ Ontology Studio's Data mode asset rows and concept card headers (over core `Butt
colours (over core `Typography`) restyle core components from the call site until core ships a
full-bleed list-row `Button` variant and primary and secondary text colours. The scope and exit are
in ADR:2026-10-30-data-mode-asset-rows-are-styled-at-the-call-site-until-core-ships-a-list-row-button.

## Amendment — v5: persona customize editor tree rows and category cards

The settings modal's persona Navigation and AI sidebar editors (full-bleed, divided rows over core
`Tree.Item` and `Tree.ItemContent`, and the editor `Card` radius) and the persona category tiles
(`Card.Content` padding) restyle core components from the call site until core ships a divided
full-bleed tree row and a compact card padding. The scope and exit are in
ADR:2026-11-02-persona-customize-editor-tree-rows-are-styled-at-the-call-site.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Persona customize editor tree rows and category cards are styled at the call site until core ships a divided tree row

- **Status:** Accepted
- **Revisions:** v1 2026-11-02 (initial)
- **Deciders:** Rohit Jain
- **Guard:** reviewer
- **Related:** ADR:2026-10-11-migrated-antd-components-adopt-core-styling, open-metadata/OpenMetadata#36707, open-metadata/OpenMetadata#36862

## Context
The settings modal's persona editors (Navigation in classic mode, the AI sidebar in AI mode) list the
sidebar as full-width rows divided by a rule, 40px tall, with the hover fill and the divider running
edge to edge. No core component expresses that row. Core `Tree.ItemContent` rounds each row, pads it
`py-1.5 pr-1.5`, and indents a nested row with an inline `marginLeft`
(`tree.tsx`, `TreeItemContentComponent`), so a divider or hover fill drawn on the row stops short at
the indent and shows rounded ends. The persona category tiles have the same kind of gap: core
`Card.Content` pads `px-6`, which leaves the icon and two-line description cramped in a three-column
grid.

## Decision
Until `@openmetadata/ui-core-components` ships a full-bleed, divided `Tree` row variant and a compact
`Card.Content` padding, these call sites may restyle core components, as an exception to
ADR:2026-10-11-migrated-antd-components-adopt-core-styling:

- `Tree.Item` in `customize/NavigationEditor.tsx` and `customize/AiSidebarEditor.tsx`:
`tw:rounded-none tw:border-b tw:border-secondary tw:last:border-b-0`;
- `Tree.ItemContent` in the same two files: `tw:ml-0! tw:h-10 tw:rounded-none tw:py-0 tw:pr-3.5`
with `tw:pl-4` for a top-level row and `tw:pl-10` for a nested one. The `!` cancels the core's
inline `marginLeft`, and the padding replaces it so the hover fill and divider stay full width;
- the editor `Card` in the same two files: `tw:overflow-hidden tw:rounded-xl`, which clips the rows
to the card's corners;
- `Card.Content` in `PersonaCustomizeGrid.tsx` and `customize/SubCategoryGrid.tsx`: `tw:px-3`.

The overrides stay in those four modules; no other call site copies them.

## Consequences
These rows can drift when core changes `Tree` indentation, radius or padding, or `Card.Content`
padding, so a core change to them is checked against the persona editors in both themes. When core
ships a divided full-bleed tree row and a compact card padding, these call sites move to them and
this record is superseded.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# One persona Navigation card opens the sidebar editor for the current app mode

- **Status:** Accepted
- **Revisions:** v1 2026-11-02 (initial)
- **Deciders:** Rohit Jain
- **Guard:** `PersonaUtils.test.ts` (`getCustomizePageCategoryCards` drops the AI sidebar card),
`PersonaCustomizeView.test.tsx` (`navigation` opens `navigation-editor` in classic mode and
`ai-sidebar-editor` in AI mode), `PersonaCustomizeGrid.test.tsx`
- **Related:** ADR:2026-10-21-settings-pages-are-classic-only, open-metadata/OpenMetadata#36862

## Context
A persona's Customize UI showed two cards for one concept: **Navigation** (the classic left sidebar,
`navigation`) and **AI sidebar** (`askCollateSidebar`). Each shell has exactly one sidebar, and
which one a user customizes follows the shell they are in. The settings modal exists only in AI mode
and the classic `/settings/persona` page only in classic mode
(ADR:2026-10-21-settings-pages-are-classic-only).

## Decision
- **Both card grids show one Navigation card.** `PersonaCustomizeGrid` (the modal) and `CustomizeUI`
(the classic page) render `getCustomizePageCategoryCards()`, which is
`getCustomizePageCategories()` without `APP_MODE_SIDEBAR_CUSTOMIZATION_KEY` (`askCollateSidebar`).
- **The Navigation card opens the editor for the mode.** In `PersonaCustomizeView`, `navigation`
opens `AiSidebarEditor` when `useIsAiMode()` is true and `NavigationEditor` otherwise. On the
classic page it opens the classic Customize Navigation page, as before.
- **`askCollateSidebar` stays a category, just not a card.** It remains in
`getCustomizePageCategories()` so breadcrumbs and the `/customize-page/<persona>/askCollateSidebar`
route keep resolving its label, and `PersonaCustomizeView` still maps it to `AiSidebarEditor` for
existing links.
- **Each editor writes only its own key.** `NavigationEditor` saves `data.navigation` and
`AiSidebarEditor` saves `data.askCollateSidebar`, so switching modes never moves one sidebar's
visibility onto the other.
- **A downstream category with the same key is hidden too.** Collate's `PersonaClassCollate` replaces
the OSS `askCollateSidebar` entry with its own under the same key; the card filter matches the key,
so Collate shows one Navigation card without a change. That holds only while both use the key
`askCollateSidebar`.

## Consequences
A classic-mode admin no longer reaches the AI sidebar editor from a card; it is edited from the
settings modal in AI mode, or through the `/customize-page/<persona>/askCollateSidebar` route.
Renaming `APP_MODE_SIDEBAR_CUSTOMIZATION_KEY` in OSS or Collate brings the second card back in
whichever distribution kept the old key. Revisit if one shell ever shows both sidebars.
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,8 @@ test.describe(
// sharing one across parallel workers would race on its version.
const personas: Record<string, PersonaClass> = {};
const EDITORS = [
'navigation',
'appLayout',
'aiSidebar',
'navigation',
'marketplace',
'home',
'homeTheme',
Expand Down Expand Up @@ -771,30 +770,6 @@ test.describe(
await enableAiAppMode(page);
});

test('Navigation: hiding an item is saved', async ({ page }) => {
await openPersonaSettings(
page,
personas.navigation.data.name,
'/customize/navigation'
);
const exploreSwitch = page
.getByTestId('navigation-switch-/explore')
.getByRole('switch');

await expect(exploreSwitch).toBeChecked();

// react-aria keeps the input under its label; the label takes the press.
await page.getByTestId('navigation-switch-/explore').click();

await expect(exploreSwitch).not.toBeChecked();

await saveLayoutAndReload(page, 'customize-save', '/explore');

await expect(
page.getByTestId('navigation-switch-/explore').getByRole('switch')
).not.toBeChecked();
});

test('App Layout: the default app mode is saved', async ({ page }) => {
await openPersonaSettings(
page,
Expand All @@ -814,11 +789,13 @@ test.describe(
).toBeChecked();
});

test('AI sidebar: hiding a module is saved', async ({ page }) => {
test('Navigation in AI mode: hiding a module is saved', async ({
page,
}) => {
await openPersonaSettings(
page,
personas.aiSidebar.data.name,
'/customize/askCollateSidebar'
personas.navigation.data.name,
'/customize/navigation'
);
const exploreSwitch = page
.getByTestId('ai-sidebar-switch-explore')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
import useCustomLocation from '../../../../hooks/useCustomLocation/useCustomLocation';
import { useFqn } from '../../../../hooks/useFqn';
import {
getCustomizePageCategories,
getCustomizePageCategoryCards,
getCustomizePageOptions,
} from '../../../../utils/Persona/PersonaUtils';
import { getCustomizePagePath } from '../../../../utils/RouterUtils';
import SettingItemCard from '../../SettingItemCard/SettingItemCard.component';

export const CustomizeUI = () => {
const categories = useMemo(() => getCustomizePageCategories(), []);
const categories = useMemo(() => getCustomizePageCategoryCards(), []);
const navigate = useNavigate();
const location = useCustomLocation();
const { fqn: personaFQN } = useFqn();
Expand All @@ -52,7 +52,7 @@
});
}
},
[history, fullHash, personaFQN]

Check warning on line 55 in openmetadata-ui/src/main/resources/ui/src/components/Settings/Persona/CustomizeUI/CustomizeUI.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array. Outer scope values like 'history' aren't valid dependencies because mutating them doesn't re-render the component
);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { fireEvent, render, screen } from '@testing-library/react';
import PersonaCustomizeGrid from './PersonaCustomizeGrid';

describe('PersonaCustomizeGrid', () => {
it('renders a card for every customize category with its label', () => {
it('renders a card for every customize category except the merged AI sidebar', () => {
render(<PersonaCustomizeGrid onSelectCategory={jest.fn()} />);

const keys = screen
Expand All @@ -25,7 +25,6 @@ describe('PersonaCustomizeGrid', () => {
expect(keys).toEqual([
'customize-card-navigation',
'customize-card-app-layout',
'customize-card-askCollateSidebar',
'customize-card-LandingPage',
'customize-card-DataMarketplace',
'customize-card-governance',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import { Box, Card, Typography } from '@openmetadata/ui-core-components';
import { useMemo } from 'react';
import { getCustomizePageCategories } from '../../../../../../utils/Persona/PersonaUtils';
import { getCustomizePageCategoryCards } from '../../../../../../utils/Persona/PersonaUtils';
import { getLandingIconColor } from '../../components/LandingIcon.constants';
import { PERSONA_CATEGORY_ICONS } from './personaCategoryIcons';

Expand All @@ -24,7 +24,7 @@ interface PersonaCustomizeGridProps {
const PersonaCustomizeGrid = ({
onSelectCategory,
}: PersonaCustomizeGridProps) => {
const categories = useMemo(() => getCustomizePageCategories(), []);
const categories = useMemo(() => getCustomizePageCategoryCards(), []);

return (
<Box
Expand All @@ -50,7 +50,7 @@ const PersonaCustomizeGrid = ({
handler(category.key);
}
}}>
<Card.Content>
<Card.Content className="tw:px-3">
<Box align="start" direction="row" gap={4}>
<Box
align="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
} from '@openmetadata/ui-core-components';
import { DotsGrid } from '@openmetadata/ui-core-components/icons';
import { AxiosError } from 'axios';
import classNames from 'classnames';
import { isEqual } from 'lodash';
import { Key, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { NavigationItem } from '../../../../../../../generated/system/ui/uiCustomization';
import {

Check warning on line 28 in openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/personas/customize/AiSidebarEditor.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here
getSidebarHiddenKeys,
getSidebarNavigationItems,
getSidebarTreeData,
Expand Down Expand Up @@ -176,17 +177,25 @@
});
}, [handleSave, handleReset, canSave, isSaving, onActionsChange]);

const renderNode = (node: SidebarTreeNode) => {
const renderNode = (node: SidebarTreeNode, depth = 1) => {
const Icon = node.navIcon;

return (
<Tree.Item id={node.key} key={node.key} textValue={node.title}>
<Tree.Item
className="tw:rounded-none tw:border-b tw:border-secondary tw:last:border-b-0"
id={node.key}
key={node.key}
textValue={node.title}>
<Tree.ItemContent
className="tw:py-0 tw:px-3 tw:border-b tw:border-secondary"
className={classNames(
// The core indents by `marginLeft`; padding keeps the hover fill and divider full width.
'tw:ml-0! tw:h-10 tw:rounded-none tw:py-0 tw:pr-3.5',
depth > 1 ? 'tw:pl-10' : 'tw:pl-4'
)}
hasChildItems={Boolean(node.children?.length)}>
<Box
align="center"
className="tw:w-full tw:justify-between tw:py-3 tw:group"
className="tw:w-full tw:justify-between tw:group"
direction="row">
<Box align="center" direction="row" gap={2}>
<DotsGrid
Expand All @@ -204,22 +213,24 @@
data-testid={`ai-sidebar-switch-${node.key}`}
isDisabled={node.disablePersonaHide}
isSelected={!hiddenKeys.includes(node.key)}
size="sm"
onChange={(checked) => handleToggle(checked, node.key)}
/>
</Box>
</Tree.ItemContent>
{node.children?.map((child) => renderNode(child))}
{node.children?.map((child) => renderNode(child, depth + 1))}
</Tree.Item>
);
};

return (
<Card
className="tw:flex tw:flex-col tw:w-[30%]"
className="tw:flex tw:w-95 tw:flex-col tw:overflow-hidden tw:rounded-xl"
data-testid="ai-sidebar-editor"
variant="muted">
<Tree
aria-label={t('label.app-mode-sidebar')}
className="tw:gap-0"
defaultExpandedKeys={new Set([MORE_NAV_KEY])}
selectionMode="none"
onItemMove={handleItemMove}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from '@openmetadata/ui-core-components';
import { DotsGrid } from '@openmetadata/ui-core-components/icons';
import { AxiosError } from 'axios';
import classNames from 'classnames';
import { isEqual } from 'lodash';
import { Key, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -146,18 +147,26 @@ const NavigationEditor = ({
[treeData]
);

const renderNode = (node: NavigationTreeNode) => {
const renderNode = (node: NavigationTreeNode, depth = 1) => {
const key = String(node.key);
const label = t(node.title as string);

return (
<Tree.Item id={key} key={key} textValue={label}>
<Tree.Item
className="tw:rounded-none tw:border-b tw:border-secondary tw:last:border-b-0"
id={key}
key={key}
textValue={label}>
<Tree.ItemContent
className="tw:py-0 tw:px-3 tw:border-b tw:border-secondary"
className={classNames(
// The core indents by `marginLeft`; padding keeps the hover fill and divider full width.
'tw:ml-0! tw:h-10 tw:rounded-none tw:py-0 tw:pr-3.5',
depth > 1 ? 'tw:pl-10' : 'tw:pl-4'
)}
Comment thread
Rohit0301 marked this conversation as resolved.
Resolved
hasChildItems={Boolean(node.children?.length)}>
<Box
align="center"
className="tw:w-full tw:justify-between tw:py-3 tw:group"
className="tw:w-full tw:justify-between tw:group"
direction="row">
<Box align="center" direction="row" gap={2}>
<DotsGrid
Expand All @@ -171,22 +180,24 @@ const NavigationEditor = ({
aria-label={label}
data-testid={`navigation-switch-${key}`}
isSelected={!hiddenKeys.includes(key)}
size="sm"
onChange={(checked) => handleToggle(checked, key)}
/>
</Box>
</Tree.ItemContent>
{node.children?.map((child) => renderNode(child))}
{node.children?.map((child) => renderNode(child, depth + 1))}
</Tree.Item>
);
};

return (
<Card
className="tw:flex tw:flex-col tw:w-[30%]"
className="tw:flex tw:w-95 tw:flex-col tw:overflow-hidden tw:rounded-xl"
data-testid="navigation-editor"
variant="muted">
<Tree
aria-label={t('label.navigation')}
className="tw:gap-0"
defaultExpandedKeys={expandedKeys}
selectionMode="none"
onItemMove={handleItemMove}
Expand Down
Loading
Loading