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

perf: undebounce autocomplete #26491

Merged
merged 4 commits into from
Jun 20, 2024

Conversation

barredterra
Copy link
Collaborator

@barredterra barredterra commented May 20, 2024

Most "Autocomplete" fields have their options set in advance, so debouncing on input is pointless here. For example, the Country field in Holiday List:

Before:

country-debounced.mov

After:

country-fast.mov

Even when calling an API, waiting for half a second significantly worsens the experience. For example, address autocompletion.

Before:

address-debounced.mov

After:

address-fast.mov

Removing this debounce results in a snappier UX and does not impose rate limiting, which is unnecessary in the first case and unwanted in the second.

@ankush
Copy link
Member

ankush commented May 21, 2024

@barredterra autocomplete tests breaking 👀

Probably needs some delay (?) recording just shows everything going too fast and wrong.

@barredterra barredterra force-pushed the undebounce-autocomplete branch 2 times, most recently from 5446b86 to 2febb65 Compare May 24, 2024 09:59
@barredterra
Copy link
Collaborator Author

@ankush I tried different combinations of typing + waiting, but can't seem to figure out what's cypress's problem. Currently it seems like it blurs/resets the input instead of selecting the option. Could you give it a try?

@ankush
Copy link
Member

ankush commented May 28, 2024

@barredterra try very small debounce maybe 👀 100ms won't be noticeable to users.

This comment was marked as outdated.

@stale stale bot added the inactive label Jun 13, 2024
@barredterra barredterra marked this pull request as draft June 14, 2024 15:00
@stale stale bot removed the inactive label Jun 14, 2024
@barredterra
Copy link
Collaborator Author

barredterra commented Jun 14, 2024

A smaller, 100 ms debounce also did not help, cypress still fails (see #26765).

@barredterra barredterra marked this pull request as ready for review June 20, 2024 17:07
@barredterra barredterra merged commit 9a809f1 into frappe:develop Jun 20, 2024
23 of 24 checks passed
@barredterra barredterra deleted the undebounce-autocomplete branch June 20, 2024 17:07
@barredterra barredterra added backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15 labels Jun 20, 2024
@barredterra
Copy link
Collaborator Author

@Mergifyio backport version-15-hotfix

@frappe frappe deleted a comment from mergify bot Jun 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants