Skip to content

Conversation

@lzhao-sentry
Copy link
Contributor

@lzhao-sentry lzhao-sentry commented Aug 14, 2025

Changes

Make WidgetCardChart functional.

Also doesn't seem like expandNumbers is used anymore. I'll look into opening another PR to clean up the props if this one gets merged in

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 14, 2025
@lzhao-sentry lzhao-sentry marked this pull request as ready for review August 15, 2025 13:20
@lzhao-sentry lzhao-sentry requested a review from a team August 15, 2025 13:20
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Two small comments, but otherwise this is great 👏🏻

Comment on lines -160 to -162
const sortMatches =
props.location.query[WidgetViewerQueryField.SORT] ===
prevProps.location.query[WidgetViewerQueryField.SORT];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 is this not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops sorry for the late reply, got distracted with other stuff. location isn't a prop anymore, so think we're good here.

Comment on lines -102 to -119
dashboardFilters?: DashboardFilters;
disableTableActions?: boolean;
disableZoom?: boolean;
expandNumbers?: boolean;
isMobile?: boolean;
isSampled?: boolean | null;
legendOptions?: LegendComponentOption;
minTableColumnWidth?: number;
noPadding?: boolean;
onLegendSelectChanged?: EChartEventHandler<{
name: string;
selected: Record<string, boolean>;
type: 'legendselectchanged';
}>;
onWidgetTableResizeColumn?: (columns: TabularColumn[]) => void;
onWidgetTableSort?: (sort: Sort) => void;
onZoom?: EChartDataZoomHandler;
router?: InjectedRouter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that after the refactor it turned out that these weren't used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to router and expandNumbers. I moved the table related props under the TableResultProps. Which now you point out, I should probably rename it to TableComponentProps or the like

Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

cursor[bot]

This comment was marked as outdated.

props.widget.displayType !== DisplayType.TOP_N && !defined(props.widget.limit);
const legendMatches = isEqual(props.legendOptions, prevProps.legendOptions);
return selectionMatches && (sortMatches || isNotTopNWidget) && legendMatches;
return selectionMatches && isNotTopNWidget && legendMatches;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: TopN Widgets Suffer Unnecessary Re-renders

The shouldWidgetCardChartMemo logic now causes TopN widgets and widgets with limits to always re-render. This is because isNotTopNWidget is false for them, and the sortMatches condition was removed, resulting in unnecessary re-renders and a performance regression.

Fix in Cursor Fix in Web

@lzhao-sentry lzhao-sentry merged commit 6597345 into master Aug 15, 2025
46 checks passed
@lzhao-sentry lzhao-sentry deleted the lzhao/ref/convert-widget-card-to-functional branch August 15, 2025 17:41
priscilawebdev pushed a commit that referenced this pull request Aug 25, 2025
### Changes

Make `WidgetCardChart` functional.  

Also doesn't seem like `expandNumbers` is used anymore. I'll look into
opening another PR to clean up the props if this one gets merged in
andrewshie-sentry pushed a commit that referenced this pull request Aug 26, 2025
### Changes

Make `WidgetCardChart` functional.  

Also doesn't seem like `expandNumbers` is used anymore. I'll look into
opening another PR to clean up the props if this one gets merged in
@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants