Repository navigation
fix(operations): a filter on the Notifications tab no longer rewrites the global pending counts (#3449) - #3474
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The store's list fetch no longer derives
pendingCountfrom the loaded (filtered, page-capped) rows; the count comes only from the existingGET /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
Testing
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
🤖 Generated with Claude Code