bluwy / publint

Lint packaging errors
https://publint.dev
MIT License
960 stars 21 forks source link

Feature: add select to switch the version #56

Closed btea closed 1 year ago

btea commented 1 year ago

Sometimes there is a problem in the new version, but the previous version is no problem, add a select to quickly switch the version to easily locate which version is the problem.

I can try to create a PR if you think it works.。

bluwy commented 1 year ago

Hi, do you mean the publint version, or the package version? Changing the publint version is a little tricky since there are code shipped to specifically handle a version of publint, e.g. converting the results to human-readable messages.

If you mean the package version, that's definitely a welcome change! I actually experimented that a bit last week, but it's hard to get the design right. I could also push the wip branch up for reference.

btea commented 1 year ago

Yeah, I mean the package version. My current idea is to get all the versions directly through the jsdelivr API.

For example, get the vite version, https://data.jsdelivr.com/v1/package/npm/vite

bluwy commented 1 year ago

Sounds great, feel free to send a PR if you'd like. I can also push my branch later when I get to my laptop, but it's a bit outdated now.

I'm currently working on some design touch ups to the site locally that's no published yet, in case you're seeing some things different.

bluwy commented 1 year ago

Here it is: https://github.com/bluwy/publint/tree/switch-version. It's actually kinda almost there I think, but needs a little polishing.

btea commented 1 year ago

I tried it and it looks amazing! 👍

However, there is a little problem, when the version is switched, there will be page switching flashing, which does not look so smooth.

publint

bluwy commented 1 year ago

Yeah I noticed that too. I don't know why it's doing that and hopefully doesn't happen much in prod. That could use some polishing.

Feel free to work on top of the branch if you'd like, but if not no worries too. I'm working on a whole site improvement and will also take on that feature in a couple days if not.

btea commented 1 year ago

I'm relatively new to Sevelte. I tried a similar effect directly using the select tag locally, and the above situation does not occur when switching. I found that you added a new component PackageVersion.svelte, perhaps because of it?

Since my local logic is written directly in the Package.svelte component, there is this guess. 🤔

You're making overall improvements to the site, and I think it's better to keep your rhythm, so I'm not going to make changes, but I'll keep looking at the code.

bluwy commented 1 year ago

Awesome. Yeah I tried with select first too, but unfortunately when we lazily fetch the options, Safari doesn't update the list automatically. It was also hard to style it, so I went with the manual select implementation.

btea commented 1 year ago

The compatibility handling of native select is a real headache. 🤦‍♂️

bluwy commented 1 year ago

0012a81 should implement this and will release the site later tonight. Closing this for now.

btea commented 1 year ago

The new site style looks so cool! 👍