Skip to content

added official tag#488

Merged
Ebube111 merged 1 commit intostagingfrom
official-tag
Dec 2, 2025
Merged

added official tag#488
Ebube111 merged 1 commit intostagingfrom
official-tag

Conversation

@Ebube111
Copy link
Copy Markdown
Collaborator

@Ebube111 Ebube111 commented Dec 2, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed OFFICIAL badge visibility in campaign components to reliably identify campaigns where owner and recipient are the same. Updated comparison logic ensures consistent badge display across banner, card, and carousel views without false positives or negatives.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 2, 2025

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

Project Deployment Preview Comments Updated (UTC)
potlock-next-app Ready Ready Preview Comment Dec 2, 2025 0:20am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 2, 2025

Walkthrough

Three campaign component files were updated to change the OFFICIAL badge visibility condition from comparing owner and recipient objects directly to comparing their IDs using optional chaining. This improves reliability by avoiding object reference equality issues.

Changes

Cohort / File(s) Change Summary
OFFICIAL badge ID comparison
src/entities/campaign/components/CampaignBanner.tsx, src/entities/campaign/components/CampaignCard.tsx, src/entities/campaign/components/CampaignCarouselItem.tsx
Updated OFFICIAL badge rendering condition from comparing owner and recipient objects directly to comparing their IDs with safe optional chaining (e.g., campaign?.owner?.id === campaign?.recipient?.id), preventing false comparisons and safely handling missing properties.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify ID comparison is the correct approach across all three files
  • Confirm optional chaining correctly accesses the id property in each context
  • Check for any other similar comparisons in the codebase that may need the same update

Possibly related PRs

  • Campaign Fixes #393: Introduces the OFFICIAL badge with owner === recipient check; this PR refines that logic to compare IDs instead for more reliable owner/recipient matching.
  • Staging to main #397: Modifies CampaignCard.tsx for CSS class name changes; overlaps with this PR's updates to the same component.

Suggested reviewers

  • carina-akaia

Poem

🐰 From objects we compare to IDs we now derive,
No longer reference tricks—just values that survive.
Three badges shine with logic clean,
The best comparison ever seen! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'added official tag' is misleading. The changes don't add a new badge; they fix the existing OFFICIAL badge condition by comparing IDs instead of object references across three campaign components. Update the title to reflect the actual change, such as 'Fix OFFICIAL badge visibility by comparing owner and recipient IDs' or 'Compare campaign owner/recipient by ID instead of object reference'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch official-tag

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8cb25b9 and b53d8f0.

📒 Files selected for processing (3)
  • src/entities/campaign/components/CampaignBanner.tsx (1 hunks)
  • src/entities/campaign/components/CampaignCard.tsx (1 hunks)
  • src/entities/campaign/components/CampaignCarouselItem.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: akaia-shadowfox
Repo: PotLock/potlock-nextjs-app PR: 400
File: src/features/donation/components/modal-confirmation-screen.tsx:83-88
Timestamp: 2025-06-02T18:44:53.590Z
Learning: In src/features/donation/components/modal-confirmation-screen.tsx, the isFeeBypassAllowed flag is temporarily hardcoded to true for urgent shipping, with a TODO comment indicating it should be replaced with campaign permission-based logic using campaign?.allow_fee_avoidance ?? false for campaign donations.
📚 Learning: 2025-06-02T18:44:53.590Z
Learnt from: akaia-shadowfox
Repo: PotLock/potlock-nextjs-app PR: 400
File: src/features/donation/components/modal-confirmation-screen.tsx:83-88
Timestamp: 2025-06-02T18:44:53.590Z
Learning: In src/features/donation/components/modal-confirmation-screen.tsx, the isFeeBypassAllowed flag is temporarily hardcoded to true for urgent shipping, with a TODO comment indicating it should be replaced with campaign permission-based logic using campaign?.allow_fee_avoidance ?? false for campaign donations.

Applied to files:

  • src/entities/campaign/components/CampaignBanner.tsx
  • src/entities/campaign/components/CampaignCarouselItem.tsx
  • src/entities/campaign/components/CampaignCard.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (20.x)
🔇 Additional comments (3)
src/entities/campaign/components/CampaignCarouselItem.tsx (1)

48-48: LGTM! Consistent fix applied.

This change mirrors the fix in CampaignCard.tsx, correctly using ID-based comparison instead of object reference equality to determine when to display the OFFICIAL badge.

src/entities/campaign/components/CampaignBanner.tsx (1)

138-138: LGTM! Completes the consistent fix across all campaign components.

The ID-based comparison is correctly implemented and aligns with the defensive null-handling patterns already present in this file (lines 124, 134).

src/entities/campaign/components/CampaignCard.tsx (1)

42-42: Good fix! Object reference comparison corrected to ID comparison.

The previous logic comparing object references (data?.owner === data?.recipient) would almost never evaluate to true, preventing the OFFICIAL badge from displaying correctly. Comparing IDs properly identifies when the owner and recipient are the same entity. No other similar object comparison patterns found in the campaign components or broader codebase.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Ebube111 Ebube111 merged commit c16a243 into staging Dec 2, 2025
3 of 5 checks passed
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