Activity feed: financial types + redesigned cards - #981
Conversation
Introduce related-work/funding activity transformers and rebuild activity cards around work previews and header messaging so financial events render correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1286d5d635
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const [isContributeModalOpen, setIsContributeModalOpen] = useState(false); | ||
|
|
||
| if (!title) return null; | ||
| if (!work) return null; |
There was a problem hiding this comment.
Render self-contained activity entries
When the activity payload is a top-level document event (for example PAPER or RESEARCHHUBPOST for a published paper/grant/proposal) and does not include related_work, this early return drops the row entirely even though transformFeedEntry still builds the document from content_object. The previous activity card fell back to the entry content via getEntryMeta, so these entries remained visible; please add a fallback work context from the entry content instead of requiring entry.relatedWork.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Are there conditions in which work would be available on an activity feed item?
There was a problem hiding this comment.
related_work should be added to all entries
ResearchHub/researchhub-backend#3653
Every FeedEntry has a required unified_document. and related_work is built from that
|
| export const ActivityCardFull: FC<ActivityCardFullProps> = ({ entry }) => { | ||
| const { title, author, href } = getEntryMeta(entry); | ||
| const [reviewExpanded, setReviewExpanded] = useState(false); | ||
| const work = getActivityWorkContext(entry); |
There was a problem hiding this comment.
Can we rename getActivityWorkContext to something like getActivityWork ? context throws me off and makes me think of hooks
| )} | ||
|
|
||
| <div className="mt-5 -ml-[42px] tablet:!ml-0"> | ||
| <WorkPreviewCard |
There was a problem hiding this comment.
the WorkPreviewCard relies on presentation and accepts a "big bag of props"
Could we do something like:
<WorkPreviewCard work={work}>
<WorkPreviewCard.Metadata>
<ActivityWorkMetadata entry={entry} work={work} />
</WorkPreviewCard.Metadata>
<WorkPreviewCard.Actions>
<ActivityWorkActions entry={entry} work={work} />
</WorkPreviewCard.Actions>
</WorkPreviewCard>
And also in WorkPreviewCard.Actions we include modals and things of that nature.


Summary
Stack