Skip to content

fix(operations): a filter on the Notifications tab no longer rewrites the global pending counts (#3449) - #3474

Merged
vybe merged 1 commit into
devfrom
feature/3449-notification-counts
Oct 9, 2026
Merged

vybe merged 1 commit into
devfrom
feature/3449-notification-counts

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Description

The store's list fetch no longer derives pendingCount from the loaded (filtered, page-capped) rows; the count comes only from the existing GET /api/notifications/count?status=pending. Acknowledge and dismiss decrement only when the row was pending. The panel's third card showed a page-capped row count labelled Total; it now reads Shown.

Part of the UI sweep epic #3471.

Related Issue

Fixes #3449

Journey Impact

Journey Impact: none: bug fix to existing behaviour found by the UI sweep; no journey promise is added or changed

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • I have tested this locally
  • New tests added (if applicable)
  • All existing tests pass
  • Every new test executes the changed path

Mutation: notificationsPendingCount.spec.js — 7 red with the store change reverted, 1 red (the mounted case) with the panel change reverted; restored byte-identical.

UI verification: on a preview frontend over a live local backend with 502 pending notifications: header, tab badge, nav badge and Pending card stay at 502 under Status = Acknowledged, Show dismissed and a single-agent filter, matching GET /api/notifications/count?status=pending; the third card reads Shown and tracks the listed rows.

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation (if applicable)
  • I have not committed any sensitive data (API keys, credentials, etc.)

🤖 Generated with Claude Code

…ows the list filter (#3449)

The notifications store recomputed `pendingCount` from the rows the
Notifications tab had loaded (`updatePendingCount()` at the end of every list
fetch). That list is filtered and capped at one page, so choosing a status or
an agent, or just loading the default 50-row page, rewrote the Operations
header, the Notifications tab badge and the NavBar badge.

`pendingCount` is now written only from the existing count endpoint
(`GET /api/notifications/count`, #1143) plus the optimistic +/-1 of a live
event or a row verb. A first-page list fetch re-reads the count beside it
instead of deriving it. Acknowledge / dismiss take one off only when the row
was pending, so dismissing an acknowledged row under a filter no longer moves
the badge. The panel's third card said "Total" over a page-capped row count
next to the global Pending figure; it now says "Shown" and counts the rows
rendered.

Test: tests/unit/notificationsPendingCount.spec.js (store with the HTTP client
stubbed, plus a mount of NotificationsPanel). Mutation check: with
stores/notifications.js reverted all 7 cases go red; with only the panel
reverted the mounted case goes red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge-train: batch validated on train/20261009-2301-a (#3500)

@vybe
vybe merged commit a9bc8bb into dev Oct 9, 2026
24 checks passed
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.

2 participants