Skip to content

Fix DAF contribution display in Recent Activity sidebar#706

Open
TylerDiorio wants to merge 2 commits intomainfrom
cursor/daf-contributions-display-bf70
Open

Fix DAF contribution display in Recent Activity sidebar#706
TylerDiorio wants to merge 2 commits intomainfrom
cursor/daf-contributions-display-bf70

Conversation

@TylerDiorio
Copy link
Contributor

Problem

DAF (Donor-Advised Fund) contributions were displaying incorrectly in the Recent Activity sidebar on the /fund page. Instead of showing a properly formatted entry like "Tyler Diorio contributed to [Fundraise Name]", they were showing the raw content type: "Tyler Diorio posted discussion USDFUNDRAISECONTRIBUTION #8".

Root Cause

The USDFUNDRAISECONTRIBUTION content type from the backend API was not being handled explicitly in the frontend code. It was falling through to the default case in the feed transformation logic, which generated a generic title using the raw content_type string.

Solution

Added specific handling for USDFUNDRAISECONTRIBUTION posts in three places:

1. ActivityCard Component (components/Funding/ActivityCard.tsx)

  • Added 'contributed to' action label for USDFUNDRAISECONTRIBUTION posts
  • Updated getActionLabel() to check for USDFUNDRAISECONTRIBUTION post type
  • Updated getEntryMeta() to use the associated fundraise's title and link when available

2. Feed Transformation (types/feed.ts)

  • Added explicit case handling for USDFUNDRAISECONTRIBUTION in the transformFeedEntry() function
  • Extracts fundraise data when available
  • Uses the fundraise's post title instead of generating a generic title

Testing

  • ✅ Code review confirms the logic is correct
  • ⚠️ Unable to test visually in development environment due to lack of DAF contribution test data
  • Will need verification in staging/production where DAF contributions exist

Impact

  • Improves UX by displaying human-readable contribution messages
  • Maintains consistency with how other activity types are displayed
  • Links properly to the associated fundraise post

Fixes #[issue-number-if-available]

Relates to feedback from Slack: https://researchhub.slack.com/archives/[channel-id]/p[timestamp]

Slack Thread

Open in Web Open in Cursor 

- Add 'contributed to' action label for USDFUNDRAISECONTRIBUTION posts
- Handle USDFUNDRAISECONTRIBUTION as a specific post type in ActivityCard
- Add specific transformation logic for USDFUNDRAISECONTRIBUTION in feed.ts
- Use fundraise post title and link when available for better UX

Co-authored-by: Tyler Diorio <TylerDiorio@users.noreply.github.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Mar 17, 2026 3:05am

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
39.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@yattias yattias marked this pull request as ready for review March 17, 2026 00:40
@yattias yattias requested a review from a team as a code owner March 17, 2026 00:40
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

…ling

- Remove duplicate transformation block for USDFUNDRAISECONTRIBUTION
- Handle DAF contributions in existing POST transformation logic
- Use conditional checks for title/image from fundraise data
- Reduce code duplication from 59.3% to minimal

This fixes SonarCloud duplication warning while maintaining same functionality.

Co-authored-by: Tyler Diorio <TylerDiorio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants