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

[GH-255] Add tooltip for pull request and issue links #258

Merged
merged 14 commits into from
May 19, 2020

Conversation

fedealconada
Copy link
Contributor

@fedealconada fedealconada commented May 5, 2020

Summary

This PR adds a tooltip for pull request and issue links

Ticket Link

Fixes #255

@fedealconada fedealconada requested a review from hanzei as a code owner May 5, 2020 12:06
@hanzei hanzei added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels May 5, 2020
Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

This is AMAZING 🎉 I'm really looking forward to seeing this merged

webapp/src/components/link_tooltip/link_tooltip.jsx Outdated Show resolved Hide resolved
webapp/src/components/link_tooltip/link_tooltip.jsx Outdated Show resolved Hide resolved
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
max-height: 150px;
Copy link
Contributor

Choose a reason for hiding this comment

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

A larger texts gets cut of with this approach. Is there a more elegant way to cut of the text, if it gets to long? E.g. after X words.

Screenshot from 2020-05-05 14-33-30

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well... actually, I gave this a though and decided to do it like that. The thing is, the scrolling is enabled, so you should be able to scroll down there but I have hidden the scrollbar because I thought it was more "elegant" not to show it, but it might seem a bit weird.
Either I could show the scrollbar or I could play around with the 'react-markdown' so it only renders an amount of HTML tags... There are several options in which this could be done... I could also just convert the whole text to one only

with no format and add ellipsis on overflow, i don't know....
I would say that, because of the scope of this issue (which was not actually including the pr/issue description on the tooltip), I would rather decide between keeping it like this or un-hiding the scrollbar. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering how much a scrollbar would be actually used. The tooltip is mostly "for a quick glance" and if a user wants for information, the link to the issue/pr is right there.

@asaadmahmood I would like to hear your toughs on this. Is the current solution acceptable to you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel it could be useful... Even though it's a quick glance, sometimes we get a bit lazy about having to open the link, wait the page to load, etc etc. Imagine that maybe you know there's a useful link inside the description that you know is placed at the bottom of it... just scrolling will help you out... But yeah, up to others opinions :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@hanzei Sorry for replying late guys. I don't think a scrollbar should be needed here, we can just have a max-height or max number or elements, without it cutting off content.

I would also be willing to add a "See more" link above the labels which would just open the PR (similar to the title link) to be very obvious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it currently has a max-height, which cuts the text off and that's why I've added the ability to scroll (just that I've hidden the scrollbar, but you are allowed to scroll) @asaadmahmood I'm not so sure which is the solution you propose.
Regarding the "See more" link, no problem!

server/api.go Show resolved Hide resolved
server/api.go Show resolved Hide resolved
server/api.go Show resolved Hide resolved
@hanzei hanzei linked an issue May 5, 2020 that may be closed by this pull request
@hanzei hanzei added the 1: UX Review Requires review by a UX Designer label May 5, 2020
@hanzei hanzei requested a review from asaadmahmood May 5, 2020 19:36
@hanzei
Copy link
Contributor

hanzei commented May 5, 2020

@asaadmahmood A couple of screenshots:
Screenshot from 2020-05-05 21-43-55
Screenshot from 2020-05-05 21-44-02
Screenshot from 2020-05-05 21-44-11
Screenshot from 2020-05-05 21-44-18
Screenshot from 2020-05-05 21-44-24

Copy link
Contributor

@asaadmahmood asaadmahmood left a comment

Choose a reason for hiding this comment

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

LGTM, apart from that other change.

@hanzei hanzei requested a review from larkox May 12, 2020 12:58
@hanzei hanzei removed the 1: UX Review Requires review by a UX Designer label May 12, 2020
Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

My outstanding concerns are not blocking for this PR can be addressed within #252

@hanzei hanzei added this to the v1.0.0 milestone May 13, 2020
Copy link
Contributor

@larkox larkox left a comment

Choose a reason for hiding this comment

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

Fantastic PR! I am looking forward to see it deployed!
Just one small thing, apart of what has been said by other reviewers.

Copy link
Contributor

@larkox larkox left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@larkox larkox removed the 2: Dev Review Requires review by a core committer label May 13, 2020
@larkox larkox requested a review from DHaussermann May 13, 2020 14:23
@DHaussermann
Copy link

@hanzei i If you have some time, could you please peer-test this PR using the peer testing process documented here: https://mattermost.atlassian.net/wiki/spaces/INT/pages/619937892/Peer+Testing+Process

@codecov-io
Copy link

codecov-io commented May 16, 2020

Codecov Report

Merging #258 into master will decrease coverage by 0.24%.
The diff coverage is 5.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #258      +/-   ##
==========================================
- Coverage   19.69%   19.44%   -0.25%     
==========================================
  Files          10       10              
  Lines        2178     2216      +38     
==========================================
+ Hits          429      431       +2     
- Misses       1725     1761      +36     
  Partials       24       24              
Impacted Files Coverage Δ
server/api.go 6.63% <5.26%> (-0.10%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fcc0ad...0ef70f4. Read the comment docs.

Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

Scope

Tooltips work for open and closed
Tooltips works for open, merged and closed PRs

Testing notes

  • When a user is connected to GitHub, all five tooltip types are shown correctly.
  • When a user is not connected to GitHub, a JS warning will be shown on page load.
    Screenshot from 2020-05-16 08-35-31

@fedealconada Could you please look into this?

Follow-up concerns

None

@fedealconada
Copy link
Contributor Author

@hanzei I've just fixed the warning issue, check the changes.

Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the warning 👍

The CI complains a about these changes:

  4:1   error  There should be at least one empty line between import groups  import/order
 
  5:1   error  There should be at least one empty line between import groups  import/order
 
  8:33  error  'ownProps' is defined but never used                           no-unused-vars
 
  9:12  error  There should be no space after '{'                             object-curly-spacing
 
  9:64  error  There should be no space before '}'                            object-curly-spacing
 
  9:65  error  Missing semicolon                                              semi

Would you please fix these issue? After that the PR should be ready to go.

@asaadmahmood
Copy link
Contributor

@hanzei @fedealconada Not going to go much into the code, but can we have screenshots of how it looks so I can approve/comment on it from a UX perspective?

@fedealconada
Copy link
Contributor Author

@hanzei my bad, I forgot to run the linter. Changes are pushed now :) @asaadmahmood see below the screenshot, the only thing that has changed has been the addition of the "See more" button. Clicking on it opens up a new tab.

image

Hovering over the link looks like this:

image

@asaadmahmood
Copy link
Contributor

@fedealconada Would it not be possible for us to just add an elipsis after x number of characters and then on a new line add See more?
I don't like it cutting the text like that.

@asaadmahmood
Copy link
Contributor

@fedealconada Can we also vertically middle align the arrow here.
Screenshot 2020-05-17 at 7 22 27 PM

@fedealconada
Copy link
Contributor Author

Hey @asaadmahmood, I agree, I don't like the text being cut off. I've been digging a bit into that. What I've managed to do is, instead of adding ellipsis, just hide the elements (check image below).

image

Thoughts?

@asaadmahmood
Copy link
Contributor

@fedealconada This looks good to me, but are we sure that solution would work with different PR descriptions?

@asaadmahmood
Copy link
Contributor

Discussed it with @fedealconada, we're going with the overflow trick for now, and may create an improvement issue later.

Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

Scope

Tooltips work for open and closed
Tooltips works for open, merged and closed PRs

Testing notes

  • When a user is connected to GitHub, all five tooltip types are shown correctly.
  • When a user is not connected to GitHub, no JS warning is shown. Also, no tooltip is shown.

Follow-up concerns

None

Copy link

@DHaussermann DHaussermann left a comment

Choose a reason for hiding this comment

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

Thanks for the testing help on this @hanzei. Just as a precaution, I also took a quick look on desktop in case you had not reviewed it.
No issues found.

Huge thanks @fedealconada for this PR! This is an great UX improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request QA Review Done PR has been approved by QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tooltip for pull request links Compute label foreground colour using WCAG rules
6 participants