-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Replace YUI tooltips with Tippy.js #6408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
HTML doesn't seem to be handled properly here. I'm not sure if this is a special occasion, because the tooltip is provided as translation string in a .properties file, where
<br>
is not escaped at all:
-
Tooltips are shown twice on this maven project if it's still building
-
The history widget displays an empty tooltip if the job didn't complete yet to show the overall time it took:
This brings several advantages:
Also worth to note that YUI 3 is abandoned since 2014.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This is a follow up to my previous comment regarding
HTML doesn't seem to be handled properly here. I'm not sure if this is a special occasion, because the tooltip is provided as translation string in a .properties file, where
is not escaped at all:
If no agent is available, tooltips are stacked for every attempt to trigger a build:
Though even if they're split into separate lines, it looks odd to have +1 message for every attempt, considering you don't enqueue several builds in that way, but that may be a different issue.
- Pipeline steps' tooltips are no longer attached to the step
For reference, that overview is generated by the workflow-support-plugin.
- I'm not sure if this is intended, but the warnings-ng plugin overview in columns does now unfold into the column itself stretching it a lot, rather than floating around somewhere near the actual issue # it introduces.
Can be dismissed, the same behavior can be seen by other objects if they are in the last table column.
57e3a7e771072328ff86e4d8d93e9a52.mp4
But thanks so far for addressing the initial concerns 👏🏻 unfortunately a few tests are failing
Wait, why do we care? We're on 2.x 😎 |
IMO we should consider making all tooltips plain text if we can get away with it. They've been a common source of XSS issues in the past. Of course, some minimal formatting ability may need to remain, like newlines. CC @Wadeck |
From 2011 by the looks of it not that I can find the source of the latest upgrade, 2.9.0 doesn't seem to be in the repo |
Looking at the code only You can opt-in to html processing with html-tooltip. |
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the tooltips on the dashboard now work correctly. But for the summary views it is broken now. New tooltips are not right at the corresponding element. And the existing tooltips lost their background. I need to check if this is due to changes to make my warnings plugin backward compatible with different core versions.
Bildschirmaufnahme.2022-11-22.um.10.48.32.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will merge jenkinsci/font-awesome-api-plugin#186 right now and release a new plugin version. Then the tooltips will look good with Popper as well.
The other problem with the tooltips shown somewhere off the element hopefully can be fixed by moving the tooltip to a different element.
As a feature request (not in this PR): it should be possible to define the Popper placement
value as an attribute somehow.
Please create an issue in Jira, so that we can track this. |
We are experiencing the same issues with loading time. |
An improved has been submitted in #7464, which will be delivered in the next Tuesday's release and be backported into the next LTS release, 2.375.2 |
Problem was only visible in weekly, not in LTS. I don't think that a backport will be needed |
I've been misguided by the Jira issue being labeled as LTS candidate. This PR is only present in 2.380, there's no need to backport that, indeed 👍🏻 |
Caused |
Good news: this fixed JENKINS-70369! |
|
||
svg { | ||
vertical-align: middle; | ||
width: 0.8rem; | ||
height: 0.8rem; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular, this is the hunk that fixes JENKINS-70369. Could possibly be backported to stable-2.375
if desired, but likely not worth the effort for such a minor issue.
Caused JENKINS-71880. (Also, FTR, caused the resolved JENKINS-70178). |
Caused JENKINS-72744 |
Object jsResult = innerHtmlScript.getJavaScriptResult(); | ||
assertThat(jsResult, instanceOf(String.class)); | ||
String jsResultString = (String) jsResult; | ||
|
||
// assert leading space to identify unintentional double-escaping (&lt;) as test failure | ||
assertThat("tooltip does not contain dangerous HTML", jsResultString, not(containsString(" <img src=x"))); | ||
assertThat("tooltip contains safe text", jsResultString, containsString(" <img src=x")); | ||
assertThat("tooltip contains safe text", jsResultString, containsString("lt;img src=x")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caused JENKINS-73907 which the inclusion of &
in the assertion explicitly existed to prevent, see comment two lines up.
This is the first of two PRs which intend to replace the existing YUI implementation of tooltips and menus with Tippy.js. This PR focuses solely on tooltips and brings native support for Tippy.js to Jenkins.
tippy.tooltips.mov
This brings several advantages:
This implementation intends to maintain 100% backwards compatibility with the existing implementation of tooltips, it also introduces a new way to host HTML content in tooltips which is used for the project status tooltip using
html-tooltip=" ... "
This change is documented in the updated Jenkins Design Library plugin.
For plugin developers
tooltip="hello world"
ordata-html-tooltip="<p>hello world</p>"
)Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgrade@Restricted
or have@since TODO
Javadoc, as appropriate.Desired reviewers
@mention
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are accurate, human-readable, and in the imperative moodupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).