Skip to content

Chore(UI): Fix activity feed tab bugs - #30879

Open
aniketkatkar97 wants to merge 2 commits into
mainfrom
fix-activity-feed-bugs
Open

Chore(UI): Fix activity feed tab bugs#30879
aniketkatkar97 wants to merge 2 commits into
mainfrom
fix-activity-feed-bugs

Conversation

@aniketkatkar97

Copy link
Copy Markdown
Member

This pull request addresses regressions in the Activity Feed component and its tests, primarily ensuring that activity change-events are treated as read-only and cannot be replied to, while conversation threads retain full interactivity. It also introduces a new test suite for these behaviors and cleans up related code and test logic.

Activity Feed: Read-only Activities & Regression Tests

Read-only activity events:

  • Updated ActivityFeedCardNew so that change-event activities are always rendered as read-only: replies are disabled, the comment editor is hidden, and only conversation threads can be replied to. This logic is enforced in both the UI and the onSave handler. [1] [2] [3]
  • Removed now-unused code paths and props related to posting activity comments, simplifying the provider usage. [1] [2]

Test coverage:

  • Added a new test file ActivityFeedcardNew.component.test.tsx that verifies conversation threads show the comment editor, while activity events do not.
  • Introduced a comprehensive Playwright test suite that covers regressions from the Task-redesign refactor (PR Task redesign #25894), ensuring activity and conversation items are both visible, activity events are read-only, replies are correctly isolated, and UI counts are consistent.

Test improvements and fixes:

  • Re-enabled the previously skipped test for mention notification details in the notification box.
  • Cleaned up test code for clarity and reliability, including improved response waiting and event handling in Playwright tests. [1] [2]

Minor code cleanup:

  • Corrected the order of imports in Playwright test files.

@aniketkatkar97 aniketkatkar97 self-assigned this Aug 3, 2026
Copilot AI review requested due to automatic review settings August 3, 2026 14:36
@aniketkatkar97
aniketkatkar97 requested a review from a team as a code owner August 3, 2026 14:36
@github-actions

github-actions Bot commented Aug 3, 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.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Aug 3, 2026
</Space>

<span>
<span data-testid="left-panel-all-count">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Bug: All badge mixes server total with client-loaded count

The left-panel "All" badge is computed as conversationCount + activityEvents.length, where conversationCount is a server-side total (from getFeedCount) but activityEvents.length is the number of client-loaded activities, which fetchEntityActivity caps at limit: 50. Meanwhile the entity-tab header total uses activityCount = paging.total (the true server total). For entities with more than 50 activity events, or when conversations paginate beyond the loaded entityThread, the badge, the header total, and the rendered list will disagree — the exact invariant the new Playwright test 'All badge, header and rendered list agree on the count' asserts (it only passes because the test entity has one activity). Consider deriving the badge from the same server counts used for the header (e.g. conversationCount + activityCount) so all three stay consistent regardless of pagination.

Use the server-side activityCount instead of the client-loaded activityEvents.length so the badge matches the header total.:

getCountBadge(
  (countData?.data?.conversationCount ?? 0) +
    (countData?.data?.activityCount ?? 0),
  '',
  activeTab === ActivityFeedTabs.ALL
)
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — ESLint report could not be read — see the job log.

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.

No machine-readable report was produced.


Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@gitar-bot

gitar-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Fixes activity feed tab bugs by marking change-event activities as read-only and unskipping Playwright tests. Consider addressing the badge count mismatch where the 'All' badge mixes server totals with client-loaded counts.

💡 Bug: All badge mixes server total with client-loaded count

📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx:752-760 📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:600-613

The left-panel "All" badge is computed as conversationCount + activityEvents.length, where conversationCount is a server-side total (from getFeedCount) but activityEvents.length is the number of client-loaded activities, which fetchEntityActivity caps at limit: 50. Meanwhile the entity-tab header total uses activityCount = paging.total (the true server total). For entities with more than 50 activity events, or when conversations paginate beyond the loaded entityThread, the badge, the header total, and the rendered list will disagree — the exact invariant the new Playwright test 'All badge, header and rendered list agree on the count' asserts (it only passes because the test entity has one activity). Consider deriving the badge from the same server counts used for the header (e.g. conversationCount + activityCount) so all three stay consistent regardless of pagination.

Use the server-side activityCount instead of the client-loaded activityEvents.length so the badge matches the header total.
getCountBadge(
  (countData?.data?.conversationCount ?? 0) +
    (countData?.data?.activityCount ?? 0),
  '',
  activeTab === ActivityFeedTabs.ALL
)
🤖 Prompt for agents
Code Review: Fixes activity feed tab bugs by marking change-event activities as read-only and unskipping Playwright tests. Consider addressing the badge count mismatch where the 'All' badge mixes server totals with client-loaded counts.

1. 💡 Bug: All badge mixes server total with client-loaded count
   Files: openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx:752-760, openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:600-613

   The left-panel "All" badge is computed as `conversationCount + activityEvents.length`, where `conversationCount` is a server-side total (from `getFeedCount`) but `activityEvents.length` is the number of client-loaded activities, which `fetchEntityActivity` caps at `limit: 50`. Meanwhile the entity-tab header total uses `activityCount` = `paging.total` (the true server total). For entities with more than 50 activity events, or when conversations paginate beyond the loaded `entityThread`, the badge, the header total, and the rendered list will disagree — the exact invariant the new Playwright test 'All badge, header and rendered list agree on the count' asserts (it only passes because the test entity has one activity). Consider deriving the badge from the same server counts used for the header (e.g. `conversationCount + activityCount`) so all three stay consistent regardless of pagination.

   Fix (Use the server-side activityCount instead of the client-loaded activityEvents.length so the badge matches the header total.):
   getCountBadge(
     (countData?.data?.conversationCount ?? 0) +
       (countData?.data?.activityCount ?? 0),
     '',
     activeTab === ActivityFeedTabs.ALL
   )

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

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

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.

Pull request overview

This PR fixes regressions in the Activity Feed UI introduced during the task redesign work by (1) making activity change-events read-only (no replies/editor), and (2) correctly rendering/counting both conversation threads and activity change-events together on the “All” tab. It also adds/updates Jest and Playwright coverage to prevent these regressions from reappearing.

Changes:

  • Correct feed counting by separating conversation thread counts (feed store) from activity change-event counts (activity stream) and summing them appropriately.
  • Update Activity Feed UI behavior so activity change-events are read-only and conversation threads remain fully interactive.
  • Add regression-focused Jest + Playwright tests for merged rendering, read-only behavior, selection determinism, and count consistency.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts Updates feed counting logic to include conversation + activity + tasks, and propagates activityCount.
openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.getFeedCounts.test.ts Adds unit tests asserting conversation/activity counts are not conflated and totals are correct.
openmetadata-ui/src/main/resources/ui/src/interface/feed.interface.ts Extends FeedCounts with activityCount.
openmetadata-ui/src/main/resources/ui/src/constants/entity.constants.ts Initializes activityCount in FEED_COUNT_INITIAL_DATA.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx Gates activity fetch by tab, fixes selection clearing, and adjusts “All” badge to include conversations + activities.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.test.tsx Adds tests for tab-gated activity fetching and correct “All” badge summation.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/DummyTestComponent.tsx Updates provider test helpers to reflect read-only activities and reaction sync behavior.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/ActivityFeedProviderContext.interface.ts Removes activity-thread/comment APIs from provider context to enforce read-only activities.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider.tsx Removes activity-thread/comment flow; keeps selected activity in sync on reaction updates.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider.test.tsx Replaces activity-comment tests with reaction sync and read-only selection tests.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedPanel/ActivityPanelBody.tsx Removes editor/comment UI for activity events (read-only).
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedListV1New.component.tsx Merges activity + conversation lists, sorts by timestamp, and makes auto-selection deterministic.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedListV1New.component.test.tsx Adds tests for merged rendering, ordering, empty states, and auto-selection behavior.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.tsx Ensures activities never render reply UI and only conversation threads can be replied to.
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.test.tsx Adds tests verifying editor appears only for conversation threads (not activities).
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ActivityFeed.spec.ts Re-enables mention notification test and adds regression suite for merged list + read-only activity behavior.
Suppressed comments (2)

openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedListV1New.component.tsx:180

  • componentsVisibility is accepted by ActivityFeedListV1New but isn't forwarded to FeedPanelBodyV1New for feed (conversation) items either, so callers passing it won't see any effect. Forward it consistently so the flag can be consumed downstream if/when implemented.
        <FeedPanelBodyV1New
          feed={item.feed}
          handlePanelResize={handlePanelResize}
          hidePopover={hidePopover}
          isActive={activeFeedId === item.id}

openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/DummyTestComponent.tsx:233

  • This dummy test component introduces a hardcoded, user-visible button label (react). UI code in this repo is expected to avoid hardcoded user-facing strings (use i18n keys or remove the visible label if it's only needed for tests).
        }>
        react
      </button>

Comment on lines 160 to +164
<FeedPanelBodyV1New
activity={activity}
activity={item.activity}
handlePanelResize={handlePanelResize}
hidePopover={hidePopover}
isActive={activeFeedId === activity.id}
isActive={activeFeedId === item.id}
Comment on lines +218 to +222
<button
data-testid="select-activity"
onClick={() => setActiveActivity(activityEvents[0])}>
select
</button>
Copilot AI review requested due to automatic review settings August 3, 2026 14:44

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.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx:277

  • getFeedCount() returns an array and can legitimately be empty. Accessing res[0].conversationCount / res[0].mentionCount will throw when there are no feed items for the user. Also, the API can return multiple entries (per field), so picking index 0 can undercount.

Consider defensively summing across the response and handling the empty-array case (similar to FeedUtilsPure.getFeedCounts).

      if (isUserEntity) {
        // Also get feed counts for conversations and mentions
        const res = await getFeedCount(getEntityUserLink(fqn));
        setCountData((prev) => ({
          ...prev,

Comment on lines 32 to 35
export interface FeedCounts {
conversationCount: number;
activityCount: number;
totalTasksCount: number;
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 66%
66.12% (77760/117601) 50.32% (47178/93741) 51.25% (14107/27523)

@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 53c47046ac87b4de9ec31a9aa0a2a90f108e3805 in Playwright run 30824117755, attempt 1.

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

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 54m 27s

⏱️ Max setup 3m 3s · max shard execution 14m 58s · max shard-job elapsed before upload 18m 38s · reporting 5s

🌐 202.65 requests/attempt · 2.81 app boots/UI scenario · 14.25% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 202.65 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.81 per UI scenario (1666 boots / 592 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 100 0 0 0 0 0
🟡 Shard chromium-02 103 0 1 0 0 0
✅ Shard chromium-03 106 0 0 3 0 0
✅ Shard chromium-04 106 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Features/ActivityFeed.spec.tsReplying to a conversation stays isolated to that thread (shard chromium-02, 1 retry)

📦 Download artifacts

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

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.

2 participants