Skip to content

Commit 72e2f67

Browse files
committed
fix(client): autocomplete looking off in new tab
1 parent cf059e7 commit 72e2f67

File tree

3 files changed

+36
-40
lines changed

3 files changed

+36
-40
lines changed

apps/client/src/services/note_autocomplete.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ function initNoteAutocomplete($el: JQuery<HTMLElement>, options?: Options) {
327327
}
328328
// Add special class for search-notes action
329329
const actionClass = suggestion.action === "search-notes" ? "search-notes-action" : "";
330-
330+
331331
// Choose appropriate icon based on action
332332
let iconClass = suggestion.icon ?? "bx bx-note";
333333
if (suggestion.action === "search-notes") {
@@ -337,18 +337,18 @@ function initNoteAutocomplete($el: JQuery<HTMLElement>, options?: Options) {
337337
} else if (suggestion.action === "external-link") {
338338
iconClass = "bx bx-link-external";
339339
}
340-
340+
341341
// Simplified HTML structure without nested divs
342342
let html = `<div class="note-suggestion ${actionClass}">`;
343-
html += `<span class="${iconClass}" style="display: inline-block; width: 16px; vertical-align: top;"></span>`;
344-
html += `<span style="display: inline-block; width: calc(100% - 20px); padding-left: 4px;">`;
345-
html += `<span class="search-result-title" style="display: block;">${suggestion.highlightedNotePathTitle}</span>`;
346-
343+
html += `<span class="icon ${iconClass}"></span>`;
344+
html += `<span class="text">`;
345+
html += `<span class="search-result-title">${suggestion.highlightedNotePathTitle}</span>`;
346+
347347
// Add attribute snippet inline if available
348348
if (suggestion.highlightedAttributeSnippet) {
349-
html += `<span style="display: block; font-size: 0.8em; color: var(--muted-text-color); opacity: 0.6; line-height: 1;" class="search-result-attributes">${suggestion.highlightedAttributeSnippet}</span>`;
349+
html += `<span class="search-result-attributes">${suggestion.highlightedAttributeSnippet}</span>`;
350350
}
351-
351+
352352
html += `</span>`;
353353
html += `</div>`;
354354
return html;

apps/client/src/stylesheets/style.css

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -862,10 +862,34 @@ table.promoted-attributes-in-tooltip th {
862862

863863
.aa-dropdown-menu .aa-suggestion {
864864
cursor: pointer;
865-
padding: 5px;
865+
padding: 6px 16px;
866866
margin: 0;
867867
}
868868

869+
.aa-dropdown-menu .aa-suggestion .icon {
870+
display: inline-block;
871+
line-height: inherit;
872+
vertical-align: top;
873+
}
874+
875+
.aa-dropdown-menu .aa-suggestion .text {
876+
display: inline-block;
877+
width: calc(100% - 20px);
878+
padding-left: 4px;
879+
}
880+
881+
.aa-dropdown-menu .aa-suggestion .search-result-title {
882+
display: block;
883+
}
884+
885+
.aa-dropdown-menu .aa-suggestion .search-result-attributes {
886+
display: block;
887+
font-size: 0.8em;
888+
color: var(--muted-text-color);
889+
opacity: 0.6;
890+
line-height: 1;
891+
}
892+
869893
.aa-dropdown-menu .aa-suggestion p {
870894
padding: 0;
871895
margin: 0;
@@ -1828,33 +1852,6 @@ textarea {
18281852
width: 100%;
18291853
}
18301854

1831-
.jump-to-note-results .aa-dropdown-menu .aa-suggestion {
1832-
white-space: normal;
1833-
padding: 2px 12px !important;
1834-
line-height: 1.1;
1835-
position: relative;
1836-
border-radius: 0;
1837-
margin: 0 !important;
1838-
}
1839-
1840-
.jump-to-note-results .note-suggestion {
1841-
margin: 0;
1842-
padding: 0;
1843-
line-height: 1;
1844-
}
1845-
1846-
.jump-to-note-results .aa-suggestion:not(:last-child)::after {
1847-
display: none; /* Remove dividers for more compact look */
1848-
}
1849-
1850-
.jump-to-note-results .aa-suggestion:last-child::after {
1851-
display: none;
1852-
}
1853-
1854-
.jump-to-note-results .aa-suggestion.disabled::after {
1855-
display: none;
1856-
}
1857-
18581855
.jump-to-note-results .aa-dropdown-menu .aa-suggestion:hover,
18591856
.jump-to-note-results .aa-dropdown-menu .aa-cursor {
18601857
background-color: var(--hover-item-background-color, #f8f9fa);

apps/client/src/stylesheets/theme-next/base.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,9 @@ body.mobile .dropdown-menu .dropdown-item.submenu-open .dropdown-toggle::after {
536536
}
537537

538538
/* List item */
539-
.jump-to-note-dialog .aa-suggestions div,
540-
.note-detail-empty .aa-suggestions div {
541-
border-radius: 0;
542-
padding: 12px 16px;
539+
.jump-to-note-dialog .aa-suggestion,
540+
.note-detail-empty .aa-suggestion {
541+
border-radius: 6px;
543542
color: var(--menu-text-color);
544543
cursor: default;
545544
}

0 commit comments

Comments
 (0)