From 46a9e5681a98d86914123c50cec31ea6d3d01d0c Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:28:15 +0000 Subject: [PATCH] Tidy --- .../main/java/jenkins/search/SearchGroup.java | 20 +++++++++----- .../jenkins/search/Messages.properties | 27 +++++++++++++++++++ src/main/scss/abstracts/_theme.scss | 8 +++--- .../scss/components/_command-palette.scss | 15 +++++++---- 4 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 core/src/main/resources/jenkins/search/Messages.properties diff --git a/core/src/main/java/jenkins/search/SearchGroup.java b/core/src/main/java/jenkins/search/SearchGroup.java index 203defaba653..2871396af6c8 100644 --- a/core/src/main/java/jenkins/search/SearchGroup.java +++ b/core/src/main/java/jenkins/search/SearchGroup.java @@ -6,6 +6,12 @@ import hudson.ExtensionPoint; import hudson.model.ModelObject; +import static jenkins.search.Messages.SearchGroup_ComputerSearchGroup_DisplayName; +import static jenkins.search.Messages.SearchGroup_JobSearchGroup_DisplayName; +import static jenkins.search.Messages.SearchGroup_UnclassifiedSearchGroup_DisplayName; +import static jenkins.search.Messages.SearchGroup_UserSearchGroup_DisplayName; +import static jenkins.search.Messages.SearchGroup_ViewSearchGroup_DisplayName; + public interface SearchGroup extends ExtensionPoint, ModelObject { static ExtensionList all() { @@ -20,21 +26,21 @@ static ExtensionList all() { return category; } - @Extension + @Extension(ordinal = -1) class UnclassifiedSearchGroup implements SearchGroup { @Override public String getDisplayName() { - return "Other"; + return SearchGroup_UnclassifiedSearchGroup_DisplayName(); } } - @Extension + @Extension(ordinal = 999) class JobSearchGroup implements SearchGroup { @Override public String getDisplayName() { - return "Projects"; + return SearchGroup_JobSearchGroup_DisplayName(); } } @@ -43,7 +49,7 @@ class ComputerSearchGroup implements SearchGroup { @Override public String getDisplayName() { - return "Computers"; + return SearchGroup_ComputerSearchGroup_DisplayName(); } } @@ -52,7 +58,7 @@ class ViewSearchGroup implements SearchGroup { @Override public String getDisplayName() { - return "Views"; + return SearchGroup_ViewSearchGroup_DisplayName(); } } @@ -61,7 +67,7 @@ class UserSearchGroup implements SearchGroup { @Override public String getDisplayName() { - return "Users"; + return SearchGroup_UserSearchGroup_DisplayName(); } } } diff --git a/core/src/main/resources/jenkins/search/Messages.properties b/core/src/main/resources/jenkins/search/Messages.properties new file mode 100644 index 000000000000..26523266ce4a --- /dev/null +++ b/core/src/main/resources/jenkins/search/Messages.properties @@ -0,0 +1,27 @@ +# The MIT License +# +# Copyright (c) 2025 Jan Faracik +# +# 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. + +SearchGroup.UnclassifiedSearchGroup.DisplayName=Other +SearchGroup.JobSearchGroup.DisplayName=Projects +SearchGroup.ComputerSearchGroup.DisplayName=Nodes +SearchGroup.ViewSearchGroup.DisplayName=Views +SearchGroup.UserSearchGroup.DisplayName=Users diff --git a/src/main/scss/abstracts/_theme.scss b/src/main/scss/abstracts/_theme.scss index 275263885086..daba530f8c38 100644 --- a/src/main/scss/abstracts/_theme.scss +++ b/src/main/scss/abstracts/_theme.scss @@ -196,15 +196,15 @@ $semantics: ( --link-font-weight: var(--font-bold-weight); // Command Palette - --command-palette-results-backdrop-filter: contrast(0.7) brightness(1.5) - saturate(1.4) blur(20px); + --command-palette-results-backdrop-filter: saturate(1.4) blur(20px); --command-palette-inset-shadow: inset 0 0 2px 2px rgb(255 255 255 / 0.1), - var(--jenkins-border--subtle-shadow); + var(--jenkins-border--subtle-shadow), + 0 5px 10px var(--jenkins-border-color--subtle); ::backdrop { --command-palette-backdrop-background: color-mix( in sRGB, - var(--text-color) 30%, + var(--black) 17.5%, transparent ); } diff --git a/src/main/scss/components/_command-palette.scss b/src/main/scss/components/_command-palette.scss index a487f3429b04..2d5322edcbb0 100644 --- a/src/main/scss/components/_command-palette.scss +++ b/src/main/scss/components/_command-palette.scss @@ -1,6 +1,12 @@ @use "../abstracts/mixins"; @use "../base/breakpoints"; +$command-palette-background: color-mix( + in sRGB, + var(--card-background) 90%, + transparent +); + .jenkins-command-palette__dialog { background: none; border: none; @@ -14,7 +20,7 @@ &::backdrop { background: var(--command-palette-backdrop-background); - backdrop-filter: saturate(1.25) blur(2px); + backdrop-filter: blur(1px); animation: jenkins-dialog-backdrop-animate-in 0.1s linear; } @@ -48,7 +54,7 @@ } .jenkins-command-palette__wrapper { - --inset: 15vh; + --inset: 14vh; width: 100%; height: 100%; @@ -76,7 +82,7 @@ &__search { --search-bar-height: 3rem !important; - background: color-mix(in sRGB, var(--card-background), transparent); + background: $command-palette-background; box-shadow: var(--command-palette-inset-shadow); margin-bottom: var(--section-padding); border-radius: 1rem; @@ -109,7 +115,7 @@ display: flex; flex-direction: column; border-radius: 1rem; - background: color-mix(in sRGB, var(--card-background), transparent); + background: $command-palette-background; backdrop-filter: var(--command-palette-results-backdrop-filter); box-shadow: var(--command-palette-inset-shadow); @@ -126,7 +132,6 @@ padding: 0.5rem; &__heading { - font-weight: var(--font-bold-weight); font-size: var(--font-size-sm); margin: 0; padding: 0.5rem 0.625rem;