Skip to content

Build your personal knowledge base with Trilium Notes

feat(command_palette): improve layout

Elian Dorand7f154cfd15c
diff --git a/apps/client/src/services/note_autocomplete.ts b/apps/client/src/services/note_autocomplete.ts
index 7c0ef7abd5..359b99309d 100644
--- a/apps/client/src/services/note_autocomplete.ts
+++ b/apps/client/src/services/note_autocomplete.ts
@@ -320,16 +320,16 @@ function initNoteAutocomplete($el: JQuery<HTMLElement>, options?: Options) {
suggestion: (suggestion) => {
if (suggestion.action === "command") {
let html = `<div class="command-suggestion">`;
- html += `<div class="command-header">`;
html += `<span class="command-icon ${suggestion.icon || "bx bx-terminal"}"></span>`;
- html += `<span class="command-name">${suggestion.highlightedNotePathTitle}</span>`;
- if (suggestion.commandShortcut) {
- html += `<kbd class="command-shortcut">${suggestion.commandShortcut}</kbd>`;
- }
- html += `</div>`;
+ html += `<div class="command-content">`;
+ html += `<div class="command-name">${suggestion.highlightedNotePathTitle}</div>`;
if (suggestion.commandDescription) {
html += `<div class="command-description">${suggestion.commandDescription}</div>`;
}
+ html += `</div>`;
+ if (suggestion.commandShortcut) {
+ html += `<kbd class="command-shortcut">${suggestion.commandShortcut}</kbd>`;
+ }
html += '</div>';
return html;
}
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index df40088457..8d56447d4c 100644
--- a/apps/client/src/stylesheets/style.css
+++ b/apps/client/src/stylesheets/style.css
@@ -1781,6 +1781,13 @@ textarea {
}
/* Command palette styling */
+.jump-to-note-dialog .command-suggestion {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ font-size: 0.9em;
+}
+
.jump-to-note-dialog .aa-suggestion .command-suggestion,
.jump-to-note-dialog .aa-suggestion .command-suggestion div {
padding: 0;
@@ -1792,22 +1799,28 @@ textarea {
background-color: var(--hover-background-color);
}
-.jump-to-note-dialog .command-header {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- position: relative;
-}
-
.jump-to-note-dialog .command-icon {
+ color: var(--muted-text-color);
+ font-size: 1.125rem;
flex-shrink: 0;
+ margin-top: 0.125rem;
+}
+
+.jump-to-note-dialog .command-content {
+ flex-grow: 1;
+ min-width: 0;
}
.jump-to-note-dialog .command-name {
- flex: 1;
font-weight: bold;
}
+.jump-to-note-dialog .command-description {
+ font-size: 0.8em;
+ line-height: 1.3;
+ opacity: 0.75;
+}
+
.jump-to-note-dialog kbd.command-shortcut {
background-color: transparent;
color: inherit;
@@ -1815,13 +1828,6 @@ textarea {
font-family: inherit !important;
}
-.jump-to-note-dialog .command-description {
- margin-top: 0.25rem;
- font-size: 0.875em;
- line-height: 1.3;
- opacity: 0.75;
-}
-
.empty-table-placeholder {
text-align: center;
color: var(--muted-text-color);