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

fix: stats layout and add tooltips #101

Conversation

theflucs
Copy link
Contributor

@theflucs theflucs commented Jan 29, 2024

Fix responsive card layout
Add tooltips to pr and contribution title (removed title tag), so fixing the issue #95

Copy link

netlify bot commented Jan 29, 2024

Deploy Preview for public-github-stats ready!

Name Link
🔨 Latest commit 08e2254
🔍 Latest deploy log https://app.netlify.com/sites/public-github-stats/deploys/65b8bec83745a900080d4e08
😎 Deploy Preview https://deploy-preview-101--public-github-stats.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@theflucs theflucs changed the title fix stats layout and add tooltips fix: stats layout and add tooltips Jan 29, 2024
Comment on lines 56 to 65
(
{ pullRequest: { state, title, id, url } }: any,
index: number
) => (
<div
key={id}
className={`flex items-center justify-between gap-2 tooltip text-left ${
index === 0 ? "tooltip-bottom" : "tooltip-top"
}`}
data-tip={title}
Copy link
Contributor Author

@theflucs theflucs Jan 29, 2024

Choose a reason for hiding this comment

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

This is a workaround for correctly displaying the tooltips.
I noticed that if it is set to tooltip-top the first item's tooltip doesn't show, as well as if it is set to tooltip-bottom the last one doesn't appear either. Feel free to discard these lines if you know a cleaner way to achieve the correct displaying of the tooltips.

Copy link
Member

Choose a reason for hiding this comment

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

The workaround is fine if you have 2+ PRs, but in case you only have one it won't appear. We need to find a different solution

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ouch, I didn't notice it. And it makes sense it doesn't work. We need to find another way 🤔
@CBID2 you can take over this if you like

<div className="max-h-[22rem] hide-scrollbar overflow-auto flex flex-col gap-1">
{nodes?.map(
(
{ pullRequest: { state, title, id, url } }: any,
Copy link
Member

Choose a reason for hiding this comment

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

We should probably add a better type here than any, I think there's already a type in types/github.ts for that

Copy link
Contributor

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

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

For the most part, it looks good, but I do see some of the long titles not be in-line (see the card that says "Accessible For All" for reference in the screenshot below)
test for tooltip contribution.

Is there a way you can make the tooltip work for all long titled-PRs @theflucs? :) What do you think @Balastrong?

@theflucs
Copy link
Contributor Author

theflucs commented Jan 30, 2024

@CBID2 are you sure your code is aligned with this branch? The PR title shows indeed the 3 dots, if it is too long, and also the contribution icons on the right should be aligned with the PR title pill, they don't look like. The tooltip part I think is fixed for the PR title but not for the contribution title, as mentioned above by @Balastrong. You can have a look at it and see if you come up with a solution. Thanks!

@CBID2
Copy link
Contributor

CBID2 commented Jan 30, 2024

@CBID2 are you sure your code is aligned with this branch? The PR title shows the 3 dots, if too long, and also the contribution icons on the right should be aligned with the PR title pill, they don't look like. The tooltip part I think is fixed for the PR title but not for the contribution title, as mentioned above by @Balastrong. You can have a look at it and see if you come up with a solution

@Balastrong this deployment needs approval again.

@Balastrong
Copy link
Member

@CBID2 the deploy is not working at the moment, it redirects to an old version.

In order to test this branch you should checkout it locally and run the app there :)

Copy link
Member

@Balastrong Balastrong left a comment

Choose a reason for hiding this comment

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

Overall it looks good to me as the scope of the PR was only on PR titles actually, I'd go with merging it so we keep small changes.

@CBID2 thanks for the review! If you find something else that needs to be tweaked feel free to create new issues so we can start from there!

@Balastrong
Copy link
Member

@all-contributors please add @CBID2 for review

Copy link
Contributor

@Balastrong

I've put up a pull request to add @CBID2! 🎉

@Balastrong Balastrong merged commit c0cb404 into DevLeonardoCommunity:main Jan 31, 2024
7 checks passed
@CBID2
Copy link
Contributor

CBID2 commented Jan 31, 2024

@all-contributors please add @CBID2 for review

@Balastrong, you used my name instead of @theflucs. Did you mean to do that?

Copy link
Contributor

@CBID2

@CBID2 already contributed before to review

@Balastrong
Copy link
Member

Yes, I added you for the review :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants