Add typeahead prompt selector with fuzzy search on titles

This replaces the prompt dropdown button with a fuzzy search input to filter prompts. Uses [svelte-typeahead](https://metonym.github.io/svelte-typeahead/).
This commit is contained in:
Niel Thiart
2023-12-05 15:38:48 +02:00
parent e2027a3d27
commit 76fd31ef9e
4 changed files with 78 additions and 21 deletions

View File

@@ -264,6 +264,38 @@ $modal-background-background-color-dark: rgba($dark, 0.86) !default; // remove t
}
}
[data-svelte-typeahead] {
display: flex;
ul.svelte-typeahead-list {
max-height: calc(60vh);
overflow: auto;
> li:not(:last-of-type) {
padding: 0;
border-bottom: 0 none;
}
}
&[aria-expanded="true"] {
z-index: 3;
}
[data-svelte-search] {
flex: 1;
input {
@extend .button;
@extend .default-text;
text-align: center;
&::placeholder {
@extend .default-text;
}
}
}
}
/* Bulma layout hacks */
.chat-option-menu.navbar-item {