packagist icon indicating copy to clipboard operation
packagist copied to clipboard

Add a version constraint tester/checker to the view package sidebar

Open naderman opened this issue 7 years ago • 12 comments

I think we should include the functionality of https://semver.mwl.be directly in Packagist. I'd imagine a little input box and stability drop down on the right side on a package detail page which then opens a layover with the selected versions and lets you try different constraints.

cc @hannesvdvreken

naderman avatar Nov 30 '17 14:11 naderman

Built into the version table section? Or a different one?

What would be the default values of the input? * and dev (which shows all versions), or ^1.23 (default for monolog atm) and stable?

screen shot 2017-11-30 at 15 28 47

hannesvdvreken avatar Nov 30 '17 14:11 hannesvdvreken

@hannesvdvreken didn't even consider that, i suppose we already list all versions there so no need for a layover or anything can just add it there indeed.

I would keep the default an empty constraint with a placeholder text of ^1.23 as an example? Not sure what to do about the stability? Just a "min-stability" option without a value which forces you to select one? Otherwise I suppose dev so it's not confusing why it's showing everything?

naderman avatar Nov 30 '17 14:11 naderman

Would you

  • grey out non-matching versions (and make them non-clickable)?
  • the inverse of the above: highlight matching versions?
  • hide the non-matching versions and crop the list?

screenshot

hannesvdvreken avatar Nov 30 '17 14:11 hannesvdvreken

I think the default stability used when matching a constraint should be stable, as it is the default stability in Composer.

stof avatar Nov 30 '17 15:11 stof

@stof the problem is that the list contains dev versions and it's confusing to have "stable" as the default choice with the list of versions showing everything including dev by default.

@hannesvdvreken I'd say make the matching ones bold and gray out the non-matching ones? I think cropping is not as helpful cause it makes it less obvious what you're skipping?

naderman avatar Nov 30 '17 15:11 naderman

ok!

So: I see this as the most useful:

Pre-populate the input fields with the default current constraint (^1.23 for monolog) and stable as stable is the default by composer, as @stof pointed out.

Then make matching ones bold, and gray out the non-matching ones. This way, all versions are always visible (if you collapse the section, of course). And it makes it apparent what the current verion will be that will be installed and which versions match that constraint that composer adds to your composer.json file.

hannesvdvreken avatar Nov 30 '17 15:11 hannesvdvreken

Yeah sounds good :-)

naderman avatar Nov 30 '17 15:11 naderman

@naderman maybe the stability selector itself should be grayed out when no constraint at all is entered in the field (i.e. when you are not using the feature) ? Such situation happens because the list ends up having 2 different purposes here (the version switching, and the results of the matching)

stof avatar Nov 30 '17 15:11 stof

@stof yeah, greying out the select would be a good idea.

Do you think we should create a new sidebar section instead?

hannesvdvreken avatar Nov 30 '17 15:11 hannesvdvreken

I think as long as the gray ones still underline and are clearly visible as links we don't need a second list, and I'd go with what hannes suggested, and just have it active with stable by default.

naderman avatar Nov 30 '17 15:11 naderman

k! I think we all agree then :-) 👍

hannesvdvreken avatar Nov 30 '17 15:11 hannesvdvreken

IMO the field can be empty by default, and if empty well it's not filtering anything so by default it can be empty + stable. Then if you enter anything the stable kicks in as well.

As for highlighting vs graying out vs removing.. I'm not sure what's best, but that's kinda easy to tweak anyway :)

Seldaek avatar Nov 30 '17 16:11 Seldaek