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

feat: Merge categories/tags and improve filtering #541

Merged
merged 38 commits into from
Dec 30, 2023
Merged

feat: Merge categories/tags and improve filtering #541

merged 38 commits into from
Dec 30, 2023

Conversation

lachlancollins
Copy link
Collaborator

@lachlancollins lachlancollins commented Dec 21, 2023

💭 Problem

This was prompted in part by discussion on #443. Tags are effectively unlimited and unregulated right now; however, categories are also quite limited since each entry can only have one. Filtering based on category/tags via the select fields is an okay experience - but it could be better!

🎯 Changes

Heavily inspired by bestofjs.org. Each item will be allowed multiple, pre-defined categories (or tags, the name doesn't matter). This would be a merge of current categories and useful tags to keep. By default, all entries are displayed. A collection of buttons let you choose which categories/tags you want displayed. When you select a category/tag, the list of available categories/tags narrows based on your current selection. This utilises a server load function, and the URL is shareable due to search params.

Before

image

After

image

image

image

✅ Checklist

  • I have given my PR a descriptive title
  • I have run pnpm run lint locally on my changes

Copy link

netlify bot commented Dec 21, 2023

Deploy Preview for sveltesociety-preview ready!

Name Link
🔨 Latest commit 2314441
🔍 Latest deploy log https://app.netlify.com/sites/sveltesociety-preview/deploys/6586d24b47837e0008759803
😎 Deploy Preview https://deploy-preview-541--sveltesociety-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@benmccann
Copy link
Collaborator

Honestly, I'm not a big fan of this as implemented. We commonly do things like link to https://sveltesociety.dev/packages#svelte-kit-adapters. There's no way to do that now as everything's just mixed together and that filter doesn't exist. It's also going to break tons of links that we have across svelte.dev and kit.svelte.dev. We could clean those up, but we'd need ways to keep the existing functionality for that to be possible

@kevmodrome
Copy link
Member

This looks great!

@lachlancollins
Copy link
Collaborator Author

lachlancollins commented Dec 22, 2023

Honestly, I'm not a big fan of this as implemented. We commonly do things like link to sveltesociety.dev/packages#svelte-kit-adapters. There's no way to do that now as everything's just mixed together and that filter doesn't exist. It's also going to break tons of links that we have across svelte.dev and kit.svelte.dev. We could clean those up, but we'd need ways to keep the existing functionality for that to be possible

@benmccann oh wow fair enough, I had no idea it was referenced extensively in the svelte/kit docs. For that above link, with this change it would become https://sveltesociety.dev/packages?tag=svelte-kit-adapters. I guess the worst case scenario for old links is that users get taken to the top of the page rather than the category ID that was linked. I would argue this new solution is more robust than since it only loads the contents of the specific category/tag in the link. Either way, I'm not too fussed if this proposal isn't feasible since it was fun to implement!

@kevmodrome
Copy link
Member

There is a feature in Cloudflare to do bulk redirects - maybe that's something we can explore?

@kevmodrome
Copy link
Member

Given that we get the same functionality as before - would it be fine to merge this if we updated all the links on the Svelte site? @benmccann

@benmccann
Copy link
Collaborator

Let me give this another look to verify whether things like the ?tag=svelte-kit-adapters filter will let us reproduce what we were depending on previously. I remember there being other issues we might need to address, but I can't check at the moment because the Netlify deploy is broken. Do we need to close this PR and open a new one to see the Vercel deploy preview or was the Netlify one taken down and the Vercel one not added yet?

@kevmodrome
Copy link
Member

I think so.

@kevmodrome kevmodrome closed this Dec 23, 2023
@kevmodrome kevmodrome reopened this Dec 23, 2023
Copy link

vercel bot commented Dec 23, 2023

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

Name Status Preview Comments Updated (UTC)
sveltesociety-dev-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 30, 2023 8:30am

@lachlancollins
Copy link
Collaborator Author

Hi @benmccann , would you be able to give this another look? Thanks!

@lachlancollins lachlancollins marked this pull request as ready for review December 30, 2023 08:31
@lachlancollins lachlancollins merged commit 11d5ed5 into svelte-society:main Dec 30, 2023
3 checks passed
@lachlancollins lachlancollins deleted the tags-rework branch December 30, 2023 08:34
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.

3 participants