feat: extend Bounty type with optional UI fields and remove ad-hoc casts#255
feat: extend Bounty type with optional UI fields and remove ad-hoc casts#255zeroknowledge0x wants to merge 2 commits into
Conversation
Add missing optional fields to the Bounty interface in types/bounty.ts:
- claimCount, maxParticipants, assignedContributorId (number/null)
- applications (BountyApplication[] | null) with new BountyApplication type
Remove unsafe ad-hoc casts in:
- bounty-detail-client.tsx: applications, assignedContributorId, submissions
- use-competition-join-state.ts: submissions (updated param type)
- use-bounty-cta-state.ts: prefer typed fields with fallback
Acceptance criteria:
- No (bounty as { ... }) casts remaining in the bounty detail tree
- 81/81 tests passing
- No behavioral change
|
@zeroknowledge0x is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR extends the ChangesBounty Type Definitions and Consumer Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm-workspace.yaml`:
- Around line 1-13: The pnpm-workspace.yaml change (the allowBuilds list and
package flags) is unrelated to the Bounty type and cast changes; revert these
modifications from this branch or remove pnpm-workspace.yaml from the commit so
the PR only contains relevant changes, or extract this file into a separate PR
that targets build configuration; locate the file named pnpm-workspace.yaml and
either discard the added allowBuilds entries (blake-hash, bufferutil, esbuild,
protobufjs, secp256k1, sharp, tiny-secp256k1, unrs-resolver, usb, utf-8-validate
and '`@reown/appkit`', '`@stellar/stellar-sdk`') or move the file to a new
branch/PR.
- Around line 1-13: The pnpm-workspace.yaml currently contains placeholder
strings under the allowBuilds map (e.g., entries for '`@reown/appkit`', 'esbuild',
'sharp', etc.) which must be real YAML booleans; replace each placeholder value
with true or false (no quotes) to reflect whether that package is allowed to
build, or remove the file entirely if this workspace config is not needed for
this change; ensure you edit the allowBuilds mapping (key: allowBuilds and the
listed package keys) so values are proper booleans and validate with a local
pnpm install/build to confirm CI will parse it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6530c8c0-7ff9-4c24-a1bf-76f578ef713c
📒 Files selected for processing (5)
components/bounty-detail/bounty-detail-client.tsxcomponents/bounty-detail/use-bounty-cta-state.tshooks/use-competition-join-state.tspnpm-workspace.yamltypes/bounty.ts
|
Hi @coderabbitai, I've addressed the review comment. The unrelated pnpm-workspace.yaml change has been reverted in commit f5c73dd. The PR now only contains the Bounty type extension and ad-hoc cast removal. Could you please re-review? Thank you! |
|
✅ Actions performedFull review triggered. |
Summary
Extends the
Bountyinterface intypes/bounty.tswith optional UI fields that components already consume via ad-hoc casts, then removes those casts.Changes
types/bounty.ts
BountyApplicationinterface (matches the shape used byApplicationReviewDashboard)Bounty:claimCount,maxParticipants,assignedContributorId,applicationscomponents/bounty-detail/bounty-detail-client.tsx
(bounty as BountyData & { applications?: Application[] })cast → usesbounty.applications(bounty as BountyData & { assignedContributorId?: string })cast → usesbounty.assignedContributorId(bounty as { submissions?: CompetitionSubmissionEntry[] | null })cast → usesbounty.submissionshooks/use-competition-join-state.ts
(bounty as { submissions?: ... })cast → usesbounty.submissionsdirectlyBountyFieldsFragment & Partial<Bounty>components/bounty-detail/use-bounty-cta-state.ts
bounty.claimCount/bounty.maxParticipantswith fallback to_count.submissionsTesting
npx tsc --noEmit— no new errors (pre-existing module declaration errors only)npx eslint— cleannpx jest— 81/81 tests passingAcceptance Criteria
(bounty as { ... })casts remaining in the bounty detail treepnpm tsc --noEmitpasses (modulo pre-existing module declarations)pnpm lintpassesFixes #211
Summary by CodeRabbit
Release Notes