Skip to content

Conversation

@offbeatjs
Copy link
Contributor

This pull request refactors how query parameters are managed across the repository search, sorting, filtering, and pagination components. The main change is replacing manual URL and query string manipulation with the nuqs library's hooks, leading to cleaner code and more reliable state management for the UI. This affects how search queries, sorting, filtering, and pagination are handled and synchronized with the URL.

Query parameter management improvements:

  • Replaced manual query string manipulation and Next.js router usage in search-form.tsx, pagination.tsx, sorter.tsx, and stars-filter.tsx with nuqs hooks (useQueryState, useQueryStates). This simplifies state updates and ensures UI state is always in sync with the URL. [1] [2] [3] [4]

Search and filter UX enhancements:

  • Updated the search form (search-form.tsx) to use nuqs for the search query parameter, improving reliability and making it easier to reset and update the search state. [1] [2] [3]
  • Refactored the stars filter (stars-filter.tsx) to use nuqs for star range and pagination parameters, simplifying filter logic and ensuring correct updates when the user interacts with the filter.

Sorting and navigation improvements:

  • Refactored sorting logic in sorter.tsx to use nuqs for sort field, order, and language parameters, removing reliance on URLSearchParams and streamlining the code for generating navigation links. [1] [2] [3]

Pagination update:

  • Updated the pagination component to use nuqs for page parameter management, removing the need to pass searchParams as a prop and simplifying page changes. [1] [2]

Dependency addition:

  • Added the nuqs package to package.json to enable the new query state management.

Replaces manual search query handling with nuqs's useQueryState for improved URL query management in the search form.
 Adds nuqs dependency to package.json.
Replaces manual URLSearchParams and next/navigation search param handling with nuqs useQueryState and useQueryStates in pagination, sorter, and stars-filter components. Simplifies state management and improves consistency for query parameter updates across repo listing UI.
Resolve Conflicts
@vercel
Copy link

vercel bot commented Oct 29, 2025

@offbeatjs is attempting to deploy a commit to the Max Programming's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Oct 29, 2025

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

Project Deployment Preview Comments Updated (UTC)
hacktoberfest-projects Error Error Oct 31, 2025 4:08pm

@max-programming
Copy link
Owner

@offbeatjs you didn't really install nuqs with pnpm. It's not in the pnpm lockfile

@offbeatjs
Copy link
Contributor Author

I don't upload the lockfiles, I'll spin up a codespace since I'm outstation and install nuqs and create the change

Copilot AI and others added 3 commits October 29, 2025 10:05
Co-authored-by: offbeatjs <193760898+offbeatjs@users.noreply.github.com>
Copy link
Owner

@max-programming max-programming left a comment

Choose a reason for hiding this comment

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

In /repos/[language]/page.tsx is where the build error occurs because the searchParams prop is being passed in to Pagination component but it has been removed here

It'd be much better to try and run the build command locally first and then push the code :)

Removed searchParams prop from Pagination component.
Remove searchParams from Pagination component
Copy link
Owner

@max-programming max-programming left a comment

Choose a reason for hiding this comment

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

Build error

21:38:37.668 Error: [nuqs] nuqs requires an adapter to work with your framework.

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.

2 participants