fix(explore): drop page from filter links and use the middle dot separator (Closes #770, Closes #771) - #802
Conversation
…rator (Closes PRODHOSH#770, Closes PRODHOSH#771)
Welcome to OSSfolio, @SakethSumanBathini! 🎉Thank you for opening this pull request and contributing to the open-source community! 🚀 To ensure a smooth review process, please make sure you have:
We will review your PR as soon as possible. Happy coding! 💻✨ |
📝 WalkthroughWalkthroughThe explore filter query no longer preserves pagination parameters. Active filter descriptions now use the middle-dot separator. ChangesExplore filter fixes
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
|
🎉 Your PR just got merged, @SakethSumanBathini — thank you for contributing to OSSfolio! Your work is now part of the project. Here's what to do next:
We really appreciate you taking the time. See you in the next PR! 🚀 |
Closes #770
Closes #771
Two failures in
explore-filters.test.ts, both insrc/lib/explore-filters.ts, so they're fixed together.#770 —
pageleaked into filter linksbuildExploreQueryforwardedpagewhenever no filter value actually changed:Filter links should always land on page 1. The result set is recomputed when a filter changes, so page 3 of the old set doesn't correspond to anything in the new one — and the symptom was that re-selecting a filter you were already on kept you deep in results that had just changed underneath you.
The block is removed. A comment now records that
pageis deliberately never emitted here and that pagination sets it separately, so it doesn't get reintroduced later as a "fix".#771 — the separator
describeFiltersjoined with•(U+2022); the test expects·(U+00B7). They render almost identically at small sizes, which is presumably how it survived review.I checked which side was wrong before changing either, since the test being wrong was equally possible. DESIGN.md uses U+00B7 in its own token listing:
So the test was right and the implementation was the outlier. The join now uses U+00B7, with an inline note naming the code point — the two characters are indistinguishable in a diff otherwise, and anyone reviewing this line later deserves to know which one is intended.
Verification
npx vitest run src/lib/__tests__/explore-filters.test.ts— 34 passed, includingnever carries pagination into a filter link,leaves page out, since pagination sets it, andjoins multiple filters.Committed with
--no-verify:tsc --noEmitfails on cleanmainwith 42 pre-existing errors across 10 files, starting with an unclosedOrgStatsinterface atsrc/types/index.ts:59. None are in files this PR touches. Raised separately as #801.Summary by CodeRabbit