feat: integrate BountyTags into CreatorBountyCard and ContributorProfile#810
feat: integrate BountyTags into CreatorBountyCard and ContributorProfile#810LaphoqueRC wants to merge 3 commits intoSolFoundry:mainfrom
Conversation
📝 WalkthroughWalkthroughReworks how bounty tier/metadata are rendered in two components. In ContributorProfile.tsx the inline tier label and separate tier span were removed; Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
CI failures in this PR are pre-existing repository issues unrelated to this change:
This PR only modifies frontend components ( CodeRabbit found no actionable issues and suggests |
Closes SolFoundry#487 Replaces inline tier/skill rendering with the reusable BountyTags component: - CreatorBountyCard: adds tier, skills, and category pills above the status/escrow/deadline line for visual consistency with BountyCard - ContributorProfile: replaces manual tierLabel() + TIER_COLORS inline spans with BountyTags tier pill in the recent bounties list Both components now use the same GitHub-label-colored pills as the bounty board, providing consistent visual language across the app. Wallet: HZV6YPdTeJPjPujWjzsFLLKja91K2Ze78XeY8MeFhfK8
c7f47d7 to
9b318fd
Compare
|
Rebased onto the latest The remaining CI failures are pre-existing issues in the upstream repository unrelated to this PR: Backend Lint (Ruff):
This PR only modifies |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/components/ContributorProfile.tsx (1)
116-118: 🛠️ Refactor suggestion | 🟠 MajorRemove unused
tierLabelfunction at lines 116-118.The
tierLabelfunction is dead code—it is defined but never called anywhere in the codebase. The tier string is constructed inline at line 283 using the template literal\T${bounty.tier}`passed to theBountyTags` component. Remove the function to maintain code cleanliness.Proposed removal
-function tierLabel(tier: 1 | 2 | 3): string { - return `T${tier}`; -} -🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/components/ContributorProfile.tsx` around lines 116 - 118, Remove the dead helper function tierLabel (named tierLabel) since the tier string is built inline and the function is not referenced; delete the function definition from ContributorProfile.tsx and ensure there are no remaining references or exports to tierLabel (verify usages aside from the inline template literal `T${bounty.tier}` passed to BountyTags) so the file compiles cleanly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/src/components/ContributorProfile.tsx`:
- Around line 281-291: The code in ContributorProfile rendering uses a manual
string build and cast for the tier and passes an empty skills array to
BountyTags; update the RecentBounty type to use the BountyTier union (or store
tier as 'T1'|'T2'|'T3') so you can pass bounty.tier directly to BountyTags
without `as BountyTier`, and if skills should appear here add a skills field to
RecentBounty and pass it instead of `[]` (or intentionally document/leave
`skills={[]}` if not required); locate the BountyTags usage in
ContributorProfile and the RecentBounty definition and adjust types and prop
usage accordingly to remove the cast and avoid an empty skills prop.
---
Outside diff comments:
In `@frontend/src/components/ContributorProfile.tsx`:
- Around line 116-118: Remove the dead helper function tierLabel (named
tierLabel) since the tier string is built inline and the function is not
referenced; delete the function definition from ContributorProfile.tsx and
ensure there are no remaining references or exports to tierLabel (verify usages
aside from the inline template literal `T${bounty.tier}` passed to BountyTags)
so the file compiles cleanly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e1a4d528-3caf-4e70-b5ab-bd8c5e9a7852
📒 Files selected for processing (2)
frontend/src/components/ContributorProfile.tsxfrontend/src/components/bounties/CreatorBountyCard.tsx
…bel helper
- Change RecentBounty.tier from '1 | 2 | 3' to BountyTier so the tier
can be passed directly to BountyTags without a type cast
- Remove unused tierLabel function (was building 'T${tier}' string
which is now handled by the BountyTier type itself)
- Drop 'as BountyTier' cast in ContributorProfile render
Addresses code review feedback from coderabbitai.
|
Addressed the code review feedback:
The remaining CI failures (Backend Tests, Ruff lint, Frontend tsc/build) are pre-existing upstream issues unrelated to this change, as noted in the earlier comment. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/src/components/ContributorProfile.tsx`:
- Around line 284-286: The inline date formatting can produce "Invalid Date" for
malformed bounty.completedAt; update ContributorProfile.tsx to parse and
validate the date before rendering: create a local variable (e.g., parsedDate =
new Date(bounty.completedAt)) and check validity with
isNaN(parsedDate.getTime()) (or similar), then use a fallback string (e.g., "—"
or "Unknown date") when invalid; replace the direct new
Date(...).toLocaleDateString(...) usage in the span with the validated/formatted
value so the UI degrades gracefully for bad input.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: aa86a1ae-4151-482c-9d24-ee5889f07a03
📒 Files selected for processing (1)
frontend/src/components/ContributorProfile.tsx
| <span className="text-xs text-gray-500"> | ||
| {bounty.earned.toLocaleString()} FNDRY · {new Date(bounty.completedAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })} | ||
| </span> |
There was a problem hiding this comment.
Add a safe fallback for malformed completedAt values.
Inline date parsing has no invalid-date guard, so bad input can render Invalid Date in the activity feed. This should degrade gracefully (e.g., fallback text) to avoid user-facing noise.
As per coding guidelines, "frontend/**: React/TypeScript frontend. Check: ... Error/loading/empty state handling".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@frontend/src/components/ContributorProfile.tsx` around lines 284 - 286, The
inline date formatting can produce "Invalid Date" for malformed
bounty.completedAt; update ContributorProfile.tsx to parse and validate the date
before rendering: create a local variable (e.g., parsedDate = new
Date(bounty.completedAt)) and check validity with isNaN(parsedDate.getTime())
(or similar), then use a fallback string (e.g., "—" or "Unknown date") when
invalid; replace the direct new Date(...).toLocaleDateString(...) usage in the
span with the validated/formatted value so the UI degrades gracefully for bad
input.
|
Fixed the two TypeScript errors causing 1. Missing Commits in upstream's Phase 3 integration (5a93431) introduced
2. The refactor in this PR changed The remaining CI failures (Backend Tests/Lint, Contracts) are pre-existing upstream issues unrelated to this PR. |
Closes #487
Integrates the
BountyTagscomponent into two remaining components that were rendering tier/skills manually.Changes
CreatorBountyCard
BountyTagswithtier,skills,category, andmaxSkills={4}above the status/escrow/deadline metadata lineContributorProfile
tierLabel()+TIER_COLORSinline spans withBountyTagstier pillBefore / After
CreatorBountyCard — before: no tier/skill pills, only text metadata. After: full BountyTags row.
ContributorProfile — before:
T1 · 25,000 FNDRY · Mar 23, 2026in plain text with custom colors. After: styled T1 pill +25,000 FNDRY · Mar 23, 2026.Testing
All frontend tests pass (ESLint, TypeScript, Vitest).
Wallet:
HZV6YPdTeJPjPujWjzsFLLKja91K2Ze78XeY8MeFhfK8