Backport ActivityFeed and Announcement lazy-loading updates to 1.13#30128
Conversation
… utility pattern (#29062) * feat(ui): update ActivityFeed & Announcement components for lazy-load utility pattern Updates ActivityFeed components to import from extracted pure utility modules. Updates FeedUtils, TasksUtils imports to use new utility structure. Updates TasksPage and tasksAPI for consistent utility usage. Ref: open-metadata/openmetadata-collate#4230 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix imports * address gitar-bot comments * fix checkstyle * fix failing tests --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
| import PopoverContent from '../ActivityFeed/ActivityFeedCard/PopoverContent'; | ||
| import UserPopOverCard from '../common/PopOverCard/UserPopOverCard'; | ||
| import ProfilePicture from '../common/ProfilePicture/ProfilePicture'; | ||
| import { getEntityFQN, getEntityType } from '../../utils/FeedUtilsPure'; |
There was a problem hiding this comment.
Announcement Imports Become Unresolved
The component still references getEntityField, ArrowBottom, feed-card children, reaction types, useApplicationStore, and several other names removed by this hunk. Any build containing this component now fails with unresolved identifiers, so announcement cards cannot load.
Context Used: CLAUDE.md (source)
| import { getEntityFQN } from '../../../utils/FeedUtilsPure'; | ||
| import ErrorPlaceHolder from '../../common/ErrorWithPlaceholder/ErrorPlaceHolder'; |
There was a problem hiding this comment.
Widget Components Lose Their Imports
The unchanged widget body still renders FeedCardHeaderV2 and FeedCardBodyV1, but this hunk removes both imports. TypeScript therefore cannot compile the MyData announcements widget.
Context Used: CLAUDE.md (source)
| import { entityDisplayName, prepareFeedLink } from '../../utils/FeedUtils'; | ||
| import Fqn from '../../utils/Fqn'; | ||
| import { getTaskDetailPath } from '../../utils/TasksUtils'; | ||
| import { entityDisplayName, prepareFeedLink } from '../../utils/FeedUtilsPure'; |
There was a problem hiding this comment.
Notification Helpers Become Unresolved
The component still calls getTaskDetailPath(task) and Fqn.split(...), but this import cleanup removes both names and FeedUtilsPure does not replace them. The file fails compilation, blocking task and approval notification cards.
Context Used: CLAUDE.md (source)
| import { Card, Typography } from 'antd'; | ||
| import { isEqual } from 'lodash'; | ||
| import { FC, Fragment } from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import { | ||
| ANNOUNCEMENT_BG, | ||
| ANNOUNCEMENT_BORDER, | ||
| GLOBAL_BORDER, | ||
| TASK_BORDER, | ||
| } from '../../../constants/Feeds.constants'; | ||
| import { | ||
| Post, | ||
| Thread, | ||
| ThreadTaskStatus, | ||
| ThreadType, | ||
| } from '../../../generated/entity/feed/thread'; | ||
| import { getFeedListWithRelativeDays } from '../../../utils/FeedUtils'; | ||
| import { getTaskDetailPath } from '../../../utils/TasksUtils'; | ||
| import { OwnerLabel } from '../../common/OwnerLabel/OwnerLabel.component'; | ||
| import { GLOBAL_BORDER } from '../../../constants/Feeds.constants'; | ||
| import { Post } from '../../../generated/entity/feed/thread'; | ||
| import { getFeedListWithRelativeDays } from '../../../utils/FeedUtilsPure'; | ||
| import ActivityFeedCard from '../ActivityFeedCard/ActivityFeedCard'; | ||
| import FeedCardFooter from '../ActivityFeedCard/FeedCardFooter/FeedCardFooter'; | ||
| import ActivityFeedEditor from '../ActivityFeedEditor/ActivityFeedEditor'; | ||
| import FeedListSeparator from '../FeedListSeparator/FeedListSeparator'; | ||
| import AnnouncementBadge from '../Shared/AnnouncementBadge'; | ||
| import TaskBadge from '../Shared/TaskBadge'; | ||
| import { ActivityThreadListProp } from './ActivityThreadPanel.interface'; |
There was a problem hiding this comment.
🚨 Bug: ActivityThreadList.tsx: backport dropped required imports
The import-block rewrite in this commit removed the imports for useTranslation (react-i18next), useNavigate (react-router-dom), the Thread type (generated/entity/feed/thread), and getTaskDetailPath (utils/TasksUtils), yet all four are still referenced in the component body (t at line 36, navigate at line 37, Thread at line 45, getTaskDetailPath at line 46). This leaves undefined identifiers that break TypeScript compilation and would crash the component at runtime. Restore the dropped imports.
Re-add react-i18next, react-router-dom, Thread type, and getTaskDetailPath imports that the merge dropped.:
import { Card, Typography } from 'antd';
import { isEqual } from 'lodash';
import { FC, Fragment } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { GLOBAL_BORDER } from '../../../constants/Feeds.constants';
import { Post, Thread } from '../../../generated/entity/feed/thread';
import { getFeedListWithRelativeDays } from '../../../utils/FeedUtilsPure';
import { getTaskDetailPath } from '../../../utils/TasksUtils';
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
| import PopoverContent from '../ActivityFeed/ActivityFeedCard/PopoverContent'; | ||
| import UserPopOverCard from '../common/PopOverCard/UserPopOverCard'; | ||
| import ProfilePicture from '../common/ProfilePicture/ProfilePicture'; | ||
| import { getEntityFQN, getEntityType } from '../../utils/FeedUtilsPure'; |
There was a problem hiding this comment.
🚨 Bug: AnnouncementFeedCardBody: backport dropped required imports
The import block was collapsed to only getEntityFQN, getEntityType from FeedUtilsPure, but the component still uses getEntityField (line 40) and useApplicationStore (line 41), plus other symbols (ProfilePicture, UserPopOverCard, PopoverContent, Reaction/ReactionType/ReactionOperation, ThreadType) referenced further down. These identifiers are now undefined, breaking compilation and the component at runtime. Restore all imports removed by the merge — at minimum add getEntityField to the FeedUtilsPure import and re-add useApplicationStore and the remaining dropped imports.
Add getEntityField to the FeedUtilsPure import and restore the remaining imports (useApplicationStore, ProfilePicture, UserPopOverCard, reaction types, thread types, etc.) that the backport merge removed.:
import {
getEntityField,
getEntityFQN,
getEntityType,
} from '../../utils/FeedUtilsPure';
// plus re-add the other imports the merge dropped, e.g.:
// import { useApplicationStore } from '../../hooks/useApplicationStore';
// import ProfilePicture from '../common/ProfilePicture/ProfilePicture';
// import UserPopOverCard from '../common/PopOverCard/UserPopOverCard';
// import { Reaction, ReactionType } from '../../generated/type/reaction';
// import { ReactionOperation } from '../../enums/reactions.enum';
// import { Post, ThreadType } from '../../generated/entity/feed/thread';
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review 🚫 Blocked 0 resolved / 2 findingsBackports ActivityFeed and Announcement lazy-loading utilities but remains blocked due to missing imports in ActivityThreadList.tsx and AnnouncementFeedCardBody, causing broken references throughout both components. 🚨 Bug: ActivityThreadList.tsx: backport dropped required imports📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityThreadPanel/ActivityThreadList.tsx:13-25 📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityThreadPanel/ActivityThreadList.tsx:36-37 📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityThreadPanel/ActivityThreadList.tsx:45-46 The import-block rewrite in this commit removed the imports for Re-add react-i18next, react-router-dom, Thread type, and getTaskDetailPath imports that the merge dropped.🚨 Bug: AnnouncementFeedCardBody: backport dropped required imports📄 openmetadata-ui/src/main/resources/ui/src/components/Announcement/AnnouncementFeedCardBody.component.tsx:20 📄 openmetadata-ui/src/main/resources/ui/src/components/Announcement/AnnouncementFeedCardBody.component.tsx:40-41 The import block was collapsed to only Add getEntityField to the FeedUtilsPure import and restore the remaining imports (useApplicationStore, ProfilePicture, UserPopOverCard, reaction types, thread types, etc.) that the backport merge removed.🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
Summary
Stack
Testing
Greptile Summary
This PR backports lazy-loading utility changes for activity feeds and announcements. The main changes are:
FeedUtilstoFeedUtilsPureimports.Confidence Score: 4/5
The UI build is blocked by unresolved component imports and removed compatibility exports.
FeedUtilsre-exports.AnnouncementFeedCardBody.component.tsx, AnnouncementsWidget.tsx, NotificationFeedCard.component.tsx, and FeedUtils.tsx
Important Files Changed
FeedUtilsPure.Comments Outside Diff (1)
openmetadata-ui/src/main/resources/ui/src/utils/FeedUtils.tsx, line 40-63 (link)Several unchanged source files still import pure helpers through
FeedUtils, including task cards, announcement drawers, data-quality utilities, notification components, and legacy feed bodies. Removing this re-export block makes those named imports invalid and causes the application build to fail; migrate every remaining consumer in this backport or retain the compatibility exports.Context Used: CLAUDE.md (source)
Reviews (1): Last reviewed commit: "feat(ui): update ActivityFeed & Announce..." | Re-trigger Greptile
Context used: