fix(ADA-2958): Add character counter announcement - #189
Merged
valentinStoicaK merged 3 commits intoFeb 6, 2026
Conversation
roeedean
requested changes
Feb 2, 2026
| ); | ||
| lastAnnouncedCountRef.current = characterCount; | ||
| } | ||
| }, 800); |
Contributor
There was a problem hiding this comment.
Use higher time like 1/2000ms.
@SivanA-Kaltura thought maybe you familiar with an appropriate solution that won't require setTimeout and can share :)
Contributor
Author
There was a problem hiding this comment.
@roeedean can you please explain why I should use a higher time? Testing the behavior seems like enough. 2 seconds might be too much, giving the impression the announcement is delayed. Thanks
Contributor
There was a problem hiding this comment.
- can we guarantee that 800 will always work as we expect in every platform ?
- we have debounce functions both in common and in playkit-ui and in fact transcript uses debounce as well https://github.com/kaltura/playkit-js-transcript/blob/be4cc5d33e2fb62d05cfa3fba1c091ab6948a3d3/src/components/transcript/transcript.tsx#L550
- and bottom line, this is a user experience decision because it has to do with how the delay "feels" for the user, so it's not up to us to select an arbitrary number. this is a question for product / UX
Contributor
Author
There was a problem hiding this comment.
I replaced the setTimeout with debounce as suggested. For the time, I am waiting Julien's input.
Contributor
Author
There was a problem hiding this comment.
Per product, the time should be 1500ms
roeedean
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This solves https://kaltura.atlassian.net/browse/ADA-2958.
SetTimeout it is used to avoid announcing on every keystroke. The message is announced only after user pauses typing.
The alternative would be to announce the counter every 10-20 characters, but product requested this behavior.