Skip to content

Add pagination, filtering, and sorting to the bounty board with mock-data parity #28

Closed

Description

@chonilius

Problem

src/app/issues/page.tsx renders the bounty board — presumably the highest-traffic, most performance-sensitive route since it's the primary discovery surface for contributors per the README's feature map. fetchBounties in src/lib/api.ts has no pagination, filtering, or sorting parameters — it fetches the entire /bounties collection in one call every time the page renders. As the platform grows past a small demo dataset, this becomes a scaling problem on multiple axes simultaneously: unbounded server-side payload size and Server Component render time, no way for a contributor to filter by difficulty/asset/repo/reward-range without client-side filtering of an already-fully-loaded dataset (wasteful and eventually infeasible), and no URL-shareable filter/sort state (a contributor can't bookmark or share "beginner USDC bounties over $50" as a link).

Why this is hard

  • This requires designing a pagination/filtering contract against a backend (mergefi-backend) that, per the currently visible frontend code, has no evidence of supporting query params on /bounties at all — you need to either verify the backend already supports this (check the mergefi/backend repo) or explicitly scope this as a paired frontend+backend change and design the frontend to degrade sensibly if backend support lands later.
  • Filter/sort state needs to live in the URL (Next.js searchParams in the Server Component) for shareability and correct back/forward browser navigation, not in client-only React state — this affects whether /issues can remain a Server Component or needs restructuring, since reading searchParams in a Server Component and passing filtered/paginated results down is the correct App Router pattern but requires re-architecting how fetchBounties/adaptBounty are invoked (per-page-load with params, not once with a static fallback).
  • The mock-data fallback path (fetchWithFallback/fetchBounties's catch-and-return-fallback) needs to also respect the same filter/sort/pagination params against mock-data.ts so the "always demoable without a backend" property from the README isn't broken by this change — i.e. mock-data.ts needs in-memory filter/sort/paginate logic mirroring what the backend would do.
  • Must design sensible defaults and limits (page size, max sortable fields) and handle edge cases: filters that produce zero results, invalid/out-of-range page numbers in the URL, combining multiple simultaneous filters.

Scope

  • Design and document the pagination/filter/sort query contract (params, defaults, limits).
  • Update fetchBounties (and request) to accept and forward these params to the backend.
  • Add equivalent in-memory filter/sort/pagination logic for the mock-data.ts fallback path so demos remain fully functional offline.
  • Restructure src/app/issues/page.tsx to read searchParams, pass them through, and render filter/sort controls that update the URL (not just local state).
  • Add an empty-state and invalid-page-number handling (e.g. clamp or redirect to a valid page).
  • Coordinate/document the required backend contract as a note in the PR if backend support doesn't yet exist.

Acceptance criteria

  • Filtering and sorting the bounty board produces a shareable, bookmarkable URL that reproduces the same filtered view on reload.
  • The page works fully (with correct filtering/sorting/pagination) against mock data with no backend running.
  • Invalid page/filter query params degrade gracefully rather than erroring the page.

Activity

  1. added
    very hardVery difficult task, expert-level effort required
    performancePerformance/optimization issue
    enhancementNew feature or request
    on Jul 15, 2026
  2. Umesh-Tiruvalluru commented on Aug 3, 2026

    @Umesh-Tiruvalluru

    Hi! I'd like to work on this issue. Could you please assign it to me?

  3. Kriss255 commented on Aug 25, 2026

    @Kriss255

    @Kriss255 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Can I work on this

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Kriss255 to this issue.

  4. charliechinedu19-netizen commented on Aug 25, 2026

    @charliechinedu19-netizen

    @charliechinedu19-netizen has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    hey gm, i'd love to take on this task real quick please

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @charliechinedu19-netizen to this issue.

  5. Max347bot commented on Aug 25, 2026

    @Max347bot

    @Max347bot has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi Maintainer! I'm a senior developer with experience building high-quality, production-ready software. I'd love to take on this issue and deliver a clean, well-tested solution that aligns with the project's standards. Please assign it to me—I'm ready to get started and contribute effectively.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Max347bot to this issue.

  6. danfulani0 commented on Aug 25, 2026

    @danfulani0

    @danfulani0 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi Maintainer! I'm a senior developer with experience building high-quality, production-ready software. I'd love to take on this issue and deliver a clean, well-tested solution that aligns with the project's standards. Please assign it to me—I'm ready to get started and contribute effectively.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @danfulani0 to this issue.

  7. Godbrand0 commented on Aug 26, 2026

    @Godbrand0
    Contributor

    @Godbrand0 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    hello, i would like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Godbrand0 to this issue.

  8. drips-wave commented on Aug 26, 2026

    @drips-wave

    Congratulations, @Godbrand0! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @Godbrand0: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  9. grantfox-oss commented on Sep 28, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @Godbrand0's PR #574 was approved and merged by @chonilius.

    🏆 @Godbrand0: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (564 total points). Track your full progress on GrantFox.

    👏 Great work, @Godbrand0! Keep contributing to MergeFi.

  10. drips-wave commented on Sep 28, 2026

    @drips-wave

    This issue has been completed by @Godbrand0 as part of the Stellar Wave Program's 9th Wave 🥳

    😎 @Godbrand0: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  11. added a commit that references this issue on Oct 2, 2026
    1208623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestperformancePerformance/optimization issuevery hardVery difficult task, expert-level effort required

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions