Repository navigation
feat(ui): AI recent events and diagnostic tabs on alert details - #34031
Conversation
In AI mode the alert details page no longer renders the classic antd Recent Events and Diagnostic Info tabs or the antd header skeleton. - useAlertDetailsData: the antd-free state and actions of useAlertDetailsPage. The classic hook wraps it and keeps its return shape. - AlertAiRecentEventsTab: core Accordion, status filter Select and offset Pagination; same listEvents requests and event test ids as classic. - AlertAiDiagnosticTab: core Card with the same diagnostic items. - AlertAiEventCounts: total, pending and failed counts with a core Skeleton.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
| Count | Rule |
|---|---|
| 3 | openmetadata-imports/no-lower-layer-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/observability/Alerts/AlertDetailsPage.test.tsx:29:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/observability/Alerts/AlertDetailsPage.tsx:42:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/utils/Alerts/AlertsUtilPure.ts:46:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed…lert-data-hook-tabs # Conflicts: # .github/playwright/impact-map.generated.json
- AlertAiRecentEventsTab: Select value/onChange instead of the deprecated selectedKey/onSelectionChange (Sonar S1874). - AlertAiDiagnosticTab: type the diagnostic value, so String() cannot print [object Object] (Sonar S6551). - Move useAlertDetailsData and useAlertDetailsPermissions (with their types) to hooks/observability/alerts, so the AI details page no longer imports a page module; the classic page interface derives from them. - AiNotificationAlerts spec: create and clean up fixtures through performAdminLogin instead of browser.newPage().
- formatDiagnosticValue moves to AlertsUtilPure next to getDiagnosticItems, uses lodash isBoolean and the shared i18n `t`. - AlertAiDiagnosticTab fetches through a useCallback with try/catch; the effect only calls it. - Recent events: drop the LabelledIcon wrapper. The event header is a button, so a tooltip trigger inside it nested a button in a button. Status is now a core BadgeWithIcon and the entity type is shown as text.
Code Review ✅ Approved 2 closed / 2 findings🟡 Medium risk · AI alert details add event and diagnostic views through shared state extraction. Adds AI Recent Events and Diagnostic tabs to alert details in AI mode, replacing antd components with ✅ 2 closed✅ Bug: Initial events fetch ignores currentPage restored from the URL
Closed: Quality: New components import icons from @untitledui/icons
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Summary
In AI mode the alert details page (Observability → Alerts and Settings → Notifications) now renders its Recent Events and Diagnostic Info tabs, and the header event counts, with
@openmetadata/ui-core-componentsinstead of the classic antd components. Classic mode is unchanged.The classic
useAlertDetailsPagenow wrapsuseAlertDetailsDataand adds its tab items, header info and icon on top, so it returns the same shape and classic doesn't change. Because the AI page no longer imports the classic hook, it no longer pulls in the classic tab components or their antd dependencies.What stays the same as classic:
listEventssendslimitandpaginationOffset, plusstatuswhen a filter is set.diagnosticInfois called for the alert FQN.event-collapse-*,event-details-*,event-data-*,total-events-count,pending-events-count,failed-events-count.What changes, UI only:
--instead ofundefined.Fixes #34121
Part of open-metadata/openmetadata-collate#6826 (PR 2a, T5); dark mode for #6530.
Evidence
Screenshots of
ActivityFeedAlert(7,659 events) in light and dark are attached below.AlertAiRecentEventsTab.test.tsx(5): expand shows the details and JSON; empty state; failure reason;status=failedfilter with the filtered empty state; next page requests offset 15.AlertAiDiagnosticTab.test.tsx(2): values and Yes/No;--and a toast when the request fails.AlertDetailsPage.test.tsx(17): the tabs list, the recent events and diagnostic content, and the counts in the header.pages/AlertDetailsPageandcomponents/Alerts/AlertDetailssuites still pass. In total, 62 tests across 8 suites.Features/AIMode/AiNotificationAlerts.spec.ts): the new test notification alert details show recent events and diagnostic info runs in light and dark.status=failed.expectThemeandexpectSurfaceThemeon the diagnostics card.Merge Danger
Door: two-way
A new AI component tree plus a hook extraction; a revert restores the previous rendering.
Blast Radius: AI alert details
🤖 Generated with Claude Code