Skip to content

fix: prevent workspace search bar text from getting garbled #9703

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 11 commits into from
Sep 15, 2023
Merged

Conversation

Parkreiner
Copy link
Member

@Parkreiner Parkreiner commented Sep 15, 2023

Closes #9547
Addresses main issue where the text in the workspaces search bar would periodically get garbled, especially if you kept typing very fast.

Changes made

  • Replaced debounce-it usage for the page with a home-spun useDebouncedFunction
    • The library's debounce utility assumes it's called in regular JavaScript, so it kept creating a brand new stateful function on every single render. That was splitting up all the debounced calls, instead of having them go to one centralized place
    • There are still other parts of the codebase that need to have this swap made; will open a new issue shortly about getting those areas updated (changes were out of scope for this PR)
    • Hook has tests in place, too, just to give us more confidence when we use it in the future.
  • Reorganized some of the code and also added a few extra checks to minimize risks of accidental state desyncs between the search bar state and the global query state that it's based off of

Other notes

  • Accidentally got confused when I was learning the codebase (lowercase filter.tsx vs uppercase Filter.tsx), and refactored a file that didn't really need changes. Functionality is the same; it was a pure refactor.
    • Will be more dutiful about making sure PRs don't touch any unnecessary files in the future

@Parkreiner Parkreiner requested review from a team and BrunoQuaresma and removed request for a team September 15, 2023 18:11
@github-actions
Copy link

github-actions bot commented Sep 15, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@Parkreiner Parkreiner added bug good first issue Easily solved issues suitable for starters and community contributors s3 Bugs that confuse, annoy, or are purely cosmetic labels Sep 15, 2023
@Parkreiner
Copy link
Member Author

I have read the CLA Document and I hereby sign the CLA

cdrcommunity added a commit to coder/cla that referenced this pull request Sep 15, 2023
@Parkreiner Parkreiner removed s3 Bugs that confuse, annoy, or are purely cosmetic bug good first issue Easily solved issues suitable for starters and community contributors labels Sep 15, 2023
@Parkreiner Parkreiner changed the title fix: Prevent workspace search bar text from getting garbled (#9547) fix: Prevent workspace search bar text from getting garbled Sep 15, 2023
@Parkreiner Parkreiner changed the title fix: Prevent workspace search bar text from getting garbled fix: prevent workspace search bar text from getting garbled Sep 15, 2023
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

Really good one, just one minor comment.

@Parkreiner Parkreiner merged commit fcc8b9e into main Sep 15, 2023
@Parkreiner Parkreiner deleted the filter-fix branch September 15, 2023 19:56
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter input flickers when typing fast
2 participants