Skip to content

fix: DebouncedTextField Improvements, fix help text changes reverting other field changes #1470

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

Merged
merged 6 commits into from
Apr 24, 2025

Conversation

ryankontos
Copy link
Collaborator

fix: DebouncedTextField Improvements, fix help text changes reverting other field changes

JIRA Tickets

BSS-917 - Designer: editing help text reverts other changes in a field

BSS-898 - Remove debounce on designer option select input

Description

This pull request addresses some performances issues with DebouncedTextField and fixes issues where field changes could be lost. This effectively resolves BSS-917, an issue where editing help text was reverting other changes in a field.

Also, DebouncedTextField usage has been removed the OptionsEditor component.

Proposed Changes

  • Rewrote the DebouncedTextField component.
  • Reduced default debounce text field time from 500ms -> 200ms.
  • We now flush the debounce function instead of cancelling it to prevent data loss.
  • Updated debounce function from a useRef to useMemo, so it is not unnecessarily recreated.
  • Removed DebouncedTextField usage from the OptionsEditor component.

How to Test

  • Modify a field option (For example, toggle uncertainty).
  • Modify the helper text.
  • Ensure that the option you changed does not revert to its original state.

Checklist

  • I have confirmed all commits have been signed.
  • I have added JSDoc style comments to any new functions or classes.
  • Relevant documentation such as READMEs, guides, and class comments are updated.

Copy link
Contributor

@PeterBaker0 PeterBaker0 left a comment

Choose a reason for hiding this comment

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

Tested and working well - prefer using lodash debounce good call - it's cleaner. I also added a debounce around the advanced markdown editor as noticed it has poor performance.

Signed-off-by: Peter Baker <[email protected]>
@PeterBaker0 PeterBaker0 merged commit c6cc5fa into main Apr 24, 2025
2 checks passed
@PeterBaker0 PeterBaker0 deleted the fix/improve-debounced-textfield branch April 24, 2025 01:34
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.

2 participants