Skip to content

Autosubmit: configurable debounce delay - #1302

Merged
radimvaculik merged 1 commit into
contributte:masterfrom
dg:fix/autosubmit-delay
Aug 14, 2026
Merged

Autosubmit: configurable debounce delay#1302
radimvaculik merged 1 commit into
contributte:masterfrom
dg:fix/autosubmit-delay

Conversation

@dg

@dg dg commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

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.

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.
Copilot AI lite review requested due to automatic review settings August 9, 2026 17:53
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.12%. Comparing base (ab5506d) to head (e2faf47).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 delay constructor parameter to AutosubmitPlugin.
  • Plumbed the optional delay through to the debounce() calls for change and keyup listeners.
Suppressed comments (1)

assets/plugins/features/autosubmit.ts:81

  • Same issue here: this.delay is number | undefined under strict TS settings, so passing it as debounce's second argument (number) will not compile. Define the handler once and choose the debounce call based on whether delay is 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
radimvaculik merged commit 76fef4c into contributte:master Aug 14, 2026
10 checks passed
@radimvaculik

Copy link
Copy Markdown
Member

Thanks for the contribution! Clean and fully backward compatible — merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants