Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track sort descriptor in url #1105

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jplhomer
Copy link
Contributor

Coming hot off #1097, this PR stores the column sort descriptor in a URL param 😄

@jplhomer jplhomer requested a review from emmatown as a code owner April 26, 2024 12:53
Copy link

changeset-bot bot commented Apr 26, 2024

🦋 Changeset detected

Latest commit: 9830216

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@keystatic/core Patch
@keystar/docs Patch
@example/astro-content Patch
@example/astro Patch
@example/localization Patch
@example/next-app Patch
@example/next-block-builder Patch
@example/next-pages Patch
@keystatic/remix-test-app Patch
keystatic-docs Patch
@keystatic/templates-astro Patch
@keystatic/templates-nextjs Patch
@keystatic/templates-remix Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
keystatic-site ✅ Ready (Inspect) Visit Preview Apr 29, 2024 3:58am

@jplhomer
Copy link
Contributor Author

I'm starting to think about some alternatives to this...

The real problem I'm trying to solve is that I'd love to apply a default sort to my collection of posts, e.g. reverse chronological by publishDate. Having sort params persisted in the URL is nice, but still doesn't totally solve that problem.

Perhaps adding a sort callable function option or defaultSortBy + defaultSortDir options to the collection definition would be a better approach?

@jplhomer
Copy link
Contributor Author

OK, I PRed this alternate approach here, and I think I like it better than simply tracking params in the URL #1110

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.

None yet

2 participants