feat: implement request revisions flow (#202)#266
Conversation
|
@Ishant5436 is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 53 minutes and 2 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR implements a request-revisions flow for bounty submissions: reviewers can now provide feedback through a form in the approval panel, which optimistically updates the bounty status to ChangesRevision Feedback Flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 3
🤖 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 `@components/bounty/submission-approval-panel.tsx`:
- Around line 69-74: Replace the placeholder "latest" submissionId with the real
submission ID from bounty.submissions before calling requestRevisions: compute
the target submission (e.g., pick the most recent entry from bounty.submissions
by comparing each submission.createdAt, or use submissions[0] if ordering is
guaranteed) and pass its id as submissionId to requestRevisions; reference the
requestRevisions call and the bounty.submissions array to locate where to
extract and supply the actual submission.id.
In `@hooks/use-bounty-application.ts`:
- Around line 367-380: The optimistic update in hooks/use-bounty-application.ts
currently resets bounty.status to "UNDER_REVIEW" inside qc.setQueryData for
bountyKeys.detail, which is a no-op because the approval panel only renders when
status is already UNDER_REVIEW; change the optimistic status to "IN_PROGRESS"
(and keep setting latestRevisionFeedback and updatedAt) so the bounty clearly
reflects a requested-revision state and triggers the contributor resubmission
flow; update any related tests or callers if they assert the old status.
- Around line 35-39: The type for requestRevisions is currently required but the
runtime and tests omit it; make requestRevisions optional on the contract
interface by changing its declaration to requestRevisions?: (params: { bountyId:
bigint; submissionId: string; feedback: string; }) => Promise<{ txHash: string
}>, so useRequestRevisions's guard (if (client.requestRevisions)) and the
__applicationContracts mock remain valid and TypeScript no longer forces the
unreachable fallback.
🪄 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: fb6f8982-d283-4287-b800-1f63fc8a7f88
📒 Files selected for processing (5)
components/bounty-detail/bounty-detail-client.tsxcomponents/bounty/application-submit-work-panel.tsxcomponents/bounty/submission-approval-panel.tsxhooks/use-bounty-application.tstypes/bounty.ts
Fixes #202 by adding useRequestRevisions hook, updating SubmissionApprovalPanel to allow creators to request revisions with feedback, and surfacing latest revision feedback to contributors in ApplicationSubmitWorkPanel.
Summary by CodeRabbit