Skip to content

feat(app): let users permanently dismiss the metric drill-down warning - #3304

Merged
knudtty merged 2 commits into
mainfrom
aaron/allow-dismissing-drilldown-warning
Oct 6, 2026
Merged

knudtty merged 2 commits into
mainfrom
aaron/allow-dismissing-drilldown-warning

Conversation

@knudtty

@knudtty knudtty commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Summary

The "No log source is associated with the selected metric source" notification was noisy and didn't provide a great bit of info. I rephrased it to "Drill-down is unavailable for metric sources that lack correlated log sources". Additionally, if a user closes the notification, it is dismissed for future notifications. This is persisted in localStorage

Screenshots or video

image

References

  • Closes HDX-4808
  • Closes HDX-5294

@changeset-bot

changeset-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7ade709

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

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

@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Oct 6, 2026 7:30pm UTC
hyperdx-storybook Ready Ready Preview Oct 6, 2026 7:30pm UTC

Request Review

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 1
  • Production lines changed: 31 (+ 126 in test files, excluded from tier calculation)
  • Branch: aaron/allow-dismissing-drilldown-warning
  • Author: knudtty

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 128 in total (1.79%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

Comment thread packages/app/src/ChartUtils.tsx Resolved
Comment thread packages/app/src/ChartUtils.tsx Resolved
Comment thread packages/app/src/ChartUtils.tsx Resolved
Comment thread packages/app/src/ChartUtils.tsx Resolved
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

2 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 2 minor

1 posted as inline comment(s) on the changed lines. 1 listed below.

Findings outside the changed lines

1 minor
  • 🔵 packages/app/src/__tests__/metricDrilldownWarning.test.tsx:162 — Close-button test never checks that the toast actually closes → Mantine's Notification renders its CloseButton with both closeButtonProps and its own onClick={onClose}, so a custom closeButtonProps.onClick can replace the close handler. This test would still pass if the X saved the flag but left the toast on screen. After the click, add await waitFor(() => expect(screen.queryByRole('alert')).not.toBeInTheDocument()).

Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds persistent dismissal to a UI warning.

The PR appears safe to merge; the previous storage-read issue is fixed.

What we checked:

  • Blocked storage still shows warning: isNoLogSourceWarningDismissed catches failed reads and returns false. The caller then shows the warning and returns null.

Summary

Users can close the metric drill-down warning to hide it on future attempts in that browser.

  • Rewords the warning and gives it a fixed ID to prevent duplicate notifications.
  • Protects storage reads when browser settings block access.
  • Adds tests for dismissal, blocked storage, and closing without saving the preference.

Reviews (2) · Last reviewed commit: "fix: pr suggestions"

Comment thread packages/app/src/ChartUtils.tsx Resolved
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

Scope: 1 production file (packages/app/src/ChartUtils.tsx, ~18 lines), 1 new test file, 1 changeset. Intent: reword the metric drill-down "no log source" warning, persist its dismissal to localStorage via the toast close button, and give the toast a fixed id so repeated triggers don't stack.

✅ No critical issues found.

The core change is sound: Mantine v9 dedupes notifications.show by id, so the fixed id correctly prevents stacking; the read path guards for SSR and swallows storage errors; and the prior review comment about a blocked-storage read throwing is already addressed by isNoLogSourceWarningDismissed()'s try/catch (covered by a test).

🟡 P2 -- recommended

  • packages/app/src/__tests__/metricDrilldownWarning.test.tsx -- The fixed-id anti-stacking behavior has no test; no case invokes the drill-down twice without dismissing and asserts a single toast, so removing the id would silently keep the suite green.
    • Fix: Add a test that calls buildEventsSearchUrl twice without dismissing and asserts exactly one notification renders.
🔵 P3 nitpicks (4)
  • packages/app/src/ChartUtils.tsx:1321 -- The dismissal write uses bare localStorage.setItem while the read helper uses guarded window.localStorage, an asymmetric access pattern.
    • Fix: Route the write through a window.localStorage helper mirroring isNoLogSourceWarningDismissed.
    • maintainability, kieran-typescript
  • packages/app/src/ChartUtils.tsx:1317 -- The toast id 'no-log-source-associated' is an inline magic string while the related storage key is a module const.
    • Fix: Hoist the toast id into a module const alongside NO_LOG_SOURCE_WARNING_DISMISSED_KEY.
  • packages/app/src/ChartUtils.tsx:1318 -- Dismissal persists only on explicit close-button click, so Mantine's default auto-close path leaves the preference unsaved.
    • Fix: Confirm this is the intended behavior and document it with a short comment, or move persistence to an onClose handler if any dismissal should persist.
  • packages/app/src/__tests__/metricDrilldownWarning.test.tsx -- The setItem try/catch in the close handler has no test exercising a write failure.
    • Fix: Add a test that mocks Storage.prototype.setItem to throw and clicks the close button, asserting the error is swallowed.
    • testing, maintainability

Reviewers (3): testing, maintainability, kieran-typescript (correctness and julik-frontend-races were dispatched but had not returned at synthesis time; Mantine dedup behavior and the prior greptile comment were verified directly).

Testing gaps:

  • No assertion that two consecutive drill-downs render exactly one toast (fixed-id dedup).
  • No coverage of localStorage.setItem throwing inside the close-button handler.
  • No coverage of the SSR (window === undefined) branch of isNoLogSourceWarningDismissed.

Residual risk: Dismissal is permanent and global across all metric sources lacking a correlated log source, with no in-app reset path — appears intentional per the change's goal, but worth a product sanity check.

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

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 399 passed • 1 skipped • 1451s

Status Count
✅ Passed 399
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

Comment thread packages/app/src/ChartUtils.tsx Resolved
@knudtty
knudtty merged commit 46ff1fc into main Oct 6, 2026
30 checks passed

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 7ade7095 Deployed Oct 6, 2026 by vercel[bot]
Preview – hyperdx-storybook — 7ade7095 Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants