feat(alerts): scroll Slack alert links to the firing tile#2244
feat(alerts): scroll Slack alert links to the firing tile#2244teeohhem wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🔴 Tier 4 — CriticalTouches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
PR Review✅ No critical issues found. Minor (non-blocking) observations:
|
E2E Test Results✅ All tests passed • 131 passed • 2 skipped • 885s
Tests ran across 3 shards in parallel. |
Deep Review🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (6): correctness, testing, maintainability, api-contract, kieran-typescript, adversarial. Testing gaps:
|
When a dashboard tile alert fires, the link in Slack now includes ?highlightedTileId=<id>. The dashboard page already scrolls to and highlights the matching tile when this query param is set, so this change only plumbs alert.tileId through buildChartLink — no frontend changes are required. - Add optional tileId to AlertProvider.buildChartLink. - Default provider appends highlightedTileId when tileId is set. - buildAlertMessageTemplateHdxLink passes alert.tileId through. - Unit tests cover tileId present / undefined / empty-string. - Existing inline snapshots updated to reflect the new param.
484e0e7 to
1dd478a
Compare
…link When an alert link points at a tile that lives inside a non-active tab, the tile isn't in the DOM, so the existing scrollIntoView/highlight effect silently no-ops. Switch to the tile's tab once on arrival so the tile renders. Guard with a ref keyed on highlightedTileId so a user who manually switches tabs afterwards isn't reverted.
Summary
When a dashboard tile alert fires and posts to Slack, the link drops you on the dashboard at the right time range but doesn't tell you which tile triggered the alert — on a busy dashboard you have to hunt for it.
The dashboard page already scrolls to and highlights a tile when the URL has
?highlightedTileId=<id>(the in-app alert-link path onAlertsPage.tsxhas used this for a while). This PR closes the two gaps that kept that behavior from working for Slack alert links:scrollIntoView/highlight silently no-ops.Changes
Backend (API):
AlertProvider.buildChartLinkgains an optionaltileId?: string.DefaultAlertProvider.buildChartLinkappendshighlightedTileId=<tileId>to the URL when set, omits it when undefined or empty.buildAlertMessageTemplateHdxLinkpassesalert.tileIdthrough.tileIdpresent / undefined / empty-string.checkAlerts.test.tsupdated for the new param.Frontend (App):
?highlightedTileId=<id>, if the tile's container has tabs and the tile is in a non-active tab, switch to it once so the tile renders. Guarded by a ref keyed onhighlightedTileIdso a user manually switching tabs afterwards isn't reverted.What the user sees
Before: Slack alert link → dashboard loads at the alert's time range, no indication of which tile fired.
After: Slack alert link → dashboard loads at the alert's time range, the firing tile's tab is selected if needed, and the tile is scrolled into view with the existing orange highlight fade (same UI as clicking an alert link from inside the app).
Out of scope
The earlier draft of this PR also added auto-expand for collapsed containers, a persistent/dismissible highlight, and a new e2e regression test. Those were dropped to keep this change focused — the existing scroll/highlight is good enough for the common case, and the extras can land separately if needed.
Test plan
make ci-lint— passestsc --noEmitonpackages/app— passescheckAlerts(Slack/webhook URL inline snapshots)DefaultAlertProvider.buildChartLinkReferences