Skip to content

fix(apply-for-slot): lint and import cleanup from PR #251 - #252

Merged
Benjtalkshow merged 1 commit into
boundlessfi:mainfrom
Benjtalkshow:fix/pr-251-cleanup
May 28, 2026
Merged

fix(apply-for-slot): lint and import cleanup from PR #251#252
Benjtalkshow merged 1 commit into
boundlessfi:mainfrom
Benjtalkshow:fix/pr-251-cleanup

Conversation

@Benjtalkshow

@Benjtalkshow Benjtalkshow commented May 28, 2026

Copy link
Copy Markdown
Contributor

PR #251 merged with a lint error and mid-file imports. Cleaning up.

Changes

  • e2e/bounty-application.spec.ts:199 was using (body as any).variables?.id. Extended the typed body shape with variables?: { id?: string } so the cast goes away. Wrapped the case "Bounty": block in braces to scope the new requestedId / bountyData constants properly.
  • hooks/use-bounty-application.ts had imports for authClient, MOCK_MODEL4_MILESTONES, ContributorProgress, and Bounty declared mid-file (line 260+) instead of at the top. Moved them up alongside the rest.

Verified

  • pnpm lint clean (only the pre-existing server-graphql.ts warning remains)
  • pnpm tsc --noEmit clean

Summary by CodeRabbit

  • Tests

    • Updated E2E test suite formatting and structure for improved readability.
  • Refactor

    • Reorganized imports and reformatted code structure in application hooks for better maintainability.

Review Change Stack

- Type the GraphQL mock body with variables.id instead of casting to any,
  removes the lint error at e2e/bounty-application.spec.ts:199.
- Move the mid-file imports for authClient, MOCK_MODEL4_MILESTONES,
  ContributorProgress, and Bounty to the top of use-bounty-application.ts.
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc9122a8-88ef-4111-9153-bc496be98143

📥 Commits

Reviewing files that changed from the base of the PR and between a5d3375 and b253ca9.

📒 Files selected for processing (2)
  • e2e/bounty-application.spec.ts
  • hooks/use-bounty-application.ts

📝 Walkthrough

Walkthrough

This PR applies formatting and structural improvements to the bounty application feature's E2E test fixture and React query hook. The GraphQL mock handler gains block-scoped case logic and type refinements, test callbacks are reformatted for consistency, and the hook consolidates imports while reorganizing its optimistic update and invalidation patterns without altering behavior.

Changes

Bounty Application Refactoring

Layer / File(s) Summary
E2E GraphQL Mock Handler Structure
e2e/bounty-application.spec.ts
Milestone and bounties array formatting, init-script wiring restructuring, GraphQL request body parsing type refinement to include optional variables.id, and wrapping the "Bounty" switch case in a block scope for clearer requestedId/bountyData selection. Test callback parameters and try/catch blocks in route overrides are reformatted across Apply for Slot, Slots Full, and Already Joined test cases.
Hook Import Organization and Query Updates
hooks/use-bounty-application.ts
Top-level imports consolidated to include authClient, MOCK_MODEL4_MILESTONES, and bounty-related types. The useApplyForSlot hook's onMutate optimistic update (building new ContributorProgress entries and updating cached bounty fields) and onSettled query invalidation are reformatted while maintaining the same data update logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • boundlessfi/bounties#200: Introduces the useApplyForSlot hook with mutation optimistic update logic that this PR reformats without behavioral changes.
  • boundlessfi/bounties#180: Introduces the Playwright bounty/join flow test in e2e/bounty-application.spec.ts that this PR further refactors and improves for readability.

Poem

🐰 Hops through the code with care and grace,
Block scopes align, imports find their place,
Formatting flows from test to hook so tight,
No logic changed, yet all feels right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 pull request title accurately summarizes the main changes: linting and import cleanup from PR #251, which aligns with the actual changes of reformatting, adding proper type annotations, and moving imports to the top of files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

@Benjtalkshow
Benjtalkshow merged commit c56bd4b into boundlessfi:main May 28, 2026
2 of 4 checks passed
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.

1 participant