Skip to content

fix: display flat $150 USD for RHF peer-review bounty notifications#750

Open
flaggdavid-source wants to merge 1 commit intoResearchHub:mainfrom
flaggdavid-source:fix/display-flat-usd-for-rhf-peer-review-bounty
Open

fix: display flat $150 USD for RHF peer-review bounty notifications#750
flaggdavid-source wants to merge 1 commit intoResearchHub:mainfrom
flaggdavid-source:fix/display-flat-usd-for-rhf-peer-review-bounty

Conversation

@flaggdavid-source
Copy link
Copy Markdown

@flaggdavid-source flaggdavid-source commented Apr 7, 2026

Summary

Adjusts bounty notification display so RHF-sponsored peer review bounty prompts show a flat $150 USD amount instead of derived variable amounts.

Changes

  • Add getBountyForYouUsdOverride function to check if notification is a peer-review bounty (BOUNTY_FOR_YOU + bounty_type: REVIEW)
  • Use the flat amount from FOUNDATION_BOUNTY_FLAT_USD (150) when override applies
  • Apply the override in formatNotificationMessage to show $150 USD in the message
  • Apply the same override in NotificationItem.tsx CurrencyBadge with isUSD and skipConversion props to ensure message and badge stay consistent

Files Modified

  • components/Notification/lib/formatNotification.ts - Added import, new function, and updated BOUNTY_FOR_YOU case
  • components/Notification/NotificationItem.tsx - Added import and updated CurrencyBadge props

Testing

  • Local lint/type checks not available due to environment limitations (as noted in original PR)
  • Changes follow existing patterns in the codebase (similar to how FOUNDATION_BOUNTY_FLAT_USD is used in bountyUtil.ts)

Note

Low Risk
Low risk UI formatting change limited to BOUNTY_FOR_YOU peer-review notifications; main risk is inconsistent currency display if the override logic misfires on unexpected extra.bounty_type values.

Overview
Peer-review bounty notifications now show a flat Foundation amount. For BOUNTY_FOR_YOU notifications with bounty_type: REVIEW, the message formatter uses FOUNDATION_BOUNTY_FLAT_USD (150) instead of deriving USD from the notification amount and exchange rate.

Badge display is kept consistent with the message. NotificationItem applies the same override to CurrencyBadge, forcing USD display and bypassing conversion (skipConversion) when the flat amount is used.

Reviewed by Cursor Bugbot for commit 2298d93. Bugbot is set up for automated code reviews on this repo. Configure here.

- Add getBountyForYouUsdOverride function to check for peer-review bounties
- Use FOUNDATION_BOUNTY_FLAT_USD (150) for REVIEW type bounties
- Apply override in formatNotificationMessage for consistent display
- Apply override in CurrencyBadge with isUSD and skipConversion props
@flaggdavid-source flaggdavid-source requested a review from a team as a code owner April 7, 2026 09:18
@chatgpt-codex-connector
Copy link
Copy Markdown

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.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 7, 2026

@flaggdavid-source is attempting to deploy a commit to the ResearchHub Team on Vercel.

A member of the Team first needs to authorize it.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2298d93. Configure here.

size="xs"
variant={isReceivedRSC ? 'received' : 'badge'}
showText
isUSD={bountyForYouUsdOverride !== null}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wrong prop name isUSD — CurrencyBadge expects currency

High Severity

The CurrencyBadge component expects a currency prop ('RSC' | 'USD') to determine if it should display USD, but the isUSD prop is passed instead. Since isUSD is not recognized, it's silently ignored, causing the badge to default to showing RSC and defeating the intent to display USD for bounty overrides.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2298d93. Configure here.

variant={isReceivedRSC ? 'received' : 'badge'}
showText
isUSD={bountyForYouUsdOverride !== null}
skipConversion={bountyForYouUsdOverride !== null}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Badge guard ignores override when RSC amount missing

Medium Severity

The CurrencyBadge only renders when rscAmount is truthy. This prevents the badge from appearing for BOUNTY_FOR_YOU notifications when rscAmount is null or zero, even if bountyForYouUsdOverride has a value. Users see the amount in the message but no corresponding badge.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2298d93. Configure here.

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.

1 participant