Skip to content

feat: fixed the collections page sorting logic and add URL persistence#5375

Open
Qu1et-x wants to merge 3 commits intomodrinth:mainfrom
Qu1et-x:feat/collections-sort-persistence
Open

feat: fixed the collections page sorting logic and add URL persistence#5375
Qu1et-x wants to merge 3 commits intomodrinth:mainfrom
Qu1et-x:feat/collections-sort-persistence

Conversation

@Qu1et-x
Copy link

@Qu1et-x Qu1et-x commented Feb 15, 2026

Summary

This PR improves the collection page's user experience by fixing a sorting conflict and adding state persistence to the URL.

Changes

  • Fixed Sorting Logic: Removed a conflicting inline .sort() in the template that was overriding the computed property.
  • Added URL Persistence: Integrated useNativeRoute and useNativeRouter to synchronize the sortBy state with the URL query parameter ?s=.
  • UI Consistency: Replaced the previous search row with a DropdownSelect component, matching the design language used in the search page (index.vue).
  • Improved Layout: Adjusted margins (mb-3) and input heights to create a more compact and modern look.
  • Empty State: Added a visual feedback section for when no collections match the user's search query.

Technical Details

  • Used a watch effect on sortBy to trigger router.replace for seamless URL updates without adding to browser history.
  • Ensured orderedCollections handles both filtering and sorting in a single reactive computed property.

Verification

  • Verified that sorting works as expected on both desktop and mobile.
  • Confirmed that refreshing the page restores the previously selected sorting option.

@Qu1et-x Qu1et-x changed the title "feat(collections): fix sorting logic and add URL persistence" feat: fixed the collections page sorting logic and add URL persistence Feb 15, 2026
@IMB11 IMB11 added frontend Involves work from the frontend team 📂 Under review [Triage] Is being reviewed by Modrinth Staff for future roadmap consideration. labels Feb 16, 2026
@IMB11 IMB11 self-requested a review February 16, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Involves work from the frontend team 📂 Under review [Triage] Is being reviewed by Modrinth Staff for future roadmap consideration.

Development

Successfully merging this pull request may close these issues.

2 participants