Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions static/app/views/dashboards/widgetCard/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import {
} from 'sentry/views/dashboards/widgets/tableWidget/utils';
import {TextWidgetVisualization} from 'sentry/views/dashboards/widgets/textWidget/textWidgetVisualization';
import {WheelWidgetVisualization} from 'sentry/views/dashboards/widgets/wheelWidget/wheelWidgetVisualization';
import {Widget as WidgetComponent} from 'sentry/views/dashboards/widgets/widget/widget';
import {WidgetError} from 'sentry/views/dashboards/widgets/widget/widgetError';
import {Actions} from 'sentry/views/discover/table/cellAction';
import {decodeColumnOrder} from 'sentry/views/discover/utils';
Expand Down Expand Up @@ -191,7 +192,6 @@ function WidgetCardChart(props: WidgetCardChartProps) {
if (widget.displayType === DisplayType.HEATMAP) {
return (
<TransitionChart loading={loading} reloading={loading}>
<LoadingScreen loading={loading} showLoadingText={showLoadingText} />
<HeatmapSeriesComponent {...props} />
</TransitionChart>
);
Expand Down Expand Up @@ -465,15 +465,11 @@ function HeatmapSeriesComponent(props: TableComponentProps): React.ReactNode {
const {heatmapResults, loading} = props;

if (loading || !heatmapResults) {
return <LoadingPlaceholder />;
return <HeatMapWidgetVisualization.LoadingPlaceholder />;
Comment on lines 467 to +468

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The WidgetLoadingPanel for heatmaps lacks a positioned parent (position: relative) during reloads, causing the loading indicator to be displayed incorrectly outside the chart area.
Severity: MEDIUM

Suggested Fix

Add position: relative; to the ChartWrapper styled-component. This will establish a positioning context for the absolutely positioned WidgetLoadingPanel, ensuring it is correctly constrained within the chart's boundaries during loading states.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/dashboards/widgetCard/chart.tsx#L467-L468

Potential issue: When a heatmap widget reloads data, the `HeatmapSeriesComponent`
renders a `WidgetLoadingPanel`. This panel uses `position: absolute` styling for its
layout. However, it is rendered inside a `ChartWrapper` component that lacks a
`position: relative` (or similar) style property. Because an absolutely positioned
element is positioned relative to its nearest positioned ancestor, the loading panel
will not be constrained to the chart's area. This results in the loading indicator being
displayed incorrectly, potentially overlaying other UI elements outside of the widget's
boundaries.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hm im not seeing this issue visually so i think it's fine? let me know if yall are seeing this

}

if (heatmapResults.values.length === 0) {
return (
<StyledErrorPanel>
<IconWarning variant="primary" size="lg" />
</StyledErrorPanel>
);
return <WidgetComponent.WidgetError error={MISSING_DATA_MESSAGE} />;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {defined} from 'sentry/utils/defined';
import {ECHARTS_MISSING_DATA_VALUE} from 'sentry/utils/timeSeries/timeSeriesItemToEChartsDataPoint';
import {useNavigate} from 'sentry/utils/useNavigate';
import {NO_PLOTTABLE_VALUES} from 'sentry/views/dashboards/widgets/common/settings';
import {WidgetLoadingPanel} from 'sentry/views/dashboards/widgets/common/widgetLoadingPanel';
import {formatTooltipYAxisValue} from 'sentry/views/dashboards/widgets/heatMapWidget/formatters/formatTooltipYAxisValue';
import {formatTooltipZAxisValue} from 'sentry/views/dashboards/widgets/heatMapWidget/formatters/formatTooltipZAxisValue';
import {
Expand Down Expand Up @@ -416,3 +417,5 @@ type HeatMapTooltipContext = HeatMapBucketBounds;
* Context for a drag-selected region, handed to `onZoom`.
*/
export type HeatMapZoomContext = HeatMapBucketBounds;

HeatMapWidgetVisualization.LoadingPlaceholder = WidgetLoadingPanel;
Loading