-
Notifications
You must be signed in to change notification settings - Fork 2
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
Candidate Decider - Hide Latency from Listeners through Frontend State Updates #495
Conversation
* wip * prettier and fix typo * remove leads from list * limit height of modal height to 60% of viewport height and make scrollable
* remove extraneous } in shoutoutsapi request * remove console.logs in api.ts
[diff-counting] Significant lines: 124. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a check to see if the form inputs changed before we call the api in handleRatingChange
and handleCommentChange
? It would just use getRating()
and getComment()
to check if the current rating and comment are different from what they were originally.
I agree with this to prevent excessive API calls, but I like the added UX of disabling the save button until at least one change (rating or comment) has been made. So I've done that instead. This behavior should also remind them to save too, since the button will light up once they've made a change. Screen.Recording.2023-09-26.at.5.38.29.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Summary
Previously, there was a latency issue on the candidate decider related to the listeners needing about a 2-3 second delay to update the responses real-time.
I have "hidden" the latency by updating frontend state instead of solely relying on Firestone listeners to wait for DB updates.
When the listeners receives the new snapshot, the local state will be properly synced. Updates to ratings/comments now show up instantaneously on the candidate decider UI.
Also:
''
every time we hit the save button, so if you hit the save button twice, you would clear out your commentNotion/Figma Link
https://www.notion.so/cornelldti/Candidate-Decider-Hide-Latency-from-Listeners-through-Frontend-State-Updates-d020a49d69b3439b93380add5833d6e0?pvs=4
Test Plan
Recorded a demo video for the candidate decider which includes this instantaneous update functionality (skip to 1:50).
Screen.Recording.2023-09-24.at.12.25.34.PM.mov
Notes
Breaking Changes