Skip to content

feat(ui): AI recent events and diagnostic tabs on alert details - #34031

Merged
ShaileshParmar11 merged 6 commits into
mainfrom
ShaileshParmar11/ai-alert-data-hook-tabs
Sep 28, 2026
Merged

ShaileshParmar11 merged 6 commits into
mainfrom
ShaileshParmar11/ai-alert-data-hook-tabs

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

image image

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-components instead of the classic antd components. Classic mode is unchanged.

 <AlertDetailsPage>                                 (AI, components/observability/Alerts)
-  useAlertDetailsPage()                            # built classic antd tab items + header skeleton
+  useAlertDetailsData()                            # same state and actions, no rendered content
   <PageHeader meta>
-    getAlertExtraInfo()                            # antd Divider + Skeleton.Button
+    <AlertAiEventCounts />                         # ExtraInfoLabel + core Skeleton
   <Tabs>
     configuration → <AlertAiForm mode="view" />    # unchanged
-    recentEvents  → <AlertRecentEventsTab />       # antd Collapse, Dropdown, NextPreviousWithOffset, SchemaEditor
+    recentEvents  → <AlertAiRecentEventsTab />     # core Accordion, Select, PaginationCardWithControls, <pre> JSON
-    diagnostic    → <AlertDiagnosticInfoTab />     # antd Card, Row/Col, Tooltip, Skeleton
+    diagnostic    → <AlertAiDiagnosticTab />       # core Card, Tooltip, Skeleton

The classic useAlertDetailsPage now wraps useAlertDetailsData and 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:

  • Requests:
    • listEvents sends limit and paginationOffset, plus status when a filter is set.
    • diagnosticInfo is called for the alert FQN.
    • Page sizes are 15, 25 and 50, paged by offset.
  • Recent Events content:
    • The status and entity icons have tooltips.
    • Expanding an event shows its details, with the failure reason, source and failing subscription id for failed events.
    • The change description is shown as JSON.
    • The empty and filtered-empty states are the same.
  • Test ids: event-collapse-*, event-details-*, event-data-*, total-events-count, pending-events-count, failed-events-count.

What changes, UI only:

  • The change description JSON is pretty-printed in a token-styled block instead of a one-line CodeMirror viewer.
  • The filter is a Select instead of an icon dropdown.
  • The filter now resets to page 1. Classic kept the old page number while fetching offset 0.
  • An unset diagnostic value shows -- instead of undefined.

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.

  • Unit tests:
    • AlertAiRecentEventsTab.test.tsx (5): expand shows the details and JSON; empty state; failure reason; status=failed filter 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.
    • The classic pages/AlertDetailsPage and components/Alerts/AlertDetails suites still pass. In total, 62 tests across 8 suites.
  • Playwright (Features/AIMode/AiNotificationAlerts.spec.ts): the new test notification alert details show recent events and diagnostic info runs in light and dark.
    • It checks the header counts and the recent events list (or its empty state), and that the Failed filter sends status=failed.
    • It checks the Diagnostic Info URL and its values, plus expectTheme and expectSurfaceTheme on the diagnostics card.
    • Result: 2/2 passing locally.

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

  • Classic: it uses the same hook output, since the classic hook is now a thin wrapper around the extracted one.
  • AI: changes are limited to the Recent Events and Diagnostic Info tabs and the header counts. There are no API, schema or route changes.

🤖 Generated with Claude Code

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.
Copilot AI lite review requested due to automatic review settings September 25, 2026 10:28

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 807 → 807
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/generated/entity/services/ingestionPipelines/ingestionPipeline.ts

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 getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

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

Copilot AI review requested due to automatic review settings September 25, 2026 10:28

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 3 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 3 warning(s) across 3 changed file(s).

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

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 73%
73.61% (107325/145795) 58.81% (65576/111488) 60.11% (21668/36045)

…lert-data-hook-tabs

# Conflicts:
#	.github/playwright/impact-map.generated.json

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

- 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().

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

- 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.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown
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 @openmetadata/ui-core-components. Fixed the initial events fetch to respect the current page restored from the URL. Icon imports from @untitledui/icons follow the established pattern used across the observability components. All unit tests (62 across 8 suites) and Playwright tests pass.

✅ 2 closed
✅ Bug: Initial events fetch ignores currentPage restored from the URL

📄 openmetadata-ui/src/main/resources/ui/src/components/observability/Alerts/AlertAiRecentEventsTab.tsx:212-226 📄 openmetadata-ui/src/main/resources/ui/src/components/observability/Alerts/AlertAiRecentEventsTab.tsx:244-247
usePaging sets currentPage from the currentPage URL param, and handleEventsPageChange writes that param through handlePageChange. The mount effect calls fetchEvents() with the default offset 0, though. So if you reload or share a .../recentEvents?currentPage=3 URL, the page loads the first page of events while the pagination control shows page 3. The next/previous buttons then jump from the wrong starting point. To fix this, derive the offset from currentPage in the initial fetch, or reset the page to 1 on mount.

Closed: Quality: New components import icons from @untitledui/icons

📄 openmetadata-ui/src/main/resources/ui/src/components/observability/Alerts/AlertAiRecentEventsTab.tsx:26-32 📄 openmetadata-ui/src/main/resources/ui/src/components/observability/Alerts/AlertAiDiagnosticTab.tsx:15
The frontend guidelines say icons must be imported only from @openmetadata/ui-core-components/icons. The two new AI components import AlertCircle, Bell01, CheckCircle, Clock, FilterLines and InfoCircle directly from @untitledui/icons instead. Switch these imports to the core-components icons entry point.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI alert details: Recent Events and Diagnostic Info tabs without antd

4 participants