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

Feat/heal search debounce #1232

Merged
merged 20 commits into from
Mar 9, 2023
Merged

Conversation

jarvisraymond-uchicago
Copy link
Contributor

@jarvisraymond-uchicago jarvisraymond-uchicago commented Feb 9, 2023

Jira Ticket: HP-983

New Features

This adds 500ms debouncing to the HEAL search functionality following page load. This uses the lodash debounce API (this library is already included in the code base).

This also adds a unit test for the debouncing functionality.

Improvements

A utils folder has been added containing a Search folder to house the search functionality and to aid in code organization. The filtering functions associated with searching have been moved into this folder to help clean up Discovery.tsx. Unneeded imports were removed from Discovery.tsx.

Screen Shots

With a 500ms debounce
Note that when typing a longer query, such as "intersection" it only searches once
output

@jarvisraymond-uchicago jarvisraymond-uchicago marked this pull request as ready for review February 23, 2023 16:53
@@ -0,0 +1,63 @@
import { DiscoveryConfig } from '../../DiscoveryConfig';

interface FilterState {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this can use the exported interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! The FilterState here has been updated as an import from the Discovery.tsx file.

Copy link
Collaborator

@mfshao mfshao left a comment

Choose a reason for hiding this comment

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

overall the debounce logic seems working fine in QA and looks good to me. One minor comment below

There is a bug that if there is a value in the search bar and user switches page, the value will be preserved but the table will show as it has 0 reocrds. But I think this is an existing bug that is not relevent to the change

@jarvisraymond-uchicago
Copy link
Contributor Author

overall the debounce logic seems working fine in QA and looks good to me. One minor comment below

There is a bug that if there is a value in the search bar and user switches page, the value will be preserved but the table will show as it has 0 reocrds. But I think this is an existing bug that is not relevent to the change

Thanks @mfshao! I agree that the bug is a preexisting condition, I spent an hour or so working on it and I think it merits a separate ticket.

Copy link
Collaborator

@mfshao mfshao left a comment

Choose a reason for hiding this comment

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

👍 looks good, let's see when CI will be happy... 🕒

@jarvisraymond-uchicago jarvisraymond-uchicago merged commit 73bbbf8 into master Mar 9, 2023
@jarvisraymond-uchicago jarvisraymond-uchicago deleted the feat/healSearchDebounce branch March 9, 2023 22:11
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