Bug 35396 - Replace Datatables' column filters throttling with input timeout
Summary: Replace Datatables' column filters throttling with input timeout
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Lari Strand
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 35284
Blocks: 31199
  Show dependency treegraph
 
Reported: 2023-11-24 11:52 UTC by Lari Strand
Modified: 2024-02-01 15:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.03


Attachments
Bug 35396 - Replace Datatables' column filters throttling with input timeout (2.29 KB, patch)
2023-11-24 12:39 UTC, Lari Strand
Details | Diff | Splinter Review
Bug 35396: Replace Datatables' column filters throttling with input timeout (3.48 KB, patch)
2023-11-24 14:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35396: Replace Datatables' column filters throttling with input timeout (3.55 KB, patch)
2024-01-24 10:41 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Strand 2023-11-24 11:52:01 UTC
Throttling datatables filtering shoots unnecessary filtering events when a user begins typing to a filter field and during typing. To make the system feel more responsive and get rid of excess filtering events we could replace throttling with an input timeout and wait until x milliseconds have passed when the user has stopped typing into the filter field.
Comment 1 Lari Strand 2023-11-24 12:39:20 UTC
Created attachment 159238 [details] [review]
Bug 35396 - Replace Datatables' column filters throttling with input timeout

This patch replaces throttling filter events with a typing timeout for datatable filtering events. This patch should increase filtering responsiveness to datatables that have column filtering enabled across Koha.

To test:
1) Get a datatable with multiple results showing in intranet, for example search patrons with no search string to get all patrons in a filterable datatable result view or open Receive orders page that shows pending orders and order lines in Acquisitions like /cgi-bin/koha/acqui/parcel.pl?invoiceid=xxx
2) Type a character into a Datatable column filtering field
=> notice a filtering event fires right after the first character has been entered
3) Keep typing
=> notice multiple sequential filtering events being fired during the typing and one at the end when typing has stopped
4) Apply patch
5) Start typing into a filtering field
=> Note that during typing no filtering events are being fired unless the time between entering characters exceeds 500ms
6) End typing into the filter field
=> notice that just one filtering event fires at the end of typing if characters were entered sequentially faster than 500ms apart.
Comment 2 Jonathan Druart 2023-11-24 14:38:38 UTC
Created attachment 159242 [details] [review]
Bug 35396: Replace Datatables' column filters throttling with input timeout

This patch replaces throttling filter events with a typing timeout for datatable filtering events. This patch should increase filtering responsiveness to datatables that have column filtering enabled across Koha.

To test:
1) Get a datatable with multiple results showing in intranet, for example search patrons with no search string to get all patrons in a filterable datatable result view or open Receive orders page that shows pending orders and order lines in Acquisitions like /cgi-bin/koha/acqui/parcel.pl?invoiceid=xxx
2) Type a character into a Datatable column filtering field
=> notice a filtering event fires right after the first character has been entered
3) Keep typing
=> notice multiple sequential filtering events being fired during the typing and one at the end when typing has stopped
4) Apply patch
5) Start typing into a filtering field
=> Note that during typing no filtering events are being fired unless the time between entering characters exceeds 500ms
6) End typing into the filter field
=> notice that just one filtering event fires at the end of typing if characters were entered sequentially faster than 500ms apart.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Martin Renvoize 2024-01-24 10:41:48 UTC
Created attachment 161325 [details] [review]
Bug 35396: Replace Datatables' column filters throttling with input timeout

This patch replaces throttling filter events with a typing timeout for datatable filtering events. This patch should increase filtering responsiveness to datatables that have column filtering enabled across Koha.

To test:
1) Get a datatable with multiple results showing in intranet, for example search patrons with no search string to get all patrons in a filterable datatable result view or open Receive orders page that shows pending orders and order lines in Acquisitions like /cgi-bin/koha/acqui/parcel.pl?invoiceid=xxx
2) Type a character into a Datatable column filtering field
=> notice a filtering event fires right after the first character has been entered
3) Keep typing
=> notice multiple sequential filtering events being fired during the typing and one at the end when typing has stopped
4) Apply patch
5) Start typing into a filtering field
=> Note that during typing no filtering events are being fired unless the time between entering characters exceeds 500ms
6) End typing into the filter field
=> notice that just one filtering event fires at the end of typing if characters were entered sequentially faster than 500ms apart.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2024-01-24 10:42:53 UTC
This is nice and clear and works well to achieve it's goals.

No regressions found and qa scripts are happy.

Passing QA
Comment 5 Katrin Fischer 2024-01-29 11:28:40 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Fridolin Somers 2024-02-01 15:04:05 UTC
Pushed to 23.11.x for 23.11.03