bito-code-review[bot] commented on code in PR #37167:
URL: https://github.com/apache/superset/pull/37167#discussion_r2695600043


##########
superset-frontend/src/dashboard/components/SliceHeader/index.tsx:
##########
@@ -113,252 +122,193 @@ const ChartHeaderStyles = styled.div`
     }
 
     .dropdown-menu.dropdown-menu-right {
-      top: ${theme.sizeUnit * 5}px;
+      top: ${theme.gridUnit * 5}px;
     }
 
     .divider {
-      margin: ${theme.sizeUnit}px 0;
+      margin: ${theme.gridUnit}px 0;
     }
 
     .refresh-tooltip {
       display: block;
-      height: ${theme.sizeUnit * 4}px;
-      margin: ${theme.sizeUnit}px 0;
-      color: ${theme.colorTextLabel};
+      height: ${theme.gridUnit * 4}px;
+      margin: ${theme.gridUnit}px 0;
+      color: ${theme.colors.text.label};
     }
   `}
 `;
 
-const SliceHeader = forwardRef<HTMLDivElement, SliceHeaderProps>(
-  (
-    {
-      forceRefresh = () => ({}),
-      updateSliceName = () => ({}),
-      toggleExpandSlice = () => ({}),
-      logExploreChart = () => ({}),
-      logEvent,
-      exportCSV = () => ({}),
-      exportXLSX = () => ({}),
-      editMode = false,
-      annotationQuery = {},
-      annotationError = {},
-      cachedDttm = null,
-      queriedDttm = null,
-      updatedDttm = null,
-      isCached = [],
-      isExpanded = false,
-      sliceName = '',
-      supersetCanExplore = false,
-      supersetCanShare = false,
-      supersetCanCSV = false,
-      exportPivotCSV,
-      exportFullCSV,
-      exportFullXLSX,
-      slice,
-      componentId,
-      dashboardId,
-      addSuccessToast,
-      addDangerToast,
-      handleToggleFullSize,
-      isFullSize,
-      chartStatus,
-      formData,
-      width,
-      height,
-      exportPivotExcel = () => ({}),
-    },
-    ref,
-  ) => {
-    const SliceHeaderExtension = extensionsRegistry.get(
-      'dashboard.slice.header',
-    );
-    const uiConfig = useUiConfig();
-    const shouldShowRowLimitWarning =
-      !isEmbedded() || uiConfig.showRowLimitWarning;
-    const dashboardPageId = useContext(DashboardPageIdContext);
-    const [headerTooltip, setHeaderTooltip] = useState<ReactNode | null>(null);
-    const headerRef = useRef<HTMLDivElement>(null);
-    // TODO: change to indicator field after it will be implemented
-    const crossFilterValue = useSelector<RootState, any>(
-      state => state.dataMask[slice?.slice_id]?.filterState?.value,
-    );
-    const isCrossFiltersEnabled = useSelector<RootState, boolean>(
-      ({ dashboardInfo }) => dashboardInfo.crossFiltersEnabled,
-    );
+const SliceHeader: FC<SliceHeaderProps> = ({

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Ref forwarding broken</b></div>
   <div id="fix">
   
   Changing from forwardRef to FC breaks ref passing, as FC doesn't support 
refs. The parent component in Chart.jsx passes ref={headerRef} for height 
calculations, which will now fail (headerRef.current becomes null).
   </div>
   
   
   </div>
   
   <details>
   <summary><b>Citations</b></summary>
   <ul>
   
   <li>
   Rule Violated: <a 
href="https://github.com/apache/superset/blob/0279fbd/.cursor/rules/dev-standard.mdc#L36";>dev-standard.mdc:36</a>
   </li>
   
   </ul>
   </details>
   
   
   
   
   <small><i>Code Review Run #053473</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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]

Reply via email to