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

[JENKINS-62496] Convert arrow pngs to CSS #4757

Merged
merged 5 commits into from
Jun 12, 2020

Conversation

EstherAF
Copy link
Contributor

@EstherAF EstherAF commented May 29, 2020

See JENKINS-62496.

Fixes jenkinsci/dark-theme-plugin#24

Convert arrows used to display contextual menus, from background images to CSS triangles.

Screenshots of the change:

Down arrow

Before:

  • Breadcrumbs:
    Jenkins-down-before
  • Build Execution:
    build-execution-down-before
  • Build Queue:
    build-queue-down-before
  • Jobs:
    job-down-before

After:

  • Breadcrumbs:
    jenkins-down-after
  • Build Execution:
    build-execution-down-after
  • Build Queue:
    build-queue-down-after
  • Jobs:
    job-down-after
Right arrow

Before

  • Breadcrumbs
    breadcrumbs-right-before

  • Submenu
    Screenshot from 2020-06-07 23-26-05

After

  • Breadcrumbs
    breadcrumbs-right-after

  • Submenu
    Screenshot from 2020-06-07 23-30-55

Proposed changelog entries

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change). Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@timja @fqueiruga

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Looks good overall, thanks! I think we need to wait until #4752 is merged and then adds CSS variables for it

#breadcrumbs LI.children:hover {
background-image: url(menu_right_arrow.png);
#breadcrumbs LI.children:hover:after {
border-left-color: #4d545d;
Copy link
Member

Choose a reason for hiding this comment

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

Will need update after #4752 is merged so that we do not hardcode colors

Copy link
Contributor

Choose a reason for hiding this comment

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

And I think the variable should be --text-color.

#menuSelector:after {
/* Down arrow */
content: "";
border-top: 0.30em solid #4d545d;
Copy link
Member

Choose a reason for hiding this comment

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

Needs a variable after #4752

Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

border-bottom: 0;
}
#menuSelector.inverse:after {
border-top-color: #bcbcbc;
Copy link
Member

Choose a reason for hiding this comment

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

Needs a variable after #4752

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

Copy link
Member

@timja timja 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 played around with this with variables and I got it working, I'll send a PR here once the variables PR is merged,

All icons that I found except for one are working (the Manage Jenkins sub menu):

image

This appears to be the CSS

background: url(menubaritem_submenuindicator.png) right center no-repeat;

Although I would suggest overriding it in the yui-compatibility less file: https://github.com/jenkinsci/jenkins/blob/49e501f37db848e69de31607a43df79bab4e77b0/war/src/main/less/base/yui-compatibility.less

@timja
Copy link
Member

timja commented May 31, 2020

@EstherAF PR for the dark mode changes on the breadcrumbs: EstherAF#9

@EstherAF
Copy link
Contributor Author

EstherAF commented Jun 1, 2020

All icons that I found except for one are working (the Manage Jenkins sub menu):

I'm looking at it. Do you know where the class yuimenubaritem-hassubmenu is being used? I've only found usages of the yuimenuitem-hassubmenu.

@timja
Copy link
Member

timja commented Jun 1, 2020

hassubmenu

can't see it, took me quite awhile to even find the css and selector that was causing the above issue

@varyvol
Copy link

varyvol commented Jun 4, 2020

@EstherAF it seems like the new arrows have a lighter dark than they previously had? I'm not against it, I just want to check it's something we've noticed and are fine with it.

Other than that, it looks good!

@EstherAF
Copy link
Contributor Author

EstherAF commented Jun 4, 2020

@EstherAF it seems like the new arrows have a lighter dark than they previously had? I'm not against it, I just want to check it's something we've noticed and are fine with it.

Yes! It is because now they are using the same color than the text, with the css variable. Before they were using just black (IIRC).

What do you think? I prefer this so the color palette used is simpler, and it is more integrated with the text of the link.

@varyvol
Copy link

varyvol commented Jun 5, 2020

@EstherAF it makes sense to me and I agree. As I said, I just wanted to note it just in case.

@timja timja added the web-ui The PR includes WebUI changes which may need special expertise label Jun 7, 2020
@EstherAF
Copy link
Contributor Author

EstherAF commented Jun 7, 2020

All icons that I found except for one are working (the Manage Jenkins sub menu)

@timja I've just pushed a fix for that.

I've faced a little problem here that I don't know how to solve it. The arrow with CSS is generated as another element inside the menu item, as a sibling of the menu link (the text). This is causing that the menu link is not 100% wide anymore, and when focused the borders are displayed and you can see that the size is different.
Here it is more clear, look at the red border:

Before
Screenshot from 2020-06-07 23-26-05
After. There is a space at the right of the red border.
Screenshot from 2020-06-07 23-30-55

It only happens when the menu item has the arrow at the right (when it has a submenu). In the other items, the border on focus remains like before.

I don't know if this is a big deal, WDYT?

Copy link
Member

@timja timja 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 tried it out and wasn't able to come up with anything better,

thanks!

@timja timja requested a review from fqueiruga June 8, 2020 07:14
@timja timja added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Jun 8, 2020
Copy link
Contributor

@fqueiruga fqueiruga 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 suggested some changes that should fix the issue with the dropdown menu. Please test them locally befor committing :D

war/src/main/less/base/yui-compatibility.less Outdated Show resolved Hide resolved
war/src/main/less/base/yui-compatibility.less Outdated Show resolved Hide resolved
Co-authored-by: Félix Queiruga <felix.queiruga@gmail.com>
@EstherAF
Copy link
Contributor Author

EstherAF commented Jun 10, 2020

I've suggested some changes that should fix the issue with the dropdown menu. Please test them locally befor committing :D

Thanks @fqueiruga. It works perfectly!

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

Tested, works great!

@timja timja added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Jun 11, 2020
@timja
Copy link
Member

timja commented Jun 11, 2020

Thanks for the PR!

This PR is now ready-for-merge, we will merge it after ~24 hours if there's no negative feedback

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Looks good, all comments are addressed. Thanks @EstherAF !

@timja timja merged commit 2466805 into jenkinsci:master Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JENKINS-62496] - Arrow icons don't work well
5 participants