Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rum-explorer): introduces 3s debounce to filter input field #677

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tools/oversight/slicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
));

if (cp === 'loadresource') {
console.log('adding histogram facet');

Check warning on line 245 in tools/oversight/slicer.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
// loadresource.target are not discrete values, but the number
// of milliseconds it took to load the resource, so the best way
// to present this is to create a histogram
Expand Down Expand Up @@ -431,9 +431,14 @@
loadData(elems.viewSelect.value).then(draw);
}

let filterInputDebounce;
const debounceTimeout = view === 'week' ? 1000 : 0;
elems.filterInput.addEventListener('input', () => {
updateState();
draw();
clearTimeout(filterInputDebounce);
filterInputDebounce = setTimeout(() => {
updateState();
draw();
}, debounceTimeout);
});

elems.viewSelect.addEventListener('change', () => {
Expand Down
9 changes: 7 additions & 2 deletions tools/rum/slicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,14 @@ const io = new IntersectionObserver((entries) => {
loadData(elems.viewSelect.value).then(draw);
}

let filterInputDebounce;
const debounceTimeout = view === 'week' ? 1000 : 0;
elems.filterInput.addEventListener('input', () => {
updateState();
draw();
clearTimeout(filterInputDebounce);
filterInputDebounce = setTimeout(() => {
updateState();
draw();
}, debounceTimeout);
});

elems.viewSelect.addEventListener('change', () => {
Expand Down
Loading