Skip to content

Hovercard enhancements #2116

Closed
Closed

Description

@jerone

Issuehunt badges

Description

Can we enhance the user and organization hovercards with some more useful information:

  • Add company name.
  • Add website/blog url.
  • Add joined date (relative-time).
  • For users (similar to organizations) show (and link to) number of:
    • Followers
    • Following
    • Repos
    • Orgs
    • Gists
  • Location can be linkified to Google Maps.

Use case

The company name can be useful to find out for which company the user works for [..]if the user works for GitHub. Their users are not always shown as staff on their cards. See test case below. (this issue has been fixed by GitHub)
The website/blog url is interesting for both users and organizations.
Joined date and counts are useful to know how active that person is on public repos.

Test case

User:

  1. Hover over any user in this issue (mine for example).

Admin user:

  1. Go to GitHub org https://github.com/orgs/github/people
  2. In the members section, hover over "Alejandro Cadavid".
  3. His hovercard says he's not staff, but his api says he's site_admin: https://api.github.com/users/acadavid

Organization:

  1. Go to my profile https://github.com/jerone
  2. Hover over any organization.

Ref

Long time ago I created my own hovercard as an userscript, GitHub User Info, before GitHub implemented their own. I still use mine (using them together does conflict a little, see screenie), but I love to see those features implemented in GitHub Refined. The source is probably not so useful anymore, as it's old and still uses REST API v3, but it might give an idea how the default hovercard can be enhanced.

image

Doc

https://api.github.com/users/jerone
https://api.github.com/users/jerone/orgs
https://api.github.com/orgs/github
https://api.github.com/orgs/github/members
Hovercards element (one element at the bottom of the HTML): .Popover.js-hovercard-content.position-absolute
Hovercards are loaded with a fetch https://github.com/hovercards?user_id=1402241&subject=pull_request%3A284448295&current_path=%2Fsindresorhus%2Frefined-github%2Fpull%2F2115


IssueHunt Summary

tiramisu77 tiramisu77 has been rewarded.

Backers (Total: $10.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Activity

  1. sindresorhus commented on Jun 24, 2019

    @sindresorhus
    Member

    Go to GitHub org github.com/orgs/github/people
    In the members section, hover over "Alejandro Cadavid".

    They fixed that. That user now shows as "Staff": https://github.com/orgs/github/people

  2. jerone commented on Jun 24, 2019

    @jerone
    ContributorAuthor

    They fixed that. That user now shows as "Staff": github.com/orgs/github/people

    Thanks for letting me know; adjusted the description.

  3. fregante commented on Sep 8, 2019

    @fregante
    Member

    I think that the hovercard is already rather large and full of info. There's only one suggestion I'd take:

    • Location can be linkified to Google Maps.

    PR welcome just for that

  4. arnaudvalle commented on Oct 11, 2019

    @arnaudvalle
    Contributor

    Would it make sense to "linkify" the location on the user profile page as well (as a separate feature)?

  5. jerone commented on Oct 11, 2019

    @jerone
    ContributorAuthor

    The HTML of the hovercard of some random user is as following:

    hovercard HTML...
    <div class="Popover js-hovercard-content position-absolute" style="display: block; outline: currentcolor none medium; top: 950.7px; left: 425.35px; z-index: 100;" tabindex="0">
      <div class="Popover-message Popover-message--large Box box-shadow-large Popover-message--bottom-right" style="width:360px;"><div><div class="pb-3 px-3">
      <div data-hovercard-tracking="{&quot;actor_id&quot;:55841,&quot;user_id&quot;:7574,&quot;user_login&quot;:&quot;anurse&quot;,&quot;subject_type&quot;:&quot;Organization&quot;,&quot;referrer_controller_action&quot;:&quot;profiles#show&quot;}"></div>
      <div data-hydro-view="{&quot;event_type&quot;:&quot;user-hovercard-hover&quot;,&quot;payload&quot;:{&quot;userId&quot;:&quot;7574&quot;,&quot;subject&quot;:&quot;organization:6476660&quot;,&quot;client_id&quot;:&quot;1601513644.1548339231&quot;,&quot;originating_request_id&quot;:&quot;DC20:3FB79:11746C9:1A132F1:5DA0A953&quot;,&quot;originating_url&quot;:&quot;https://github.com/hovercards?user_id=7574&amp;subject=organization%3A6476660&amp;current_path=%2Faspnet%3Ftype%3Dsource&quot;,&quot;referrer&quot;:&quot;https://github.com/aspnet?type=source&quot;,&quot;user_id&quot;:55841}}" data-hydro-view-hmac="5eae97e92cf81f469409bc02f612cec832810c12d5e378c4defbeb53f4cc76cc"></div>
    
    
      <div class="d-flex mt-3">
        <div class="flex-self-start">
          <div class="rounded-1 overflow-hidden">
            <a data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:profile" href="/anurse">
              <img class="d-block" alt="@anurse" src="https://avatars1.githubusercontent.com/u/7574?s=180&amp;v=4" width="60" height="60">
    </a>
              <div class="d-block f6 bg-purple no-underline text-bold text-uppercase text-white text-center">Pro</div>
          </div>
        </div>
    
        <div class="overflow-hidden ml-3">
          <a class="f5 text-bold link-gray-dark no-underline" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:profile" href="/anurse">Andrew Stanton-Nurse</a>
    
            <a class="link-gray no-underline ml-1" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:profile" href="/anurse">anurse</a>
    
          <div class="mt-1">
            <div>Senior Engineer <a class="user-mention" data-hovercard-type="organization" data-hovercard-url="/orgs/microsoft/hovercard" href="https://github.com/microsoft">@microsoft</a> working on <a class="user-mention" data-hovercard-type="organization" data-hovercard-url="/orgs/aspnet/hovercard" href="https://github.com/aspnet">@aspnet</a> and the odd <a class="user-mention" data-hovercard-type="organization" data-hovercard-url="/orgs/dotnet/hovercard" href="https://github.com/dotnet">@dotnet</a> thing. <g-emoji class="g-emoji" alias="canada" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f1e8-1f1e6.png">🇨🇦</g-emoji> </div>
          </div>
    
            <div class="mt-2 text-gray text-small">
              <svg class="octicon octicon-location" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"></path></svg>
              Seattle, WA
            </div>
        </div>
      </div>
    
        <hr class="ml-n3 mr-n3">
    
    
          <div class="d-flex flex-items-baseline f6 text-gray mt-1 ">
      <div class="mr-1 flex-shrink-0">
        <svg class="octicon octicon-organization text-gray-light" width="20" height="16" viewBox="0 0 16 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M16 12.999c0 .439-.45 1-1 1H7.995c-.539 0-.994-.447-.995-.999H1c-.54 0-1-.561-1-1 0-2.634 3-4 3-4s.229-.409 0-1c-.841-.621-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.442.58 2.5 3c.058 2.41-.159 2.379-1 3-.229.59 0 1 0 1s1.549.711 2.42 2.088C9.196 9.369 10 8.999 10 8.999s.229-.409 0-1c-.841-.62-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.437.581 2.495 3c.059 2.41-.158 2.38-1 3-.229.59 0 1 0 1s3.005 1.366 3.005 4z"></path></svg>
      </div>
    
      <span class="lh-condensed">
              
    
    Member of
    
    
    <a class="link-gray-dark no-underline" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:organization" href="https://github.com/aspnet">ASP.NET</a>, 
    
      and 4 more
    
    </span>
    </div>
    
    
    
      <div class="sr-only">
        Press escape to close this hovercard
      </div>
    </div></div></div>
    </div>

    Trigger an hovercard in the console with:

    $('[data-hovercard-type="user"]').dispatchEvent(new Event('mouseover'));
  6. issuehunt-oss commented on Nov 3, 2019

    @issuehunt-oss

    @jerone has funded $10.00 to this issue.


  7. added
    💵 Funded on Issuehunt
    on Nov 3, 2019
  8. issuehunt-oss commented on Jan 21, 2020

    @issuehunt-oss

    @sindresorhus has rewarded $9.00 to @tiramisu77. See it on IssueHunt

    • 💰 Total deposit: $10.00
    • 🎉 Repository reward(0%): $0.00
    • 🔧 Service fee(10%): $1.00
  9. added and removed
    💵 Funded on Issuehunt
    on Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions