Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,13 @@ export function useMetricDetectorThresholdSeries({
data: [],
};
});

additional.push(...thresholdSeries);
// Add manual resolution line and safe area if present (green)
if (resolution) {

// Resolution is considered "automatic" when it equals any alert threshold value
const isResolutionManual = Boolean(
resolution && !thresholds.some(threshold => threshold.value === resolution.value)
);
if (resolution && isResolutionManual) {
Copy link

Choose a reason for hiding this comment

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

Bug: Thresholds Disappear in Static Detection Charts

Alert threshold lines and areas are missing from charts for static detection types. This happens because the additional.push(...thresholdSeries); line, which adds these thresholds, was accidentally removed during changes to the resolution display logic.

Fix in Cursor Fix in Web

const resolutionSeries: LineSeriesOption = {
type: 'line',
markLine: createThresholdMarkLine(theme.green300, resolution.value),
Expand All @@ -243,7 +246,7 @@ export function useMetricDetectorThresholdSeries({

const valuesForMax = [
...thresholds.map(threshold => threshold.value),
...(resolution ? [resolution.value] : []),
...(resolution && isResolutionManual ? [resolution.value] : []),
];
const maxValue = valuesForMax.length > 0 ? Math.max(...valuesForMax) : undefined;
return {maxValue, additionalSeries: additional};
Expand Down