You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds size and weight props to the Typography component while fixing invalid HTML from wrapping block elements with default paragraph tags. However, otherProps no longer spread on the outer div when no as prop is provided, which is a breaking change that needs addressing.
⚠️Bug:otherProps no longer spread on outer div, breaking change
In the old implementation, when no as prop was provided, otherProps (e.g. id, data-testid, onClick, style, etc.) were spread on the outer <div>. The new code always spreads otherProps on the inner <Component> element, and the outer <div> receives no extra props at all.
This is a subtle breaking change: any caller that relied on HTML attributes (like data-testid, role, aria-*, style, event handlers) being applied to the outermost element will find those attributes have moved to a nested element. This can break test selectors, accessibility trees, and event handling.
📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/foundations/typography.tsx:73📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/foundations/typography.tsx:88-91📄 openmetadata-ui-core-components/src/main/resources/ui/src/stories/Typography.stories.tsx:30-41
The previous implementation rendered children directly inside the <div class="prose"> wrapper when no as prop was given. The new code defaults as to "p", so every call site without an explicit as prop now gets an implicit <p> wrapper.
This causes two problems:
Invalid HTML in the Default story: The Default story passes <h1> and <p> as children without an as prop. With the new default, this renders <p><h1>...</h1><p>...</p></p>, which is invalid HTML — <p> cannot contain block-level elements. Browsers will auto-close the outer <p>, producing broken/unexpected DOM.
Subtle layout regression for existing callers: At least 4 call sites in the main app omit the as prop and previously had their children rendered directly inside the <div>. They now silently gain a <p> wrapper, which introduces block-level margin/padding from the prose styles and changes the DOM structure.
Consider defaulting to as="div" or as="span" (matching the previous behavior of no inner wrapper more closely), or removing the default entirely and only rendering a wrapper element when as is explicitly provided.
🤖 Prompt for agents
Code Review: Adds size and weight props to the Typography component while fixing invalid HTML from wrapping block elements with default paragraph tags. However, `otherProps` no longer spread on the outer div when no `as` prop is provided, which is a breaking change that needs addressing.
1. ⚠️ Bug: `otherProps` no longer spread on outer div, breaking change
Files: openmetadata-ui-core-components/src/main/resources/ui/src/components/foundations/typography.tsx:88-91
In the old implementation, when no `as` prop was provided, `otherProps` (e.g. `id`, `data-testid`, `onClick`, `style`, etc.) were spread on the outer `<div>`. The new code always spreads `otherProps` on the inner `<Component>` element, and the outer `<div>` receives no extra props at all.
This is a subtle breaking change: any caller that relied on HTML attributes (like `data-testid`, `role`, `aria-*`, `style`, event handlers) being applied to the outermost element will find those attributes have moved to a nested element. This can break test selectors, accessibility trees, and event handling.
Options
Auto-apply is off → Gitar will not commit updates to this branch. Display: compact → Showing less information.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
safe to testAdd this label to run secure Github workflows on PRs
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes:
Fixes
I worked on ... because ...
Screen.Recording.2026-03-19.at.4.55.27.PM.mov
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
sizeprop with 12 typography scale options (text-xs to display-2xl)weightprop with 4 font weight variants (regular, medium, semibold, bold)asprop now defaults to"p"TypographySizeandTypographyWeighttypes for external useThis will update automatically on new commits.