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: Introducing avatar tooltip #7143

Merged
merged 24 commits into from
Nov 18, 2024
Merged

Conversation

canerakdas
Copy link
Member

Description

I saw it in Slack (OpenJS Foundation) threads and thought it was a good way to support contributors

With this PR, the Tooltip component was created and minor refactors were made to Avatar and AvatarGroup components. In addition, the WithAvatarGroup component was created to make avatars easier to manage to simplify the process

I took care to use the elements/components in the existing design system as a design, I was inspired by (Search typing) in the Figma for the Tooltip component;

https://www.figma.com/design/pu1vZPqNIM7BePd6W8APA5/Node.js?node-id=464-6397&node-type=frame&t=dj6OGYBZLLo5cp4z-0

Validation

  • Avatars should continue to work as it is.
  • A tooltip should appear for users in authors.json whose website field is exist

Example screenshot;
image

image

Related Issues

Related to #7141

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copy link

vercel bot commented Oct 25, 2024

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Nov 18, 2024 3:04pm

@mcollina
Copy link
Member

Does it work on mobile? I've tried from my iphone and it didn't work from the preview.

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First look, it's great but maybe have separate type for avatar/ frontmatter/intermediate objects

@AugustinMauroy
Copy link
Member

After some test on desktop few point:

  • For the learn section, all the authors have a GitHub username, so there's no need to go into the authors.json file.
  • For the blog section, we'd have to try and standardise the data so that eventually it's just GitHub usernames. To reduce the complexity of things
  • Like Matteo said need to found something for mobile

@canerakdas
Copy link
Member Author

Does it work on mobile? I've tried from my iphone and it didn't work from the preview.

This is the design choice of the radix tooltip component I use, and IMO it is the right choice (radix-ui/primitives#955 (comment))

Here, as an alternative, it may be better to redirect directly when a profile image is clicked on mobile (like GitHub), but the current profile images are too small for mobile resolution, I will check the accessibility and try to implement a better solution👍

Copy link
Contributor

github-actions bot commented Oct 27, 2024

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 95 🟢 100 🟢 100 🟢 92 🔗
/en/download 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

@AugustinMauroy
Copy link
Member

Does it work on mobile? I've tried from my iphone and it didn't work from the preview.

This is the design choice of the radix tooltip component I use, and IMO it is the right choice (radix-ui/primitives#955 (comment))

Here, as an alternative, it may be better to redirect directly when a profile image is clicked on mobile (like GitHub), but the current profile images are too small for mobile resolution, I will check the accessibility and try to implement a better solution👍

IMO, double can do the job and increase little bit the size of the avatar for mobile

@ovflowd
Copy link
Member

ovflowd commented Oct 28, 2024

@canerakdas can you resolve the conflicts? 👀

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've finally done the review :)

@canerakdas canerakdas requested a review from a team as a code owner November 16, 2024 13:59
Co-authored-by: Claudio W <[email protected]>
Signed-off-by: Caner Akdas <[email protected]>
Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ovflowd
Copy link
Member

ovflowd commented Nov 18, 2024

Awesome work here, @canerakdas, thank you so much!! <3 <3

@AugustinMauroy
Copy link
Member

Awesome work here, @canerakdas, thank you so much!! <3 <3

yeah it's super cool !

thanks @canerakdas !

@ovflowd ovflowd added this pull request to the merge queue Nov 18, 2024
Merged via the queue into nodejs:main with commit bc3b2a9 Nov 18, 2024
14 of 15 checks passed
bmuenzenmeyer pushed a commit that referenced this pull request Nov 21, 2024
* feat: tooltip component and avatar tooltip

* chore: metabar story props updated

* chore: self review

* chore: self review

* refactor: class names

* refactor: horizontal margin added

* feat: accessible avatars on mobile

* feat: default author url

* refactor: review updates

* chore: self review

* refactor: design and review updates

* fix: Avatars in MetaBar story

* refactor: review updates

* fix: opening the tooltip portal within the dialog

* fix: adjusting visible avatar count

* refactor: review updates

* Update apps/site/util/authorUtils.ts

Co-authored-by: Claudio W <[email protected]>
Signed-off-by: Caner Akdas <[email protected]>

* refactor: enhancing code readability

* refactor: review update

---------

Signed-off-by: Caner Akdas <[email protected]>
Co-authored-by: Claudio W <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants