Autosubmit: configurable debounce delay - #1302
Merged
Merged
Conversation
The 200ms delay was hardcoded, which is short for filters over a slower backend - the request leaves while the user is still typing the word. Changing it meant copying the whole plugin, so the delay is now an optional constructor argument: new AutosubmitPlugin(500). Left out, the debounce() default applies as before.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1302 +/- ##
=======================================
Coverage 49.12% 49.12%
=======================================
Files 63 63
Lines 2974 2974
=======================================
Hits 1461 1461
Misses 1513 1513 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the AutosubmitPlugin debounce delay configurable so autosubmit requests don’t fire too aggressively (especially against slower backends), while preserving the existing default debounce behavior when no delay is provided.
Changes:
- Added an optional
delayconstructor parameter toAutosubmitPlugin. - Plumbed the optional delay through to the
debounce()calls forchangeandkeyuplisteners.
Suppressed comments (1)
assets/plugins/features/autosubmit.ts:81
- Same issue here:
this.delayisnumber | undefinedunderstrictTS settings, so passing it asdebounce's second argument (number) will not compile. Define the handler once and choose thedebouncecall based on whetherdelayis provided.
}, this.delay)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| submitEl.addEventListener( | ||
| "change", | ||
| debounce(() => datagrid.ajax.submitForm(form)) | ||
| debounce(() => datagrid.ajax.submitForm(form), this.delay) |
radimvaculik
approved these changes
Aug 14, 2026
Member
|
Thanks for the contribution! Clean and fully backward compatible — merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 200ms delay was hardcoded, which is short for filters over a slower backend - the request leaves while the user is still typing the word. Changing it meant copying the whole plugin, so the delay is now an optional constructor argument: new AutosubmitPlugin(500). Left out, the debounce() default applies as before.