unbridled-41 opened a new pull request, #5445:
URL: https://github.com/apache/rocketmq-dashboard/pull/5445

   ## Problem / Evidence
   
   The system-alerts header reads **"集群运行告警监控,当前 {n} 条未确认"**, but `n` is 
counted from the rows of the current page:
   
   - `web/src/pages/ops/systemAlerts.tsx:241` — `const unackCount = 
alerts.filter((a) => !a.acknowledged).length;` where `alerts` is only the 
current page (`:209 setAlerts(data.items)`), page size 20 (`:160`), with 
pagination shown once `total > pageSize` (`:834-843`).
   - Reproduction: a feed with more than 20 alerts → the number changes as the 
operator pages (and never exceeds 20) while the subtitle presents it as the 
feed's backlog. The per-level badges (`:507-515`) count the same page-scoped 
array.
   
   ## Root cause / Fix
   
   A page-scoped array drives a headline that is labelled (and positioned) as a 
feed-wide number. Make the scope explicit:
   
   ```
   zh: '集群运行告警监控,本页 {n} 条未确认'
   en: 'Cluster alert monitoring, {n} unacknowledged on this page'
   ```
   
   A true total would need an aggregate the list API does not return 
(`SystemAlertController.listAlertsPage` has no acknowledged filter and no 
counts), so that is deliberately left as a follow-up rather than invented 
client-side.
   
   ## Priority & scoring
   
   PRIORITY 55 = 影响 12 (the headline understates the unacknowledged backlog and 
moves as the operator pages) + 波及 8 (system-alerts header and badges) + 可复现 20 
(deterministic with more than one page) + 维护价值 15 (states the real scope 
instead of implying a total).
   
   FIX_CONFIDENCE 85: a copy change matching the data actually rendered, pinned 
by a regression.
   
   ## Tests
   
   ```
   cd web && npx vitest run src/pages/ops/__tests__/SystemAlertsPage.test.tsx
   ```
   
   - Red before the fix: `scopes the header unacknowledged count to the page it 
counted` fails — `Unable to find an element with the text: /本页 1 条未确认/`.
   - Green after: `Tests 19 passed (19)` (the new test renders a 60-alert feed 
whose first page holds one unacknowledged alert).
   - `npx tsc -b` and `npx eslint` on both files: clean.
   
   ## Risk
   
   None beyond wording; no request or state changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to