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

Fix issue where clearing search box on LGV import form turns search box into loading bar #3545

Merged
merged 2 commits into from
Feb 24, 2023

Conversation

cmdcolin
Copy link
Collaborator

This addresses a regression introduced in v2.2.0, related to #3306

The bug that is seen is if you clear the text in the searchbox in the linear genome view import form, an infinite loading spinner replaces the search box suddenly, and you can then no longer alter the search unless you change assemblies

The fix applied here is instead of showing a loading state depending on the "value" of the box being empty, show loading state if regions.length is empty which implies the assembly is loading (could try to do undefined also if it is of interest but we have a assembly?.regions||[])

Some small refactorings added also, but the main issue fixed by the above description

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Feb 24, 2023
@cmdcolin cmdcolin added bug Something isn't working and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Feb 24, 2023
@cmdcolin cmdcolin force-pushed the fix_empty_refname_autocomplete branch from a7059f4 to 1ca6a13 Compare February 24, 2023 19:09
@cmdcolin cmdcolin force-pushed the fix_empty_refname_autocomplete branch from 1ca6a13 to 1b5cd46 Compare February 24, 2023 20:07
@rbuels
Copy link
Contributor

rbuels commented Feb 24, 2023

This is a good change. Uses an explicit loaded rather than assuming that something is still loading if it's empty.

@cmdcolin cmdcolin force-pushed the fix_empty_refname_autocomplete branch from 4ee3b4d to ad6f54e Compare February 24, 2023 20:41
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Feb 24, 2023

Uses an explicit loaded rather than assuming that something is still loading if it's empty.

This was actually not the main deliverable of this PR, and I have to apologize for the extra noise around it.

In fact, this part of the codebase was unused, so I removed it entirely now. That check was inside the RefNameAutocomplete to show a spinner as an endAdornment of the searchbox itself if assembly.regions is not loaded, but this was never run anyways because the RefNameAutocomplete would be hidden if assembly.regions was undefined.

The main fix of the PR is in LinearGenomeView->ImportForm.tsx, and I created a "assemblyLoaded" variable now toggled on assembly.regions being defined

@cmdcolin cmdcolin force-pushed the fix_empty_refname_autocomplete branch from ad6f54e to 8390646 Compare February 24, 2023 20:47
@cmdcolin cmdcolin merged commit ef548c6 into main Feb 24, 2023
@cmdcolin cmdcolin deleted the fix_empty_refname_autocomplete branch February 24, 2023 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants