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

Debounce grade clicks #2865

Merged
merged 2 commits into from
Jun 24, 2021
Merged

Debounce grade clicks #2865

merged 2 commits into from
Jun 24, 2021

Conversation

niknetniko
Copy link
Member

@niknetniko niknetniko commented Jun 16, 2021

This pull request adds a debounce to saving the grade values, to fix #2821.

We'll probably need to play with the delay a bit, since it is a compromise between not waiting too long after typing a value, and waiting long enough that the debounce is useful when using the increment buttons.

Todo:

  • Fix the system tests; they don't seem to understand the debounce.
  • See if @chvp's suggestion to show the "saving" animation without delay (if the delay is so long that users think nothing happens) is needed

In the end I did opt to include the debounce from lodash:

  • it's just the debounce, so it doesn't that large
  • seemed unnecessary to write it ourselves
  • it's already included by other dependencies, so there is no actually added code

This did require the allowSyntheticDefaultImports to be enabled, but I couldn't find any downsides. (and typescript in my ide kept complaining)

@niknetniko niknetniko added the bug Something isn't working label Jun 16, 2021
@bmesuere
Copy link
Member

@niknetniko niknetniko force-pushed the fix/debounce-grading branch from ca08c1f to 1bd88f3 Compare June 24, 2021 11:29
@niknetniko niknetniko marked this pull request as ready for review June 24, 2021 11:35
@niknetniko niknetniko requested review from bmesuere and chvp June 24, 2021 11:35
@niknetniko
Copy link
Member Author

I've updated the code to use the existing utility function instead.

@chvp chvp added the deploy mestra Request a deployment on mestra label Jun 24, 2021
@chvp chvp temporarily deployed to mestra June 24, 2021 11:37 Inactive
@github-actions github-actions bot removed the deploy mestra Request a deployment on mestra label Jun 24, 2021
app/assets/javascripts/feedback/score.ts Outdated Show resolved Hide resolved
@niknetniko niknetniko merged commit 36a86ce into develop Jun 24, 2021
@niknetniko niknetniko deleted the fix/debounce-grading branch June 24, 2021 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debounce score increment/decrement to make sure input is not lost
3 participants