jenkins icon indicating copy to clipboard operation
jenkins copied to clipboard

Update appearance of keyboard shortcut tooltips

Open janfaracik opened this issue 1 year ago • 13 comments

Small one in preparation for #7569. This PR adds a new component for showing keyboard shortcuts, it's currently used in the tooltip for search bars.

https://github.com/jenkinsci/jenkins/assets/43062514/24515d14-b996-4dda-8b9a-4cd27b798b55

This will be used for the Command Palette button too, where hovering over the Search icon will list what shortcuts activate it.

Testing done

  • Shortcut and animation display as expected

Proposed changelog entries

  • N/A

Proposed upgrade guidelines

N/A

### Submitter checklist
- [ ] The Jira issue, if it exists, is well-described.
- [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [ ] There is automated testing or an explanation as to why this change has no tests.
- [ ] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [ ] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [ ] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)).
- [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@jenkinsci/sig-ux

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

### Maintainer checklist
- [ ] There are at least two (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 is not blocking the change.
- [ ] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically.
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](https://github.com/jenkinsci/jenkins/pull/4387)).
- [ ] 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](https://issues.jenkins.io/issues/?filter=12146)).

janfaracik avatar Aug 25 '23 20:08 janfaracik

/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!

timja avatar Aug 29 '23 07:08 timja

Subjective design feedback: The animation doesn't look good at the actual size. I first thought it was a bug, in particular on the default (non-dark) theme.

https://github.com/jenkinsci/jenkins/assets/1831569/9eadace4-adf3-4040-95f4-56ad5dac0dd8

daniel-beck avatar Aug 29 '23 12:08 daniel-beck

Still doesn't work for me. Screenshot 2023-12-06 at 14 49 09 (The build claims to be 2.434-SNAPSHOT so I'm not running the old one.)

Did you test this before resubmitting for review? If you did, what does the localized file look like?

Works fine for me, there's a prefix and a suffix you need to update, I just fixed up a localisation (e.g. pl) as an example.

image

timja avatar Dec 16 '23 21:12 timja

Works fine for me, there's a prefix and a suffix you need to update, I just fixed up a localisation (e.g. pl) as an example.

The point is that it needs to be possible to have one of the values be empty (since the approach of two sentence fragments, rather than one sentence with placeholder, is used here). The part after "Press" is a complete sentence is German, starting with the key combination. Think of it as the equivalent of

{0} drücken um zu fokussieren

Specifying Press= doesn't work.

daniel-beck avatar Dec 18 '23 17:12 daniel-beck

What about https://github.com/jenkinsci/jenkins/pull/8435/commits/5551fc91f2ec11e3115249223f79b3b0d2bd8526 @daniel-beck?

timja avatar Apr 03 '24 13:04 timja

Seems like a weird hack we should try not to do.

Best I could come up with myself is https://github.com/jenkinsci/jenkins/commit/4bd312d599a3127a536f0550f542ca284ffc3bae and that is only marginally better, as it requires escaping the placeholder (and requires leaving out the <span>s, but at least those seem to exist for no real reason).

daniel-beck avatar Apr 20 '24 22:04 daniel-beck

Looks like

Press=' '

would do it, by forcing a single space character. That seems cleaner than either of the above, except it would still produce an almost empty <span> unless specifically handled.

daniel-beck avatar Apr 22 '24 09:04 daniel-beck

@daniel-beck I like your single string approach, you happy with this?

timja avatar May 21 '24 14:05 timja

@daniel-beck you able to check this please?

timja avatar May 28 '24 07:05 timja

@daniel-beck @timja Updated this - big thanks to both of you for the comments and assistance.

janfaracik avatar Aug 04 '24 14:08 janfaracik