From 8d60b5caada97c2ea06f6c896eb40897a8241712 Mon Sep 17 00:00:00 2001 From: Abhinandan Bhuse Date: Sat, 7 Dec 2024 10:16:19 +0530 Subject: [PATCH] Added syntactic content assistance to the filter field --- frontend/components/Filter.svelte | 89 ++++++++++++++++++++------- frontend/components/Suggestion.svelte | 39 ++++++++++++ frontend/dsl.ts | 51 +++++++++++---- 3 files changed, 147 insertions(+), 32 deletions(-) create mode 100644 frontend/components/Suggestion.svelte diff --git a/frontend/components/Filter.svelte b/frontend/components/Filter.svelte index 65e21f1..8abbae1 100644 --- a/frontend/components/Filter.svelte +++ b/frontend/components/Filter.svelte @@ -1,6 +1,7 @@ + +
- +
+ { hideSuggestions = false; }} + + /> + { + console.log('Selected', value); + if (filterState.partialToken) { + filter = filter.slice(0, filterState.partialToken.startOffset-1) + value; + } else { + filter += ' ' + value; + } + inputField.focus(); + _filterChangeHandler(); + }} /> +