Repository navigation
chore(ui): reuse the announcements hook, drop the unused reactions variant, share one notification row - #39779
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
🔴 Playwright Results — workflow failedValidated commit ✅ 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)
Performance⚪ Performance metrics unavailable; see the CI and reporting failures above.
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
2ba50bb to
60868b8
Compare
Playwright full suite on the activity feed cleanup stackPR CI skips Playwright here, so I ran the whole suite on the stack instead (
|
…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.
4b85b04 to
c5d40e8
Compare
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsMoving 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 ✅ 1 closed✅ Quality: Drawer-close test checks the call count, not the reloaded banner
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
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 tomain.DataAssetsHeader,DomainDetailsandDataProductsDetailsPageeach fetched their active announcements by hand. None of them ignored an out-of-date response.useActiveAnnouncementsalready did this, but lived in the connection service page folder.hooks/useActiveAnnouncements.tsand all four pages use it. Itsfqnis optional: the customized page view passes none, because it never fetched any.<Reactions>callers passedReactionsVariant.Pill, so the default square-chip variant never rendered.ReactionsVariant, thevariantprop and the unused branch are removed. Reactions always draw as pills, which is what every caller already showed.NotificationFeedCardandTaskMentionCardeach drew the same row: avatar, message, relative time.NotificationFeedCardused inline hex colours (#37352F,#6B7280) that ignore dark mode.NotificationRow. It keepsNotificationFeedCard's spacing and uses theprimaryandsecondarytext 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:
NotificationBox,useUnreadInboxActivityanduseInboxActivityalready 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.Type of change:
High-level design:
N/A. One hook moved and reused, one dead variant removed, one shared row component.
Tests:
Use cases covered
fqnclears the list without a request.Unit tests
hooks/useActiveAnnouncements.test.tsmoved with the hook. Its mocks now point at the new path.playwright/browser-tests/reactions.spec.tsrendered<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.components/ActivityFeed,components/NotificationBox,DataAssetsHeader,DomainDetails,DataProductsDetailsPage,ConnectionServiceDetailsPageandInboxPage.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.UI screen recording:
Not applicable: a refactor with the before/after captures above.
Checklist:
Fixes <issue-number>: <short explanation>. The issue is in openmetadata-collate, so the title names the area instead.Fixesabove.REVIEW.mdand fixed every 🔴 finding, or answered it on the line below.ReactionsVariantis not used by openmetadata-collate. No removed or renamed test id.docs/decisions/. Not applicable.🤖 Generated with Claude Code