Skip to content

fix(web): count open anomalies apart from firing incidents on the overview banner - #2360

Merged
Makisuo merged 3 commits into
mainfrom
fix/overview-anomalies-not-incidents
Nov 7, 2026
Merged

Makisuo merged 3 commits into
mainfrom
fix/overview-anomalies-not-incidents

Conversation

@Makisuo

@Makisuo Makisuo commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

What

Anomaly rules open ordinary alert incidents, so the Overview banner counted an open anomaly as a firing incident: one anomaly showed as a red "Firing now · 1 incident · 1 critical".

The banner now treats incidents from anomaly rules (signalType: "anomaly") as open anomalies, and is a one-line strip about half the old height:

  • Only anomalies open: an amber "Open: 1 anomaly" strip instead of the red one.
  • Only incidents firing: a red "Firing now: 1 incident · 1 critical" strip, counting only non-anomaly incidents.
  • Both: one strip with the two segments side by side, each with its own dot and colour, and the rules count once.
  • Nothing open: no strip at all (the "All clear" card is gone), so the health rail moves up.

The count split is heroCountsOf in view-hero.ts, shared by the page and a new /lab/anomaly-alerts?state=overview-banner state.

Screenshots

Before (prod) After (/lab/anomaly-alerts?state=overview-banner)
before after

After: the three cases, captioned in the lab. Only one strip ever shows on the page; all clear draws nothing.

Not changed

The service health list under the banner still counts an anomaly-rule incident as an alert on its service.

Verification

  • vitest run src/page/overview src/lab: 130 passed, including a new scene test for both cases.
  • oxlint -c .oxlintrc.effect.json clean on the changed files, web typecheck clean, ui:patterns:check OK.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The overview now displays a compact alert banner with separate counts for firing incidents and open anomalies, plus enabled and total alert rules. The banner is hidden when there are no firing incidents or open anomalies.
    • Added an overview-banner option in the anomaly alerts lab, with examples for an open anomaly, a firing incident, and both together.

…rview banner

Anomaly rules open alert incidents, so a single open anomaly showed as a
red "Firing now 1 incident". The banner now counts only non-anomaly
incidents as firing, shows an amber "Open anomalies" banner when only
anomalies are open, and appends the open anomaly count to the firing one.
@maple-review-bot

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The overview now counts open anomaly incidents separately from other open incidents. Its alert banner displays critical and warning segments for the applicable counts and is omitted when neither count is present. The anomaly-alerts lab adds examples for anomaly-only, incident-only, and mixed cases.

Changes: Overview alert banners

Layer / File(s) Summary
Count and render overview banners
apps/web/src/page/overview/view-hero.ts, apps/web/src/page/overview/view-health.ts, apps/web/src/page/overview/overview.scene.test.ts
The overview counts open anomalies separately from other open incidents and renders banner segments from those counts. Tests cover no live alerts, firing incidents, anomaly-only incidents, and mixed incidents.
Add overview banner lab scenarios
apps/web/src/lab/anomaly-alerts-lab.ts, apps/web/src/lab/registry.ts
The lab adds an overview-banner state with examples for an anomaly, an incident, and both. The lab description lists the overview alert banner.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to eaab7

The overview banner separates open anomalies from firing incidents, and no actionable merge-blocking risk was established.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the overview banner now counts open anomalies separately from firing incidents. The raw summary and PR objectives both confirm this is the primary change, covering her…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the overview banner now counts open anomalies separately from firing incidents. The raw summary and PR objectives both confirm this is the primary change, covering heroCountsOf in view-hero.ts, the banner strip split, the new lab state, and the updated overview tests. The title is specific, follows conventional commit form, and is 81 characters, which is within a normal title length.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 5 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b46380a5-ada1-4bef-be51-57655be906df
Commits

Reviewing files that changed from the base of the PR and between acfa37f and eaab70e.

Files selected for processing: 3

  • apps/web/src/lab/anomaly-alerts-lab.ts
  • apps/web/src/page/overview/overview.scene.test.ts
  • apps/web/src/page/overview/view-hero.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@maple-review-bot

This comment has been minimized.

@maple-review-bot

maple-review-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 9/10 · safe to merge. The anomaly split is correct and pinned by a scene test; the all-clear assertion at overview.scene.test.ts:246 still cannot fail.
2 notes · tests partial −1 · risk medium

The Overview banner now separates anomaly-rule incidents (amber "Open") from firing incidents (red "Firing now"), drawn as one slim strip that disappears when nothing is open. The count split is correct; the two findings already open on this pull request still stand.

  • heroCountsOf counts anomaly-rule incidents apart from firing ones
  • alertFiringHero returns no element when all clear, dropping the All clear card
  • New /lab/anomaly-alerts?state=overview-banner state shows each strip case

Still open from earlier reviews

eaab70e · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit 0850223 into main Nov 7, 2026
28 checks passed
@Makisuo
Makisuo deleted the fix/overview-anomalies-not-incidents branch November 7, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant