From 45194bd31fe84976c224e205c0792f080a9a83fa Mon Sep 17 00:00:00 2001 From: ekremney Date: Thu, 31 Oct 2024 14:20:28 +0100 Subject: [PATCH 1/4] fix(rum-explorer): changes input event to keydown-enter for the filter input field --- tools/oversight/elements/facetsidebar.js | 2 +- tools/oversight/slicer.js | 9 ++++++--- tools/rum/elements/facetsidebar.js | 2 +- tools/rum/slicer.js | 9 ++++++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tools/oversight/elements/facetsidebar.js b/tools/oversight/elements/facetsidebar.js index 92c3edc4..23d5fb94 100644 --- a/tools/oversight/elements/facetsidebar.js +++ b/tools/oversight/elements/facetsidebar.js @@ -38,7 +38,7 @@ export default class FacetSidebar extends HTMLElement { const filterInput = document.createElement('input'); filterInput.type = 'text'; filterInput.id = 'filter'; - filterInput.placeholder = 'Type to filter...'; + filterInput.placeholder = 'Type to filter, press ↵ to apply'; quickFilter.append(filterInput); this.append(quickFilter); diff --git a/tools/oversight/slicer.js b/tools/oversight/slicer.js index 9e6a4aac..fa6889ab 100644 --- a/tools/oversight/slicer.js +++ b/tools/oversight/slicer.js @@ -431,9 +431,12 @@ const io = new IntersectionObserver((entries) => { loadData(elems.viewSelect.value).then(draw); } - elems.filterInput.addEventListener('input', () => { - updateState(); - draw(); + elems.filterInput.addEventListener('keydown', (event) => { + if (event.key === 'Enter') { + clearTimeout(filterInputDebounce); + updateState(); + draw(); + } }); elems.viewSelect.addEventListener('change', () => { diff --git a/tools/rum/elements/facetsidebar.js b/tools/rum/elements/facetsidebar.js index 329ba677..5bd075e7 100644 --- a/tools/rum/elements/facetsidebar.js +++ b/tools/rum/elements/facetsidebar.js @@ -30,7 +30,7 @@ export default class FacetSidebar extends HTMLElement { const filterInput = document.createElement('input'); filterInput.type = 'text'; filterInput.id = 'filter'; - filterInput.placeholder = 'Type to filter...'; + filterInput.placeholder = 'Type to filter, press ↵ to apply'; quickFilter.append(filterInput); this.append(quickFilter); const facetsElement = document.createElement('aside'); diff --git a/tools/rum/slicer.js b/tools/rum/slicer.js index 30f024c9..584708d4 100644 --- a/tools/rum/slicer.js +++ b/tools/rum/slicer.js @@ -381,9 +381,12 @@ const io = new IntersectionObserver((entries) => { loadData(elems.viewSelect.value).then(draw); } - elems.filterInput.addEventListener('input', () => { - updateState(); - draw(); + elems.filterInput.addEventListener('keydown', (event) => { + if (event.key === 'Enter') { + clearTimeout(filterInputDebounce); + updateState(); + draw(); + } }); elems.viewSelect.addEventListener('change', () => { From 43666bcd962d0b62e7bd5e9cdf92142493875dea Mon Sep 17 00:00:00 2001 From: ekremney Date: Thu, 31 Oct 2024 14:25:57 +0100 Subject: [PATCH 2/4] fix(rum-explorer): apply on blur as well --- tools/oversight/slicer.js | 6 +++++- tools/rum/slicer.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/oversight/slicer.js b/tools/oversight/slicer.js index fa6889ab..fce6c6f0 100644 --- a/tools/oversight/slicer.js +++ b/tools/oversight/slicer.js @@ -433,12 +433,16 @@ const io = new IntersectionObserver((entries) => { elems.filterInput.addEventListener('keydown', (event) => { if (event.key === 'Enter') { - clearTimeout(filterInputDebounce); updateState(); draw(); } }); + elems.filterInput.addEventListener('blur', (event) => { + updateState(); + draw(); + }); + elems.viewSelect.addEventListener('change', () => { updateState(); window.location.reload(); diff --git a/tools/rum/slicer.js b/tools/rum/slicer.js index 584708d4..138e0de8 100644 --- a/tools/rum/slicer.js +++ b/tools/rum/slicer.js @@ -383,12 +383,16 @@ const io = new IntersectionObserver((entries) => { elems.filterInput.addEventListener('keydown', (event) => { if (event.key === 'Enter') { - clearTimeout(filterInputDebounce); updateState(); draw(); } }); + elems.filterInput.addEventListener('blur', (event) => { + updateState(); + draw(); + }); + elems.viewSelect.addEventListener('change', () => { updateState(); window.location.reload(); From 4830951251d2ec19ac1df93ff25798565aa07199 Mon Sep 17 00:00:00 2001 From: ekremney Date: Thu, 31 Oct 2024 14:43:37 +0100 Subject: [PATCH 3/4] fix(rum-explorer): make linter happy --- tools/oversight/slicer.js | 2 +- tools/rum/slicer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/oversight/slicer.js b/tools/oversight/slicer.js index fce6c6f0..2ffc42f4 100644 --- a/tools/oversight/slicer.js +++ b/tools/oversight/slicer.js @@ -438,7 +438,7 @@ const io = new IntersectionObserver((entries) => { } }); - elems.filterInput.addEventListener('blur', (event) => { + elems.filterInput.addEventListener('blur', () => { updateState(); draw(); }); diff --git a/tools/rum/slicer.js b/tools/rum/slicer.js index 138e0de8..8f1cb69f 100644 --- a/tools/rum/slicer.js +++ b/tools/rum/slicer.js @@ -388,7 +388,7 @@ const io = new IntersectionObserver((entries) => { } }); - elems.filterInput.addEventListener('blur', (event) => { + elems.filterInput.addEventListener('blur', () => { updateState(); draw(); }); From b378ede5967b88c1d06778369556e037054b1ab2 Mon Sep 17 00:00:00 2001 From: ekremney Date: Thu, 31 Oct 2024 14:51:25 +0100 Subject: [PATCH 4/4] fix: trigger release