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 page rolls back to initial state whenever a new search filter is added/removed. #9738

Open
1 task done
gakshita opened this issue Nov 6, 2023 · 12 comments · May be fixed by #10276
Open
1 task done

[BUG] Search page rolls back to initial state whenever a new search filter is added/removed. #9738

gakshita opened this issue Nov 6, 2023 · 12 comments · May be fixed by #10276
Assignees
Labels
🛠 goal: fix undefined 🔢 points: 3 undefined 🏁 status: ready for dev You can asked for this issue to be assigned (if not already assigned)

Comments

@gakshita
Copy link

gakshita commented Nov 6, 2023

Has this bug been raised before?

  • I have checked "open" AND "closed" issues and this is not a duplicate

Where did you find this bug?

Production

Version of BioDrop (for example "v1.2.3")

v2.84.4

Description

On the search page, when multiple filters are selected whenever a new filter is added/removed the display data rolls back to the initial state for a moment and then displays the new data.
For example if I have selected react, then the result will be shown for react then if i also select python then for a few seconds i will see the initial unfiltered search result and then the result for react+python filter

Screenshots

No response

Do you want to work on this issue?

Yes

If "yes" to above, please explain how you would technically implement this

No response

@gakshita gakshita added 🚦 status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) 🛠 goal: fix undefined labels Nov 6, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

To reduce notifications, issues are locked until they are 🏁 status: ready for dev You can asked for this issue to be assigned (if not already assigned) and to be assigned. You can learn more in our contributing guide https://github.com/EddieHubCommunity/BioDrop/blob/main/CONTRIBUTING.md

@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2023
@amandamartin-dev
Copy link
Contributor

Confirmed this bug is happening and I will unlock, however, I am not able to assign this issue to you as you have not explained your approach to solve this. Can you please add more detail on what you would like to do to address the issue?

@amandamartin-dev amandamartin-dev added 🏁 status: ready for dev You can asked for this issue to be assigned (if not already assigned) and removed 🚦 status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) labels Nov 10, 2023
@github-actions github-actions bot unlocked this conversation Nov 10, 2023
Copy link
Contributor

The issue has been unlocked and is now ready for dev. If you would like to work on this issue, you can comment to have it assigned to you. You can learn more in our contributing guide https://github.com/EddieHubCommunity/BioDrop/blob/main/CONTRIBUTING.md

@amandamartin-dev amandamartin-dev changed the title Search page rolls back to initial state whenever a new search filter is added/removed. [BUG] Search page rolls back to initial state whenever a new search filter is added/removed. Nov 10, 2023
@pratik9818
Copy link
Contributor

pratik9818 commented Nov 11, 2023

I would like to work on this issue , can you assign this to me . I know I have another issue, but I solved it and sent a pull request , waiting for getting merge.

ℹ️ pratik9818 has some opened assigned issues: 🔧View assigned issues

@jatingodnani
Copy link

Interested

@SaraJaoude
Copy link
Member

@pratik9818 your PR for your existing issue will need to be merged before we assign another issue to you. This ensures a fair approach and gives everyone an opportunity to contribute.

In any event, as Amanda mentioned (@jatingodnani please also take note of this) - this issue cannot be assigned until whoever is looking to work on it explains their approach to resolving it.

@jatingodnani
Copy link

@SaraJaoude, I found the bug in the code. We are rendering two things: 'users' and 'visibleUsers.' 'Users' contains an array of updated users, while 'visibleUsers' contains an array of search results due to a query from the 'users' array. 'VisibleUsers' takes some time to render, so I added a loading indicator. We don't need to render updated users every time; we only show updated users if the input box is empty.

@amandamartin-dev
Copy link
Contributor

@SaraJaoude, I found the bug in the code. We are rendering two things: 'users' and 'visibleUsers.' 'Users' contains an array of updated users, while 'visibleUsers' contains an array of search results due to a query from the 'users' array. 'VisibleUsers' takes some time to render, so I added a loading indicator. We don't need to render updated users every time; we only show updated users if the input box is empty.

Thank you for explaining the approach you would like to take. I will assign this to you to begin work on the proposed solution.

@SaraJaoude
Copy link
Member

Unassigning for this reason: #9788 (comment)

@stefanzmf
Copy link

I see this is no longer assigned. Noticed it does not have the [good first issue] label, but still has 3 or less points. I managed to setup the env locally and I would like to work on it by doing the following:

  • create a reusable Loading component under components folder
  • keep the loading flag as a state and set it to true/false inside the fetchUsers method (true when starts, false when ends with success/error)
  • when the loading is true render the reusable Loading component, otherwise render the actual users list

Extra:

  • maybe add some loading delay support just not to have the loading spinner flickering if the loading time is very short
  • get rid of the extra logic of rendering the list with {users.length < usersPerPage && and {users.length > usersPerPage && since const visibleUsers = users.slice(indexOfFirstUser, indexOfLastUser); will always return the visible users in range even if the indexOfLastUser is bigger than the actual users array

@sital002
Copy link
Member

@stefanzmf Assigning the issue to you

@stefanzmf
Copy link

stefanzmf commented Mar 14, 2024

Opened the PR. Please let me know if there are further steps that needs to be done from my side. Thank you

ℹ️ stefanzmf has some opened assigned issues: 🔧View assigned issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 goal: fix undefined 🔢 points: 3 undefined 🏁 status: ready for dev You can asked for this issue to be assigned (if not already assigned)
Projects
None yet
7 participants