From 0d8e1a2eca754f5025d7fc3c91df745a8d997178 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Wed, 23 Aug 2023 21:35:06 +0100 Subject: [PATCH 01/12] Init --- core/src/main/java/hudson/Functions.java | 12 ++++ .../lib/layout/keyboard-shortcut.jelly | 56 +++++++++++++++++ .../resources/lib/layout/search-bar.jelly | 7 ++- war/src/main/scss/components/_tooltips.scss | 60 +++++++++++++++++++ 4 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 core/src/main/resources/lib/layout/keyboard-shortcut.jelly diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 7f3411406780..8e6ac5683c48 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2455,4 +2455,16 @@ static String guessIcon(String iconGuess, String rootURL) { public static String generateItemId() { return String.valueOf(Math.floor(Math.random() * 3000)); } + + @Restricted(NoExternalUse.class) + public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { + StaplerRequest currentRequest = Stapler.getCurrentRequest(); + currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); + String userAgent = currentRequest.getHeader("User-Agent"); + + List platformsThatUseCommand = List.of("MAC", "IPHONE", "IPAD"); + boolean useCmdKey = platformsThatUseCommand.stream().anyMatch(e -> userAgent.toUpperCase().contains(e)); + + return keyboardShortcut.replace("CMD", useCmdKey ? "⌘" : "CTRL"); + } } diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly new file mode 100644 index 000000000000..92bbf4a59470 --- /dev/null +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -0,0 +1,56 @@ + + + + + + + Optional prefix to the shortcut + + + Optional suffix to the shortcut + + Displays a keyboard shortcut chip based on the component's body. + CMD/CTRL will automatically be translated to the user's operating system's appropriate variant. + + +
+ + + ${attrs.prefix} + + +
+ + + + +
+ + + ${attrs.suffix} + + +
+
diff --git a/core/src/main/resources/lib/layout/search-bar.jelly b/core/src/main/resources/lib/layout/search-bar.jelly index b86a15fef0d6..8dbe681fef93 100644 --- a/core/src/main/resources/lib/layout/search-bar.jelly +++ b/core/src/main/resources/lib/layout/search-bar.jelly @@ -58,7 +58,12 @@ THE SOFTWARE. spellcheck="false" disabled="${attrs.enabled == false ? true : null}" /> -
+ + + + + +
diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 80a030b8c9c3..566093bb98fd 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -51,3 +51,63 @@ .jenkins-table .healthReportDetails { display: none !important; } + +.jenkins-tooltip__keyboard-shortcut { + display: flex; + align-items: center; + justify-content: center; + gap: 0.6ch; + + &__symbol { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 1.7em; + height: 1.7em; + padding-inline: 0.5ch; + + &::before, + &::after { + content: ""; + position: absolute; + inset: 0; + border-radius: 0.375rem; + border: 0.1rem solid var(--text-color-secondary); + opacity: 0.3; + } + + &::after { + mask-image: linear-gradient( + -45deg, + transparent 40%, + white, + transparent 60% + ); + mask-size: 200% 200%; + mask-position: center; + animation: shortcut-glow-animation 1.25s forwards linear; + } + + svg { + width: 1em; + height: 1em; + } + + @keyframes shortcut-glow-animation { + 0% { + opacity: 0; + mask-position: 100% 100%; + } + + 50% { + opacity: 1; + } + + 100% { + opacity: 0; + mask-position: 0; + } + } + } +} From 1783029921aa722b37fd59f58e027fd84fc0ec09 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Fri, 25 Aug 2023 22:03:11 +0100 Subject: [PATCH 02/12] yarn lint:fix --- war/src/main/scss/components/_tooltips.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 566093bb98fd..972db7310a36 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -79,10 +79,10 @@ &::after { mask-image: linear-gradient( - -45deg, - transparent 40%, - white, - transparent 60% + -45deg, + transparent 40%, + white, + transparent 60% ); mask-size: 200% 200%; mask-position: center; From 3996dc06fb0238b4eee2d71d8f67a8f10b320067 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 20 Nov 2023 15:26:36 +0000 Subject: [PATCH 03/12] Address comments --- core/src/main/java/hudson/Functions.java | 4 ++++ core/src/main/resources/lib/layout/keyboard-shortcut.jelly | 6 +++--- war/src/main/scss/components/_tooltips.scss | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index c12d1846181e..86d9e9c55d29 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2475,6 +2475,10 @@ public static String generateItemId() { return String.valueOf(Math.floor(Math.random() * 3000)); } + /** + * @param keyboardShortcut the shortcut to be translated + * @return the translated shortcut, e.g. CMD+K -> ⌘+K for macOS, CTRL+K for Windows + */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { StaplerRequest currentRequest = Stapler.getCurrentRequest(); diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 92bbf4a59470..56dfa40c128e 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -32,11 +32,11 @@ THE SOFTWARE. Optional suffix to the shortcut Displays a keyboard shortcut chip based on the component's body. - CMD/CTRL will automatically be translated to the user's operating system's appropriate variant. + CMD will automatically be translated to the user's operating system's appropriate variant.
- + ${attrs.prefix} @@ -47,7 +47,7 @@ THE SOFTWARE.
- + ${attrs.suffix} diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 972db7310a36..6743f6c88180 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -85,7 +85,6 @@ transparent 60% ); mask-size: 200% 200%; - mask-position: center; animation: shortcut-glow-animation 1.25s forwards linear; } From 8c2ef1a2aafd7f258128e503c3323253ce65b659 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Sat, 16 Dec 2023 21:48:24 +0000 Subject: [PATCH 04/12] Update localisation --- core/src/main/resources/lib/layout/search-bar_pl.properties | 3 ++- core/src/main/resources/lib/layout/search-bar_pt_BR.properties | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/lib/layout/search-bar_pl.properties b/core/src/main/resources/lib/layout/search-bar_pl.properties index 1404a046d112..981d1139e20b 100644 --- a/core/src/main/resources/lib/layout/search-bar_pl.properties +++ b/core/src/main/resources/lib/layout/search-bar_pl.properties @@ -20,4 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Press\ /\ on\ your\ keyboard\ to\ focus=Naciśnij / na klawiaturze, aby przesunąć tutaj kursor +Press=Naciśnij +on\ your\ keyboard\ to\ focus=na klawiaturze, aby przesunąć tutaj kursor diff --git a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties index b676df91ce65..3f18e2c77e31 100644 --- a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties +++ b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties @@ -21,4 +21,5 @@ # THE SOFTWARE. Search=Busca -Press\ /\ on\ your\ keyboard\ to\ focus=Digite /\ no seu teclado para realçar +Press=Digite +on\ your\ keyboard\ to\ focus=no seu teclado para realçar From ce09ad88d41086e7ebaed94c7397ac9aa669e695 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Sun, 17 Dec 2023 08:07:48 +0000 Subject: [PATCH 05/12] Update core/src/main/java/hudson/Functions.java --- core/src/main/java/hudson/Functions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index b22f32c2a8d7..a923ada89c9e 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2481,7 +2481,7 @@ public static String generateItemId() { /** * @param keyboardShortcut the shortcut to be translated - * @return the translated shortcut, e.g. CMD+K -> ⌘+K for macOS, CTRL+K for Windows + * @return the translated shortcut, e.g. CMD+K to ⌘+K for macOS, CTRL+K for Windows */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { From 5551fc91f2ec11e3115249223f79b3b0d2bd8526 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Wed, 3 Apr 2024 14:36:29 +0100 Subject: [PATCH 06/12] Allow setting empty prefix or suffix --- core/src/main/resources/lib/layout/keyboard-shortcut.jelly | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 56dfa40c128e..4445b3d188bb 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -36,7 +36,7 @@ THE SOFTWARE.
- + ${attrs.prefix} @@ -47,7 +47,7 @@ THE SOFTWARE.
- + ${attrs.suffix} From f925849ca72c2bdb34497cbed87d9ac05088ce9d Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 21 Apr 2024 00:08:51 +0200 Subject: [PATCH 07/12] Combine into one format string with escaped format placeholder --- core/src/main/java/hudson/Functions.java | 6 +++++ .../lib/layout/keyboard-shortcut.jelly | 27 +++++-------------- .../resources/lib/layout/search-bar.jelly | 2 +- .../lib/layout/search-bar_pl.properties | 3 +-- .../lib/layout/search-bar_pt_BR.properties | 3 +-- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index f4bd61351e97..b02bd2b54695 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -117,6 +117,7 @@ import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.DecimalFormat; +import java.text.MessageFormat; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -2505,4 +2506,9 @@ public static String translateModifierKeysForUsersPlatform(String keyboardShortc return keyboardShortcut.replace("CMD", useCmdKey ? "⌘" : "CTRL"); } + + @Restricted(NoExternalUse.class) + public static String formatMessage(String format, Object args) { + return MessageFormat.format(format, args); + } } diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 4445b3d188bb..bd41355559ad 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -25,32 +25,19 @@ THE SOFTWARE. - - Optional prefix to the shortcut - - - Optional suffix to the shortcut + + Optional message for the shortcut Displays a keyboard shortcut chip based on the component's body. CMD will automatically be translated to the user's operating system's appropriate variant.
- - - ${attrs.prefix} - - -
- + +
- - -
- - - ${attrs.suffix} - - +
+ +
diff --git a/core/src/main/resources/lib/layout/search-bar.jelly b/core/src/main/resources/lib/layout/search-bar.jelly index 8dbe681fef93..1e77c2be8a21 100644 --- a/core/src/main/resources/lib/layout/search-bar.jelly +++ b/core/src/main/resources/lib/layout/search-bar.jelly @@ -59,7 +59,7 @@ THE SOFTWARE. disabled="${attrs.enabled == false ? true : null}" /> - + diff --git a/core/src/main/resources/lib/layout/search-bar_pl.properties b/core/src/main/resources/lib/layout/search-bar_pl.properties index 981d1139e20b..b9de372589b4 100644 --- a/core/src/main/resources/lib/layout/search-bar_pl.properties +++ b/core/src/main/resources/lib/layout/search-bar_pl.properties @@ -20,5 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Press=Naciśnij -on\ your\ keyboard\ to\ focus=na klawiaturze, aby przesunąć tutaj kursor +shortcut=Naciśnij '{0}' na klawiaturze, aby przesunąć tutaj kursor diff --git a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties index 3f18e2c77e31..3d3b237a71f2 100644 --- a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties +++ b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties @@ -21,5 +21,4 @@ # THE SOFTWARE. Search=Busca -Press=Digite -on\ your\ keyboard\ to\ focus=no seu teclado para realçar +shortcut=Digite '{0}' no seu teclado para realçar From b0d87b9ada3710aa35ce6bf3a90c7e88af15080c Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Wed, 29 May 2024 21:29:14 +0100 Subject: [PATCH 08/12] Add english default message --- .../lib/layout/search-bar.properties | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 core/src/main/resources/lib/layout/search-bar.properties diff --git a/core/src/main/resources/lib/layout/search-bar.properties b/core/src/main/resources/lib/layout/search-bar.properties new file mode 100644 index 000000000000..5a17184bb037 --- /dev/null +++ b/core/src/main/resources/lib/layout/search-bar.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2023, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +shortcut=Press '{0}' on your keyboard to focus From 02a8466f6bd0861a3a11cca8362ccd413e536f51 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 3 Jun 2024 16:22:25 +0100 Subject: [PATCH 09/12] More detailed wording for message attribute --- core/src/main/resources/lib/layout/keyboard-shortcut.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index bd41355559ad..209ffabcf993 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -26,7 +26,7 @@ THE SOFTWARE. - Optional message for the shortcut + Tooltip message for the shortcut. Use the placeholder {0} escaped (wrapped in '). A minimal message consisting of only the shortcut would be '{0}'. Displays a keyboard shortcut chip based on the component's body. CMD will automatically be translated to the user's operating system's appropriate variant. From 08c24de7f4552bf1ed25c875b5251b50a24bbb4b Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 4 Aug 2024 15:53:50 +0100 Subject: [PATCH 10/12] Update keyboard shortcut component --- .../lib/layout/keyboard-shortcut.jelly | 49 +++++++-- .../resources/lib/layout/search-bar.jelly | 9 +- war/src/main/scss/components/_tooltips.scss | 100 ++++++++++-------- war/src/main/scss/form/_search-bar.scss | 43 +++----- 4 files changed, 105 insertions(+), 96 deletions(-) diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 209ffabcf993..0e9ebf9395ab 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -23,21 +23,48 @@ THE SOFTWARE. --> - + + + The shortcut to display + + CMD will automatically be translated to the user's operating system's appropriate variant + + This attribute also supports Jenkins Symbols, values prefixed with 'symbol-' will be displayed as expected + - Tooltip message for the shortcut. Use the placeholder {0} escaped (wrapped in '). A minimal message consisting of only the shortcut would be '{0}'. + Optional tooltip message for the shortcut. Use the placeholder {0} escaped (wrapped in '). A minimal message consisting of + only the shortcut would be '{0}' - Displays a keyboard shortcut chip based on the component's body. - CMD will automatically be translated to the user's operating system's appropriate variant. + Displays a keyboard shortcut chip -
- -
- -
-
- + +
+ +
+ + + + + + ${attrs.shortcut} + + +
+
+ +
+
+ +
+ + + + + + ${h.translateModifierKeysForUsersPlatform(attrs.shortcut)} + +
diff --git a/core/src/main/resources/lib/layout/search-bar.jelly b/core/src/main/resources/lib/layout/search-bar.jelly index 3998c8c3634c..2d67a3512f7f 100644 --- a/core/src/main/resources/lib/layout/search-bar.jelly +++ b/core/src/main/resources/lib/layout/search-bar.jelly @@ -58,14 +58,7 @@ THE SOFTWARE. spellcheck="false" disabled="${attrs.enabled == false ? true : null}" /> - - - - - -
- -
+
diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 9cec0576d88e..a88e40bedc3d 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -29,45 +29,8 @@ margin: 0; width: 450px; } -} - -.tippy-box[data-animation="tooltip"][data-state="hidden"] { - opacity: 0; - transform: scale(0.995); - &[data-placement^="top"] { - transform-origin: bottom; - transform: translateY(2px) scale(0.995); - } - - &[data-placement^="bottom"] { - transform-origin: top; - transform: translateY(-2px) scale(0.995); - } -} - -// Workaround for NG Warnings which supports modern Tippy tooltips and a custom solution, -// hide the custom solution -.jenkins-table .healthReportDetails { - display: none !important; -} - -.jenkins-tooltip__keyboard-shortcut { - display: flex; - align-items: center; - justify-content: center; - gap: 0.6ch; - - &__symbol { - position: relative; - display: inline-flex; - align-items: center; - justify-content: center; - min-width: 1.7em; - height: 1.7em; - padding-inline: 0.5ch; - - &::before, + .jenkins-keyboard-shortcut { &::after { content: ""; position: absolute; @@ -75,9 +38,6 @@ border-radius: 0.375rem; border: 0.1rem solid var(--text-color-secondary); opacity: 0.3; - } - - &::after { mask-image: linear-gradient( -45deg, transparent 40%, @@ -88,11 +48,6 @@ animation: shortcut-glow-animation 1.25s forwards linear; } - svg { - width: 1em; - height: 1em; - } - @keyframes shortcut-glow-animation { 0% { opacity: 0; @@ -110,3 +65,56 @@ } } } + +.tippy-box[data-animation="tooltip"][data-state="hidden"] { + opacity: 0; + transform: scale(0.995); + + &[data-placement^="top"] { + transform-origin: bottom; + transform: translateY(2px) scale(0.995); + } + + &[data-placement^="bottom"] { + transform-origin: top; + transform: translateY(-2px) scale(0.995); + } +} + +// Workaround for NG Warnings which supports modern Tippy tooltips and a custom solution, +// hide the custom solution +.jenkins-table .healthReportDetails { + display: none !important; +} + +.jenkins-keyboard-shortcut { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 1.7em; + min-height: 1.7em; + padding-inline: 0.55ch; + + &::before { + content: ""; + position: absolute; + inset: 0; + border-radius: 0.375rem; + border: 0.1rem solid var(--text-color-secondary); + opacity: 0.3; + } + + svg { + width: 1em; + height: 1em; + } +} + +.jenkins-keyboard-shortcut__tooltip { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.6ch; +} diff --git a/war/src/main/scss/form/_search-bar.scss b/war/src/main/scss/form/_search-bar.scss index ed552e85c987..1cff381003ed 100644 --- a/war/src/main/scss/form/_search-bar.scss +++ b/war/src/main/scss/form/_search-bar.scss @@ -130,37 +130,14 @@ } } - &__shortcut { + .jenkins-keyboard-shortcut { position: absolute; - aspect-ratio: 1 / 1; - top: 0; - right: 0; - bottom: 0; - display: flex; - align-items: center; - justify-content: center; - transition: 0.25s ease; - text-align: center; - font-size: 0.6875rem; - font-weight: 500; - line-height: 1; + top: calc(50% - 0.6875rem); + right: 0.5rem; + min-width: 1.375rem; + min-height: 1.375rem; + padding: 0; color: var(--text-color-secondary); - - &::after { - content: ""; - position: absolute; - top: calc(50% - 1em); - right: calc(50% - 1em); - width: 2em; - height: 2em; - border: 0.1rem solid var(--item-background--active); - border-radius: 0.3rem; - } - - svg { - width: 1.2em; - height: 1.2em; - } } &--loading { @@ -190,6 +167,10 @@ max-width: 50vw; margin-block: -6px; + .jenkins-keyboard-shortcut { + right: 0.8125rem; + } + &::before { content: ""; position: absolute; @@ -210,7 +191,7 @@ fill: var(--focus-input-border); } - .jenkins-search__shortcut { + .jenkins-keyboard-shortcut { opacity: 0; transform: scale(0.9); pointer-events: none; @@ -221,7 +202,7 @@ color: var(--text-color-secondary); opacity: 0.5; - .jenkins-search__shortcut { + .jenkins-keyboard-shortcut { display: none; } } From f3913dd62c28ae7eebb193a33da5371f7e2a6aec Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:15:02 +0100 Subject: [PATCH 11/12] Update core/src/main/java/hudson/Functions.java --- core/src/main/java/hudson/Functions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 0fb0267a4850..7ed2ddbc96a4 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2584,7 +2584,7 @@ public static String generateItemId() { */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { - StaplerRequest currentRequest = Stapler.getCurrentRequest(); + StaplerRequest2 currentRequest = Stapler.getCurrentRequest(); currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); String userAgent = currentRequest.getHeader("User-Agent"); From b89371727b3ca4a9db15a3e741687c6c33f9b752 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 16 Sep 2024 15:00:33 +0100 Subject: [PATCH 12/12] Adapt for Java EE upgrade --- core/src/main/java/hudson/Functions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 7ed2ddbc96a4..64add7b35193 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2584,8 +2584,8 @@ public static String generateItemId() { */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { - StaplerRequest2 currentRequest = Stapler.getCurrentRequest(); - currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); + StaplerRequest2 currentRequest = Stapler.getCurrentRequest2(); + currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse2()); String userAgent = currentRequest.getHeader("User-Agent"); List platformsThatUseCommand = List.of("MAC", "IPHONE", "IPAD");