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

Bug: Search fields redirects to 404 error page #3949

Closed
Mandeep56Singh opened this issue Aug 14, 2024 · 23 comments · Fixed by #3959
Closed

Bug: Search fields redirects to 404 error page #3949

Mandeep56Singh opened this issue Aug 14, 2024 · 23 comments · Fixed by #3959
Assignees
Labels
accepting prs Accepting PRs from 🐛 bug Something isn't working released on @beta released

Comments

@Mandeep56Singh
Copy link
Contributor

Describe the bug

OpenSauced.Insights.-.Javascript._.Dashboard.mp4

Steps to reproduce

  1. Go to Explore
  2. Search any repositories
  3. You will be directed to error page
@Mandeep56Singh Mandeep56Singh added 🐛 bug Something isn't working 👀 needs triage labels Aug 14, 2024
Copy link
Contributor

Thanks for the issue, our team will look into it as soon as possible! If you would like to work on this issue, please wait for us to decide if it's ready. The issue will be ready to work on once we remove the "needs triage" label.

To claim an issue that does not have the "needs triage" label, please leave a comment that says ".take". If you have any questions, please comment on this issue.

For full info on how to contribute, please check out our contributors guide.

@MegaGonz
Copy link

.take

Copy link
Contributor

The issue you are trying to assign yourself is blocked until it can be triaged or by another label on the issue.

@Mandeep56Singh
Copy link
Contributor Author

@adamgonzo have you checked in your system ? do you get the same issue ?

@MegaGonz
Copy link

@Mandeep56Singh yes i get the same issue

@Mandeep56Singh
Copy link
Contributor Author

Mandeep56Singh commented Aug 15, 2024

@adamgonzo I find it kinda weird that search suggest any repo in search repositories field, I should only suggest repos based on seleted topic.
Like I seleted typescript then It should only suggest repos based on it. Otherwise there is no use of it. We also have search field at top which can also be used for the searching any kind of repo

@MegaGonz
Copy link

@Mandeep56Singh from what i understand you are saying that once you select a topic the search should only present repositories within that topic ?

@Mandeep56Singh
Copy link
Contributor Author

@adamgonzo yeah, because repositories are shown based on selected topic and we are using search filed so to find the repo under that topic fast.

@brandonroberts
Copy link
Contributor

Thanks @Mandeep56Singh @adamgonzo. The URL path should begin with /explore/topic/{topic}/... instead of /{topic}/....

@brandonroberts brandonroberts added accepting prs Accepting PRs from and removed 👀 needs triage labels Aug 15, 2024
@MegaGonz
Copy link

.take

@Mandeep56Singh
Copy link
Contributor Author

hey I was also intrested in solving this issue too 😅
but no worries

@Mandeep56Singh
Copy link
Contributor Author

@brandonroberts @adamgonzo I have resolved this issue

OpenSauced.Insights.-.Javascript._.Dashboard.-.Google.Chrome.2024-08-15.23-48-15.mp4

should I create a pr ?

@brandonroberts
Copy link
Contributor

@Mandeep56Singh if @adamgonzo wants to defer to you, that's fine. They did try to pick it up initially

@MegaGonz
Copy link

@brandonroberts thats totally fine I won't be able to get till it till 5 pm anyways and it's an issue that is affecting users so it's okay with me

@MegaGonz
Copy link

Issue persist when you also press enter with blank field

@Mandeep56Singh
Copy link
Contributor Author

@adamgonzo also happen when clicking cross icon.

@Mandeep56Singh
Copy link
Contributor Author

Mandeep56Singh commented Aug 16, 2024

@brandonroberts It seems that in handleOnSearch within repositories.tsx, the following code is responsible for the issue:

const handleOnSearch = (search?: string) => {
    if (selectedFilter && !search) {
      return router.push(`${topic}/${toolName}`);
    }
    if (search && /^[a-zA-Z0-9\-\.]+\/[a-zA-Z0-9\-\.]+$/.test(search)) {
      return router.push(`/explore/topic/${topic}/${toolName}/filter/${search}`);
    }
  }; 

The first if condition is causing the problem when the search query is empty, directing the user to a weird page. This could be fixed by updating the route as we did in the second condition. But then when user enter the empty query the page direct to
current page and all filter get cleared.
My question is when search field is empty why we need to use router , there is no need for first if ?

@brandonroberts
Copy link
Contributor

@Mandeep56Singh yes, the path in the first condition should match. We support that way also so you can clear the search box after filtering for a specific repository

@Mandeep56Singh
Copy link
Contributor Author

@brandonroberts
It is also affecting the clear button.
When a user selects a filter and unintentionally inputs the wrong text, clicking the 'clear' button currently clears all fields, including the selected filters. This could lead to a poor user experience, as the user may lose their filters and have to reselect them. It might be better to only clear the text field, preserving the filters.

@brandonroberts
Copy link
Contributor

Maybe. I think we should fix the 404 navigation first, then revisit the UX separately.

@MegaGonz
Copy link

@brandonroberts i can fix the error clearing, and the error if user leaves input box blank and presses enter it leaded them to a 404 page

Copy link
Contributor

open-sauced bot commented Aug 22, 2024

🎉 This issue has been resolved in version 2.60.0-beta.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link
Contributor

open-sauced bot commented Aug 22, 2024

🎉 This issue has been resolved in version 2.60.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@open-sauced open-sauced bot added the released label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Accepting PRs from 🐛 bug Something isn't working released on @beta released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants