Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@devkiran
Copy link
Collaborator

@devkiran devkiran commented Nov 3, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Increased bounty submission rejection note character limit from 500 to 5000.
    • Improved character limit display in the rejection modal to show current and maximum character count.

@vercel
Copy link
Contributor

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Nov 3, 2025 6:08pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Walkthrough

Introduces a new constant MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH (5000) in the Zod schema and updates the bounty rejection modal to import and use this constant instead of hardcoded values throughout the component.

Changes

Cohort / File(s) Summary
Schema constant extraction
apps/web/lib/zod/schemas/bounties.ts
New constant MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH (5000) exported; rejectBountySubmissionSchema updated to use this constant for rejectionNote max validation instead of hardcoded 500
UI component update
apps/web/ui/partners/reject-bounty-submission-modal.tsx
Imports new constant and replaces hardcoded 5000 values with MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH; updates textarea maxLength attribute and register validation options; adjusts character count display

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward constant extraction for improved maintainability
  • Single-source-of-truth pattern applied consistently
  • Minimal logic changes, primarily value replacements

Suggested reviewers

  • steven-tey

Poem

🐰 A constant home for boundaries clear,
No more numbers scattered here!
Five-thousand chars, now gathered tight,
In schema burrows, organized right!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix reject bounty submission action' is vague and does not convey the specific nature of the change. The changes involve increasing the rejection note length limit from 500 to 5000 characters and refactoring to use a constant, but the title only uses the generic term 'Fix' without describing what is being fixed. Consider a more descriptive title such as 'Increase bounty rejection note limit to 5000 characters' or 'Refactor bounty rejection note validation with constant' to clearly communicate the main change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-bounty-rejection

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a65de61 and fd5afb5.

📒 Files selected for processing (2)
  • apps/web/lib/zod/schemas/bounties.ts (2 hunks)
  • apps/web/ui/partners/reject-bounty-submission-modal.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: TWilson023
Repo: dubinc/dub PR: 2736
File: apps/web/lib/actions/partners/create-bounty-submission.ts:105-112
Timestamp: 2025-08-26T14:32:33.851Z
Learning: Non-performance bounties are required to have submissionRequirements. In create-bounty-submission.ts, it's appropriate to let the parsing fail if submissionRequirements is null for non-performance bounties, as this indicates a data integrity issue that should be caught.
Learnt from: devkiran
Repo: dubinc/dub PR: 2833
File: apps/web/lib/actions/partners/approve-bounty-submission.ts:53-61
Timestamp: 2025-09-12T17:31:10.548Z
Learning: In approve-bounty-submission.ts, the logic `bounty.rewardAmount ?? rewardAmount` is intentional. Bounties with preset reward amounts should use those fixed amounts, and the rewardAmount override parameter is only used when bounty.rewardAmount is null/undefined (for custom reward bounties). This follows the design pattern where bounties are either "flat rate" (fixed amount) or "custom" (variable amount set during approval).
📚 Learning: 2025-09-12T17:31:10.548Z
Learnt from: devkiran
Repo: dubinc/dub PR: 2833
File: apps/web/lib/actions/partners/approve-bounty-submission.ts:53-61
Timestamp: 2025-09-12T17:31:10.548Z
Learning: In approve-bounty-submission.ts, the logic `bounty.rewardAmount ?? rewardAmount` is intentional. Bounties with preset reward amounts should use those fixed amounts, and the rewardAmount override parameter is only used when bounty.rewardAmount is null/undefined (for custom reward bounties). This follows the design pattern where bounties are either "flat rate" (fixed amount) or "custom" (variable amount set during approval).

Applied to files:

  • apps/web/lib/zod/schemas/bounties.ts
  • apps/web/ui/partners/reject-bounty-submission-modal.tsx
📚 Learning: 2025-08-26T14:32:33.851Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2736
File: apps/web/lib/actions/partners/create-bounty-submission.ts:105-112
Timestamp: 2025-08-26T14:32:33.851Z
Learning: Non-performance bounties are required to have submissionRequirements. In create-bounty-submission.ts, it's appropriate to let the parsing fail if submissionRequirements is null for non-performance bounties, as this indicates a data integrity issue that should be caught.

Applied to files:

  • apps/web/lib/zod/schemas/bounties.ts
  • apps/web/ui/partners/reject-bounty-submission-modal.tsx
🧬 Code graph analysis (1)
apps/web/ui/partners/reject-bounty-submission-modal.tsx (1)
apps/web/lib/zod/schemas/bounties.ts (1)
  • MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH (25-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
apps/web/lib/zod/schemas/bounties.ts (1)

25-172: Consistent rejection-note limit

Thanks for hoisting the limit into MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH and wiring the schema to it—this keeps server-side validation aligned with the UI and avoids future drift.

apps/web/ui/partners/reject-bounty-submission-modal.tsx (1)

7-155: UI now mirrors schema cap

Nice follow-through importing MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH—the live counter, form validation, and textarea maxLength all stay in sync with the schema cap.


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.

@steven-tey steven-tey merged commit 84c1655 into main Nov 3, 2025
8 of 9 checks passed
@steven-tey steven-tey deleted the fix-bounty-rejection branch November 3, 2025 18:12
@coderabbitai coderabbitai bot mentioned this pull request Nov 9, 2025
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.

3 participants