jsr icon indicating copy to clipboard operation
jsr copied to clipboard

feat: package version in scope and search result lists

Open iuioiua opened this issue 1 year ago • 6 comments

Closes #421

localhost_8000_packages_search=x (1)

iuioiua avatar May 17 '24 04:05 iuioiua

I think this needs some different styling. Right now it is not clear that this is the latest version.

@josh-collinsworth any ideas?

lucacasonato avatar May 17 '24 17:05 lucacasonato

I think this needs some different styling. Right now it is not clear that this is the latest version.

@josh-collinsworth any ideas?

Is there any situation where this might not display the most recent version? Wouldn't search always automatically default to the latest and show that version?

If not, I'd suggest maybe adding a "latest" pill, similar to what's shown on the package page next to the version number.

If so, though, I'm wondering whether it's needed at all.

josh-collinsworth avatar May 17 '24 19:05 josh-collinsworth

For what it's worth, I had a little hack at this myself before I realised this PR was open. I think it's pretty obvious that it refers to the latest version, what else would it be? adding a latest pill would just be noise. I think that the version could be a little bit more subtle though, here was my hack at it, based on the styling of on the main package page...

        <div class="grow-1">
          <div class="flex items-baseline gap-x-3">
            <span class="text-cyan-700 font-semibold">
              {`@${pkg.scope}/${pkg.name}`}
            </span>
            {'latestVersion' in pkg && pkg.latestVersion && (
              <span class="text-[0.75em] font-bold text-gray-500 truncate">
                <span class="relative text-[0.80em] -top-[0.175em] font-[800]">
                  @
                </span>
                {pkg.latestVersion}
              </span>
            )}
          </div>
Screenshot 2024-05-23 at 11 07 03 am

jollytoad avatar May 23 '24 10:05 jollytoad

It seems clear to me that this is the latest version. npm also does this. Perhaps we can merge this and then re-evaluate if we get complaints.

iuioiua avatar Jun 03 '24 23:06 iuioiua

How would you like to proceed, @lucacasonato?

iuioiua avatar Jun 28 '24 01:06 iuioiua

Gentle ping on this one once more. Having this would be nice, specifically for std, as we would then be able to remove the packages table in the README.

iuioiua avatar Sep 24 '24 00:09 iuioiua

Any progress on this? I'd really like to see this feature in jsr, really useful for std and other libraries that consist of multiple packages.

jollytoad avatar Nov 18 '24 17:11 jollytoad