Track sort descriptor in url
Coming hot off #1097, this PR stores the column sort descriptor in a URL param 😄
🦋 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
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 |
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?
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