Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Feb 10, 2025
1 parent d7270b1 commit 46a9e56
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 16 deletions.
20 changes: 13 additions & 7 deletions core/src/main/java/jenkins/search/SearchGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<SearchGroup> all() {
Expand All @@ -20,21 +26,21 @@ static ExtensionList<SearchGroup> 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();
}
}

Expand All @@ -43,7 +49,7 @@ class ComputerSearchGroup implements SearchGroup {

@Override
public String getDisplayName() {
return "Computers";
return SearchGroup_ComputerSearchGroup_DisplayName();
}
}

Expand All @@ -52,7 +58,7 @@ class ViewSearchGroup implements SearchGroup {

@Override
public String getDisplayName() {
return "Views";
return SearchGroup_ViewSearchGroup_DisplayName();
}
}

Expand All @@ -61,7 +67,7 @@ class UserSearchGroup implements SearchGroup {

@Override
public String getDisplayName() {
return "Users";
return SearchGroup_UserSearchGroup_DisplayName();
}
}
}
27 changes: 27 additions & 0 deletions core/src/main/resources/jenkins/search/Messages.properties
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions src/main/scss/abstracts/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down
15 changes: 10 additions & 5 deletions src/main/scss/components/_command-palette.scss
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -48,7 +54,7 @@
}

.jenkins-command-palette__wrapper {
--inset: 15vh;
--inset: 14vh;

width: 100%;
height: 100%;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit 46a9e56

Please sign in to comment.