refactor: split bounty-detail-submissions-card into smaller components - #309
Conversation
Extract row, dialog, and helper modules under components/bounty-detail/submissions/ while preserving the existing import path via a barrel re-export.
|
@od-hunter is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
@od-hunter Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughSplits the bounty submissions card into helper, dialog, row, and orchestration modules, then re-exports the card entrypoint. Adds helper tests and updates one reputation test import. ChangesSubmissions Card Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ 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-detail/submissions/submissions-card.tsx`:
- Around line 72-79: The autosave effect in useEffect currently runs after
hydration even when both githubPullRequestUrl and submitComments are empty,
which creates an unwanted blank draft. Update the submissions-card.tsx effect to
skip calling autoSave until at least one of those fields has a value, keeping
the existing isHydrated guard and useSubmissionDraft.autoSave behavior intact.
Refer to the useEffect block and the autoSave call that receives
githubPullRequestUrl and comments.
- Around line 86-101: In handleSubmitPR, move the dialog reset and input
clearing out of the finally block so they only run after
submitToBounty.mutateAsync succeeds; on failure, preserve prUrl, submitComments,
and the open state so the user can retry. Apply the same pattern to the other
affected handlers in submissions-card.tsx so only successful mutations clear
draft/dialog state, and keep clearDraft tied to success rather than
unconditional cleanup.
- Line 55: The review flow is hardwired to APPROVED in SubmissionsCard, which
removes the reviewer’s ability to choose other outcomes. Update the review
status handling in submissions-card.tsx so reviewStatus is derived from the
dialog state or existing review action flow instead of being a constant, and
restore the reject/request-revisions choices in the dialog wiring used by the
review submission handlers. Check the logic around SubmissionsCard, the review
dialog callbacks, and the affected review-action blocks so the original reviewer
behavior is preserved.
🪄 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: d0a2cb7c-5e88-43c3-9f26-0d338cab18e3
📒 Files selected for processing (7)
components/bounty-detail/bounty-detail-submissions-card.tsxcomponents/bounty-detail/submissions/__tests__/submission-helpers.test.tscomponents/bounty-detail/submissions/submission-helpers.tscomponents/bounty-detail/submissions/submission-review-dialogs.tsxcomponents/bounty-detail/submissions/submission-row.tsxcomponents/bounty-detail/submissions/submissions-card.tsxcomponents/reputation/__tests__/my-claims.test.ts
Benjtalkshow
left a comment
There was a problem hiding this comment.
Nice split. The structure matches issue #295 and local CI is green. Two small things to fix before I merge:
- The change to
components/reputation/__tests__/my-claims.test.tsis not part of this issue. The only useful part is removing the@jest/globalsimport. Please undo the rest of the changes in that file. - The original
submissions-card.tsxhad three// Replace with toast or error UI as neededcomments next to theconsole.errorcalls. Please add them back so we don't forget to fix the error handling later.
Once those are done, ready to merge.
Restore original formatting in my-claims.test.ts while keeping the @jest/globals import removal, and add back error-handling TODO comments in submissions-card.tsx.
Fixed |
Closes #295
Summary by CodeRabbit