keystatic icon indicating copy to clipboard operation
keystatic copied to clipboard

Track sort descriptor in url

Open jplhomer opened this issue 1 year ago • 4 comments

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

jplhomer avatar Apr 26 '24 12:04 jplhomer

🦋 Changeset detected

Latest commit: 98302165a5e9898dfb38a2584c0fdcec9578f248

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

changeset-bot[bot] avatar Apr 26 '24 12:04 changeset-bot[bot]

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

vercel[bot] avatar Apr 26 '24 12:04 vercel[bot]

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 avatar Apr 29 '24 20:04 jplhomer

OK, I PRed this alternate approach here, and I think I like it better than simply tracking params in the URL https://github.com/Thinkmill/keystatic/pull/1110

jplhomer avatar Apr 29 '24 20:04 jplhomer