Merge pull request #1120 from ProjectInfinity/command-palette-redesign

feat: redesign CommandPalette
This commit is contained in:
Jan Prochazka
2025-05-29 12:50:18 +02:00
committed by GitHub

View File

@@ -164,6 +164,13 @@
}} }}
data-testid='CommandPalette_main' data-testid='CommandPalette_main'
> >
<div
class="overlay"
on:click={() => {
$visibleCommandPalette = null;
}}
/>
<div class="palette">
<div class="pages"> <div class="pages">
<div <div
class="page" class="page"
@@ -219,54 +226,113 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<style> <style>
.main { .main {
width: 500px; position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: flex-start;
padding-top: 100px;
}
.overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
z-index: 1;
}
.palette {
position: relative;
z-index: 2;
width: 600px;
background: var(--theme-bg-2); background: var(--theme-bg-2);
border-radius: 4px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
} }
.mainInner { .mainInner {
padding: 5px; padding: 8px;
} }
.content { .content {
max-height: 400px; max-height: 500px;
overflow-y: scroll; overflow-y: auto;
margin-top: 8px;
} }
.search { .search {
display: flex; display: flex;
margin-bottom: 8px;
} }
input { input {
width: 100%; width: 100%;
padding: 8px;
background: var(--theme-bg-1);
border: 1px solid var(--theme-border);
border-radius: 4px;
color: var(--theme-font);
font-size: 14px;
} }
input:focus {
outline: none;
border-color: var(--theme-accent);
}
.command { .command {
padding: 5px; padding: 8px 12px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
cursor: pointer;
border-radius: 4px;
} }
.command:hover { .command:hover {
background: var(--theme-bg-3); background: var(--theme-bg-3);
} }
.command.selected { .command.selected {
background: var(--theme-bg-selected); background: var(--theme-bg-selected);
} }
.shortcut { .shortcut {
background: var(--theme-bg-3); background: var(--theme-bg-3);
padding: 2px 6px;
border-radius: 3px;
font-size: 12px;
color: var(--theme-font-dimmed);
} }
.pages { .pages {
display: flex; display: flex;
border-bottom: 1px solid var(--theme-border);
} }
.page { .page {
padding: 5px; padding: 8px 16px;
border: 1px solid var(--theme-border);
cursor: pointer; cursor: pointer;
color: var(--theme-font-dimmed);
border-bottom: 2px solid transparent;
} }
.page:hover { .page:hover {
color: var(--theme-font-hover); color: var(--theme-font);
} }
.page.selected { .page.selected {
background: var(--theme-bg-1); color: var(--theme-font);
border-bottom-color: var(--theme-accent);
} }
</style> </style>