Repository navigation
fix(app): highlight region above threshold for "above" alerts - #3488
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 99ca2c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
PR Review✅ No issues found. |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryCorrects the shaded firing regions for above-threshold and outside-range alerts.
Reviews (3) · Last reviewed commit: "test(app): assert reference-area shading..." · Reviewed by Greptile |
Deep ReviewScope: The y1/y2 edge semantics are internally consistent across all branches (both "above" firing regions use bare ✅ No critical issues found. 🟡 P2 — recommended
🔵 P3 nitpicks (3)
Reviewers (5): correctness, testing, maintainability, kieran-typescript, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 457 passed • 1 skipped • 1626s
Tests ran across 4 shards in parallel. |
Recharts v3 flipped the default edge for open-ended ReferenceAreas: on the Y axis a missing y1 now snaps to the top and a missing y2 to the bottom, the reverse of v2. ABOVE/ABOVE_EXCLUSIVE used only y1, so the red firing region filled below the threshold. NOT_BETWEEN was similarly inverted. Move the single open-ended bound to the correct prop so the shaded region lands on the firing side of the threshold, and pin the y1/y2 props per threshold type in unit tests. Co-authored-by: Drew Davis <pulpdrew@gmail.com>
Replace the prop-only getAlertReferenceLines tests with ones that render the areas in a fixed-size chart and check which side of the threshold line gets shaded. The prop-only checks restated the implementation and would survive a future Recharts default-edge flip; they also tripped the app lint warning cap via unsafe type assertions. Co-authored-by: Drew Davis <pulpdrew@gmail.com>
d81efa4 to
99ca2c9
Compare
Summary
The alert preview chart shaded the wrong side of the threshold: for an "above" alert the red firing region was drawn below the threshold line. Outside/not between was also wrong.
Screenshots or video
Before
After
How to reproduce
Create an alert with an above or at least threshold.
References