Skip to content

feat(search): debounced search on change for text-based fields#868

Open
cristianoliveira wants to merge 9 commits intov5-devfrom
WPB-23520-ui-bug-search-url-input-triggers-too-many-requests
Open

feat(search): debounced search on change for text-based fields#868
cristianoliveira wants to merge 9 commits intov5-devfrom
WPB-23520-ui-bug-search-url-input-triggers-too-many-requests

Conversation

@cristianoliveira
Copy link
Contributor

Refers to https://wearezeta.atlassian.net/browse/WPB-23520

This commit adds a debounced search on change for text-based fields. It also adds mocks and unit tests for the search functionality.

Detailed Changes:

  • Implementation:
    • Changed setValues method in withSearch to accept an immediate flag that triggers search without debounce.
    • Changed updateValue callback in FieldSearch and Renderer to pass the immediate flag.
    • Changed withSearch render method to use React.createElement.
  • Tests:
    • Added unit tests for withSearch setValues scheduling.
    • Added unit tests for FieldSearch immediate flag behavior.

This commit adds a debounced search on change for text-based fields.
It also adds mocks and unit tests for the search functionality.

Detailed Changes:
 - Implementation:
   - Changed setValues method in withSearch to accept an immediate flag that triggers search without debounce.
   - Changed updateValue callback in FieldSearch and Renderer to pass the immediate flag.
   - Changed withSearch render method to use React.createElement.
 - Tests:
   - Added unit tests for withSearch setValues scheduling.
   - Added unit tests for FieldSearch immediate flag behavior.
…rity

This commit renames the 'immediate' option to 'debounced' in search-related components to better reflect its behavior. The default search execution is now immediate, and debouncing must be explicitly requested.
searchTools={searchTools}
/>
);
return React.createElement(Component, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to be able to create unit tests. Otherwise we need to rename from js to jsx

@cristianoliveira cristianoliveira force-pushed the WPB-23520-ui-bug-search-url-input-triggers-too-many-requests branch from 46b742b to 2230c17 Compare March 11, 2026 13:58
…arch-url-input-triggers-too-many-requests

* origin/v5-dev:
  fix(pages): i18n and modal search polishing
@cristianoliveira cristianoliveira marked this pull request as ready for review March 11, 2026 14:01
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.

1 participant