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

Using back/forward buttons on search results page does not update the text in the search textfield #121

Open
anilnatha opened this issue Nov 14, 2024 · 5 comments · May be fixed by #153
Open
Assignees
Labels
B15.1 bug Something isn't working i&t.skip Skip I&T of this task/ticket sprint-backlog task

Comments

@anilnatha
Copy link
Collaborator

💡 Description

There is an issue on the search page when using the back/forward browser buttons.

How to reproduce issue:

If you start a search on the homepage using the search header for say "mars":

image

Then when you hit enter you arrive on the search results page:

image

Do another search with the term "jupiter" in the text field in the body of the page:

image

Then you see the "jupiter" results:

image

Then click the back button, you'll see the textfield on the search page doesn't update, but the results show the "mars" results:

image

⚔️ Parent Epic / Related Tickets

No response

@eddiesarevalo
Copy link
Member

This issue is caused by the search bar in the search screen being uncontrolled. Its uncontrolled because the amount of checkboxes slows the page down considerably. The filters can't be redrawn on textbox state change without causing this. Therefore will attempt to change to controlled with the import { useDebouncedCallback } from "use-debounce" solution that is used in the instruments page.

While testing for this more bugs were found on the home page:

  • Selecting multiple dropdowns in homepage doesn’t show on search correctly. The results not found message to allow removal doesn’t render right and the filters don't show checked.
  • Clicking x on a selected dropdown in search will show “0 selected” instead of all on the home page.
  • all still shows in page_type search page.

@eddiesarevalo
Copy link
Member

Adding one more bug.

Certain search text for example "arecibo" will just cause a crash:
Screenshot 2025-01-27 at 1.23.04 PM.png

@eddiesarevalo
Copy link
Member

eddiesarevalo commented Jan 27, 2025

Debouncer solution did not work. The underlying issues are different.In the investigations page its a lag when displaying the results. In the search page its a lag when updating the state value of the search box. Used an alternative solution that sets the uncontrolled value of the input box using basic javascript and ids.

@eddiesarevalo
Copy link
Member

Another bug:
On the home page, if returning from back,then selecting a checkbox and searching again will clear out the text from the url causing a new search to omit the search text.

eddiesarevalo added a commit that referenced this issue Jan 27, 2025
-Added fix to update search box when navigating from back or forward in history.
-Added fix for invalid investigation lids causing crash. Example search for "arecibo"
eddiesarevalo added a commit that referenced this issue Jan 27, 2025
-Added fix to keep the value of the search text when returning from the back button and then selecting a new checkbox.
eddiesarevalo added a commit that referenced this issue Jan 27, 2025
-Fixed the message that shows on the search page when unrelated filters are selected from the home page.
eddiesarevalo added a commit that referenced this issue Jan 27, 2025
-Fixed the label showing as "0 selected" instead of "all" when the filter chip X button is clicked.
-The "all" checkbox is now shown as checked when all chips are deselected.
eddiesarevalo added a commit that referenced this issue Jan 27, 2025
-The all value is removed from single select filters since it should not be able to be selected. It is already acting as if all is selected when nothing is selected.
@eddiesarevalo eddiesarevalo linked a pull request Jan 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B15.1 bug Something isn't working i&t.skip Skip I&T of this task/ticket sprint-backlog task
Projects
Status: ToDo
Development

Successfully merging a pull request may close this issue.

2 participants