Skip to content

feat: implement request revisions flow (#202)#266

Closed
Ishant5436 wants to merge 2 commits into
boundlessfi:mainfrom
Ishant5436:fix/issue-202-request-revisions
Closed

feat: implement request revisions flow (#202)#266
Ishant5436 wants to merge 2 commits into
boundlessfi:mainfrom
Ishant5436:fix/issue-202-request-revisions

Conversation

@Ishant5436
Copy link
Copy Markdown

@Ishant5436 Ishant5436 commented May 30, 2026

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

  • New Features
    • Implemented revision request workflow allowing reviewers to provide detailed feedback on submissions instead of immediate approval
    • Contributors can now view revision feedback when preparing resubmissions
    • Enhanced support for milestone-based bounties to handle revision workflows more effectively

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@Ishant5436 is attempting to deploy a commit to the Threadflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

@Ishant5436, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9d6a8fed-bf31-4a17-946e-e190770072c9

📥 Commits

Reviewing files that changed from the base of the PR and between 73293f1 and d0c01d4.

📒 Files selected for processing (2)
  • components/bounty/submission-approval-panel.tsx
  • hooks/use-bounty-application.ts
📝 Walkthrough

Walkthrough

This 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 UNDER_REVIEW and stores the feedback; contributors then see the feedback in their submit-work panel before resubmitting.

Changes

Revision Feedback Flow

Layer / File(s) Summary
Bounty type and revision feedback field
types/bounty.ts
Bounty interface gains optional latestRevisionFeedback?: string | null field.
Request revisions mutation and hook
hooks/use-bounty-application.ts
ApplicationContractClient gains requestRevisions method; new useRequestRevisions() hook implements optimistic update to set status UNDER_REVIEW and store feedback, with error rollback and cache invalidation.
Reviewer revision request form and handler
components/bounty/submission-approval-panel.tsx
Local state for form visibility and feedback; useRequestRevisions wiring; handleRequestRevisions handler validates non-empty feedback and manages toasts; UI replaces "Coming Soon" with functional textarea form with Cancel/Send controls.
Contributor feedback alert in submit work panel
components/bounty/application-submit-work-panel.tsx
Props type accepts optional latestRevisionFeedback; conditional destructive Alert renders feedback when provided.
Bounty detail client status routing and prop wiring
components/bounty-detail/bounty-detail-client.tsx
Expands submit-work panel visibility to IN_PROGRESS or UNDER_REVIEW status; passes latestRevisionFeedback prop from bounty data.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • boundlessfi/bounties#200: Introduced the Model 2 panel structure and placeholder revision UI; this PR implements the functional request-revisions flow and completes the feedback loop.

Suggested reviewers

  • Benjtalkshow

Poem

🐰 A revision request hops into view,
Feedback flows freely, a path made brand new,
Reviewers guide changes with care and with grace,
Contributors polish their work in this space!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: implement request revisions flow (#202)' clearly and concisely summarizes the main change: implementing a request revisions feature as described in the pull request objectives.
Linked Issues check ✅ Passed All coding requirements from issue #202 are implemented: useRequestRevisions hook added with optimistic updates, SubmissionApprovalPanel wired to request revisions with feedback/toast, and ApplicationSubmitWorkPanel surfaces latest revision feedback to contributors.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the request revisions flow as specified in issue #202; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 227aa7a and 73293f1.

📒 Files selected for processing (5)
  • components/bounty-detail/bounty-detail-client.tsx
  • components/bounty/application-submit-work-panel.tsx
  • components/bounty/submission-approval-panel.tsx
  • hooks/use-bounty-application.ts
  • types/bounty.ts

Comment thread components/bounty/submission-approval-panel.tsx
Comment thread hooks/use-bounty-application.ts Outdated
Comment thread hooks/use-bounty-application.ts
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.

Implement the Request Revisions flow on the submission approval panel

2 participants