Copilot commented on code in PR #36781:
URL: https://github.com/apache/superset/pull/36781#discussion_r2673559941
##########
superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx:
##########
@@ -20,8 +20,8 @@ import { styled, css } from '@apache-superset/core/ui';
export const ControlSubSectionHeader = styled.div`
${({ theme }) => css`
- font-weight: ${theme.fontWeightStrong};
- margin-bottom: ${theme.sizeUnit}px;
+ font-weight: ${theme.typography.weights.medium};
Review Comment:
The property `theme.typography.weights.medium` does not exist in the theme
definition. Based on the codebase search, the theme does not have a
`typography` object with nested `weights` property.
The theme has `theme.fontWeightStrong` (number) defined in
SupersetSpecificTokens, but no `typography.weights.medium`. This will cause a
runtime error when this component is rendered.
Consider using `theme.fontWeightStrong` or another existing font weight
property from the theme.
```suggestion
font-weight: ${theme.fontWeightStrong};
```
##########
superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx:
##########
@@ -20,8 +20,8 @@ import { styled, css } from '@apache-superset/core/ui';
export const ControlSubSectionHeader = styled.div`
${({ theme }) => css`
- font-weight: ${theme.fontWeightStrong};
- margin-bottom: ${theme.sizeUnit}px;
+ font-weight: ${theme.typography.weights.medium};
+ margin-bottom: ${theme.gridUnit * 2}px;
Review Comment:
The property `theme.gridUnit` does not exist in the theme definition. The
correct property is `theme.sizeUnit` (which is defined in the allowedAntdTokens
list).
Throughout the codebase, spacing calculations use `theme.sizeUnit`
consistently. This will cause a runtime error when this component is rendered.
Change `theme.gridUnit` to `theme.sizeUnit` to fix this issue.
```suggestion
margin-bottom: ${theme.sizeUnit * 2}px;
```
--
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]