codeant-ai-for-open-source[bot] commented on code in PR #38608:
URL: https://github.com/apache/superset/pull/38608#discussion_r2926739479
##########
superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx:
##########
@@ -23,7 +23,7 @@ import { Icons } from '@superset-ui/core/components/Icons';
import { ContentType, MetadataType } from '.';
const Header = styled.div`
- font-weight: ${({ theme }) => theme.fontWeightStrong};
+ font-weight: ${({ theme }) => theme.fontWeightBold};
Review Comment:
**Suggestion:** `theme.fontWeightBold` is not part of the default filtered
Ant Design tokens used to build `SupersetTheme`, so it resolves to `undefined`
in standard themes. This makes the generated CSS `font-weight` invalid and the
header will not render bold. Use `theme.fontWeightStrong`, which is the
established and guaranteed token in this codebase. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Metadata tooltip headers fail to appear bold.
- ⚠️ Dashboard metadata readability regresses on default themes.
- ⚠️ Explore and dataset metadata styling becomes inconsistent.
```
</details>
```suggestion
font-weight: ${({ theme }) => theme.fontWeightStrong};
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open any flow rendering metadata bars, e.g. dashboard header
(`src/dashboard/components/Header/index.tsx:542` calls
`useDashboardMetadataBar`, which
returns `<MetadataBar ...>` at
`src/dashboard/components/Header/useDashboardMetadataBar.tsx:55`) or explore
header
(`src/explore/components/ExploreChartHeader/useExploreMetadataBar.tsx:73`).
2. Hover a metadata item to open tooltip; `MetadataBar` builds tooltip
content via
`config(contentType)` at
`packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx:123`,
then renders
tooltip body at `MetadataBar.tsx:151-154`.
3. Tooltip header is rendered by `Header` in `ContentConfig.tsx:25-27`,
currently using
`theme.fontWeightBold` (`ContentConfig.tsx:26`).
4. Theme construction filters AntD tokens by `allowedAntdTokens` in
`packages/superset-core/src/theme/Theme.tsx:76-84`; token list includes
`fontWeightStrong`
(in `packages/superset-core/src/theme/types.ts`, `allowedAntdTokens`) but not
`fontWeightBold`, so default theme objects can leave `fontWeightBold`
undefined and CSS
becomes non-bold/invalid for this rule.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx
**Line:** 26:26
**Comment:**
*Logic Error: `theme.fontWeightBold` is not part of the default
filtered Ant Design tokens used to build `SupersetTheme`, so it resolves to
`undefined` in standard themes. This makes the generated CSS `font-weight`
invalid and the header will not render bold. Use `theme.fontWeightStrong`,
which is the established and guaranteed token in this codebase.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38608&comment_hash=55906593705244a4af184d9b45d29c9c8739a998ccfad04ec7d0ea59ddf31388&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38608&comment_hash=55906593705244a4af184d9b45d29c9c8739a998ccfad04ec7d0ea59ddf31388&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]