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-68986] Remove link element from breadcrumb items without href #6837
Conversation
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
I thought my approval was premature and I had discovered a problem, but that was incorrect. |
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
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.
Works for the manual ones at least.
There's a number of other ones that could have their links removed, like the CLI (e.g. /manage/cli/)
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
I just re-ran the PR build and the "Jenkins CLI" crumb works. Every automatic crumb has a URL (by convention, |
correct this has no change over the previous behaviour, just something I noticed.
What I mean is you can click the CLI crumb currently, in this PR it removes the link state etc around the crumbs for the ones without links. There's no reason to have a link on the active crumb so that could be removed (and likely should be emphasized to make it look different as the active crumb too). |
Not for me. Could you provide screenshots of what specifically you're referring to? |
<j:choose> | ||
<j:when test="${attrs.href == null}"> | ||
${attrs.title} | ||
</j:when> | ||
<j:otherwise> | ||
<a href="${attrs.href}" class="${attrs.hasMenu ? 'model-link' : ''}"> | ||
${attrs.title} | ||
</a> | ||
</j:otherwise> | ||
</j:choose> |
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.
If we wanted to remove the link for the current page, we could do something like -
<j:choose>
<j:set var="isCurrent" value="${h.hyperlinkMatchesCurrentPage(attrs.href)}" />
<j:when test="${attrs.href == null or isCurrent}">
${attrs.title}
</j:when>
<j:otherwise>
<a href="${attrs.href}" class="${attrs.hasMenu ? 'model-link' : ''}">
${attrs.title}
</a>
</j:otherwise>
</j:choose>
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 think that would make sense for consistency. (also I think it would be good to show the difference between non linked breadcrumbs and linked ones maybe an underline)
@timja I see, I misunderstood your comment to mean this PR already changes things, when it doesn't, but could. Better off in a separate PR, but probably useful. FWIW |
See JENKINS-68986.
Fairly straightforward PR to remove link elements from breadcrumb items without href set, as seen in 68986 - thanks @daniel-beck.
To make the breadcrumb bar experience more consistent, I've removed the custom breadcrumb implementation from lines 45 - 57 in favour of using the
breadcrumb.jelly
component. This means that we only have to include logic/customisation in one place. If anyone has any issues with this implementation/finds bugs do let me know.Before - notice the hover state
After - notice the lack of hover state/inability to click the breadcrumb item
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.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
if applicable.Desired reviewers
@jenkinsci/sig-ux @daniel-beck
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).