Skip to content

chore(ui): reuse the announcements hook, drop the unused reactions variant, share one notification row - #39779

Merged
harsh-vador merged 7 commits into
mainfrom
chore/feed-small-dups
Dec 6, 2026
Merged

harsh-vador merged 7 commits into
mainfrom
chore/feed-small-dups

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#9239

Three small pieces of duplicated activity feed code, one commit each, plus a commit that updates the reactions browser test. They are part of the activity feed cleanup (open-metadata/openmetadata-collate#9236).

Stacked on #39733, which is stacked on #39670. This PR targets fix/feed-bugs, so the diff shows only these three commits. Once the PRs below it merge, it is retargeted to main.

Commit Before After
Announcements DataAssetsHeader, DomainDetails and DataProductsDetailsPage each fetched their active announcements by hand. None of them ignored an out-of-date response. useActiveAnnouncements already did this, but lived in the connection service page folder. The hook moves to hooks/useActiveAnnouncements.ts and all four pages use it. Its fqn is optional: the customized page view passes none, because it never fetched any.
Reactions All 5 <Reactions> callers passed ReactionsVariant.Pill, so the default square-chip variant never rendered. ReactionsVariant, the variant prop and the unused branch are removed. Reactions always draw as pills, which is what every caller already showed.
Notification cards NotificationFeedCard and TaskMentionCard each drew the same row: avatar, message, relative time. NotificationFeedCard used inline hex colours (#37352F, #6B7280) that ignore dark mode. Both render a new NotificationRow. It keeps NotificationFeedCard's spacing and uses the primary and secondary text tokens. Test ids are unchanged.

From review: the data asset header now also reloads its announcement banner when the announcement drawer closes, as the domain, data product and connection service pages already did. A test covers it; it fails without the fix.

Two items from the issue were left out on purpose:

  • One query for "mentions of me". NotificationBox, useUnreadInboxActivity and useInboxActivity already call the same util. They ask for different slices (a limit of 10 for the dropdown, unread-only for the badge, paged for the inbox), so one shared query would only add options.
  • One empty-state wrapper. The issue counted 4 copies inside the feed. The same classes appear 193 times across 138 files in the app, so it is an app-wide change and doesn't belong in this feed cleanup.
9239-notifications

Type of change:

  • Improvement

High-level design:

N/A. One hook moved and reused, one dead variant removed, one shared row component.

Tests:

Use cases covered

  • The announcement hook loads the active announcements for an asset, domain, data product and connection service. It ignores a response that arrives after a newer request. A missing fqn clears the list without a request.
  • Reactions render as pills, with the add-reaction button only while reactions are left to add.
  • Both notification cards render the actor, message and relative time, with their existing test ids.

Unit tests

  • hooks/useActiveAnnouncements.test.ts moved with the hook. Its mocks now point at the new path.
  • Removed one test, "keeps the classic tray", because the variant it checked is gone.
  • playwright/browser-tests/reactions.spec.ts rendered <Reactions> without a variant, so it ran the removed default variant. The tray now goes once every reaction is picked, so the test takes each reaction back through its pill and checks that the tray is gone. All 183 browser-helper tests pass locally.
  • 53 suites (730 tests) pass across components/ActivityFeed, components/NotificationBox, DataAssetsHeader, DomainDetails, DataProductsDetailsPage, ConnectionServiceDetailsPage and InboxPage.
  • tsc: no errors in the changed files. ESLint (0 errors), Prettier and organize-imports leave no diff.

Before / after

Captured against a local backend with the same data, before (the base branch files) and after (this branch). Each pair was also compared pixel by pixel:

  • 9239-announcements.png: the banner on a dashboard, a domain and a data product. Pixel-identical on all three.
  • 9239-notifications.png: the notification dropdown, Tasks and Mentions tabs. Same layout and spacing. Text and time now use the colour tokens, and the message line height is 20px (text-sm) instead of 22px.
  • Reactions: no capture needed. Every caller already rendered the pill variant, so the output can't change.

UI screen recording:

Not applicable: a refactor with the before/after captures above.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>. The issue is in openmetadata-collate, so the title names the area instead.
  • My PR is linked to a GitHub issue via Fixes above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. Not applicable.
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). Not applicable, explained above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md and fixed every 🔴 finding, or answered it on the line below. ReactionsVariant is not used by openmetadata-collate. No removed or renamed test id.
  • Decision check: if this PR decides something the next contributor could undo, it adds a record under docs/decisions/. Not applicable.

🤖 Generated with Claude Code

@harsh-vador
harsh-vador requested a review from a team as a code owner December 4, 2026 09:02
@harsh-vador
harsh-vador requested review from ShaileshParmar11 and removed request for a team December 4, 2026 09:02
@harsh-vador harsh-vador added the UI UI specific issues label Dec 4, 2026
@harsh-vador harsh-vador self-assigned this Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@harsh-vador
harsh-vador added this pull request to stack #39734 December 4, 2026 09:06
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit 05d7164a9c08013a48ba4a329133a4922ea3d7fa in Playwright run 47303050752, attempt 1.

✅ 0 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

⚙️ No test failures. This run failed in CI infrastructure or reporting (see Pipeline and setup failures), not because of your changes — no test action needed from you.

Pipeline and setup failures (5)

  • Duration-aware shard planning finished with status failure.
  • Fixture cache restoration finished with status skipped.
  • Seeded fixture preparation finished with status skipped.
  • The Playwright shard matrix was unexpectedly skipped.
  • No expected Playwright shards were declared.

Performance

⚪ Performance metrics unavailable; see the CI and reporting failures above.

Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@harsh-vador

Copy link
Copy Markdown
Contributor Author

Playwright full suite on the activity feed cleanup stack

PR CI skips Playwright here, so I ran the whole suite on the stack instead (playwright-postgresql-e2e.yml, full_suite=true). The runs were on each branch before today's rebase onto main; the rebase changed no commit in the stack.

Run Covers Passed Failed Flaky (passed on retry)
47305108815 #39670, #39733, #39779 4,799 0 2: Flow/CustomizeWidgets "Pipeline Status Widget", Pages/Glossary "Change glossary term hierarchy using menu options across glossary"
47313014687 #39670, #39733, #39779, #39791 4,799 0 2: Flow/ServiceForm "Verify form selects are working properly", DataQuality/AddTestCaseNewFlow "Add Column Test Case"
  • No infrastructure issues in either run.
  • The flaky tests: none of the four is in an area these PRs change, and none repeats across the two runs.

Base automatically changed from fix/feed-bugs to main December 5, 2026 07:02
…n and data product pages

DataAssetsHeader, DomainDetails and DataProductsDetailsPage each fetched their active announcements by hand, without the latest-request guard useActiveAnnouncements already has. Move the hook from the connection service page into hooks/ and use it in all four; its fqn is optional, and the customized page view passes none, as it fetched none.
Every Reactions caller passes ReactionsVariant.Pill, and Emoji is only rendered by Reactions, so the default square-chip variant never renders. Remove the enum and the variant prop; the reaction row and its chips always draw as pills.
NotificationFeedCard and TaskMentionCard laid out the same row (avatar, message, relative time) separately; NotificationFeedCard did it with inline hex colors that ignore dark mode. Both now render NotificationRow, which keeps NotificationFeedCard's spacing and uses the typography tokens. Test ids stay where they were.
…owser test

The test rendered Reactions without a variant, so it ran the removed default variant, whose tray stays open once every reaction is picked. With pills only, the tray goes and each pill takes its own reaction back, as in every product caller. The test now removes each reaction through its pill and checks the tray is gone.
Domain, data product and connection service pages reload their active announcements when the announcement drawer closes; the data asset header did not, so an announcement added or edited there showed only after a reload.
@harsh-vador
harsh-vador force-pushed the chore/feed-small-dups branch from 4b85b04 to c5d40e8 Compare December 5, 2026 07:03
@gitar-bot

gitar-bot Bot commented Dec 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Moving announcement fetching into a shared hook and adding drawer-close refresh changes banner loading across entity pages; a missed refresh could leave announcements stale.

Consolidates active announcement loading into one useActiveAnnouncements hook used by asset, domain and data product pages, removes the unused default reactions variant, and shares a single NotificationRow between the notification cards. The drawer-close test now checks that the banner reloads rather than the call count. No issues found.

✅ 1 closed
✅ Quality: Drawer-close test checks the call count, not the reloaded banner

📄 openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetsHeader/DataAssetsHeader.test.tsx:1563-1577
The new test only checks that getActiveAnnouncements is called one more time after the drawer closes. It would still pass if the refetched response were thrown away, or if the banner never re-rendered with it, so it never checks the behaviour the commit is for: the banner showing the announcements as they are after an edit. The repo's testing rule asks for assertions on observable outcomes, not on call counts. Make the second response return different data, then assert that the entity-header-announcements banner shows it (or disappears when the response is empty).

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@harsh-vador
harsh-vador merged commit 7a1a9c6 into main Dec 6, 2026
33 of 34 checks passed
@harsh-vador
harsh-vador deleted the chore/feed-small-dups branch December 6, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants