Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Search bar result count always displays "no results" #726

Closed
1 task done
sarayourfriend opened this issue Jan 26, 2022 · 8 comments · Fixed by #833
Closed
1 task done

Search bar result count always displays "no results" #726

sarayourfriend opened this issue Jan 26, 2022 · 8 comments · Fixed by #833
Labels
♿️ aspect: a11y Concerns related to the project's accessibility bug Something isn't working 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP

Comments

@sarayourfriend
Copy link
Contributor

Description

The search bar result count just displays "no results" for every search regardless of how many results actually exist.

Reproduction

  1. Visit https://wordpress.org/openverse/search/?q=birds and check out the search bar. It will say "no results"

Expectation

It should say the number of results following the rules we originally had for that count.

Additional context

Marking this as a11y and critical as screen reader users could easily be confused by this and thing their search yielded no results.

Resolution

  • 🙋 I would be interested in resolving this bug.
@sarayourfriend sarayourfriend added 🟥 priority: critical Must be addressed ASAP 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🛠 goal: fix Bug fix ♿️ aspect: a11y Concerns related to the project's accessibility labels Jan 26, 2022
@sarayourfriend sarayourfriend self-assigned this Jan 26, 2022
@krysal
Copy link
Member

krysal commented Jan 26, 2022

I am seeing the correct text:

CleanShot 2022-01-26 at 10 59 12@2x

I have seen this problem before though, or it just shows the number of an old search result, but I thought it was due to a bad connection. It can be difficult to reproduce.

@sarayourfriend
Copy link
Contributor Author

Interesting. The other thing I'm noticing is that on the initial render it will show "no results" and then switch to "over 10k". Given we already know the result count during SSR I'm not sure why the first render says "no results" 🤔 Maybe there's a way where it gets stuck on that initial render somehow?

@zackkrida
Copy link
Member

I'm not able to reproduce scenarios where the incorrect count displays in the header, but I do see the flash of 'no results' on initial render and that would be great to resolve.

@obulat
Copy link
Contributor

obulat commented Jan 28, 2022

I cannot figure out how to watch the store for changes. The SSR is supposed to be set up so that whenever the result count changes, the search bar result also updates, but it doesn't work. I've tried using a watcher in the setup function (for store.state.media.results or for store.getters['media/resultsCount']), but they are never called :(

I hope that when we update to Pinia, this problem will be solved.

@sarayourfriend sarayourfriend removed their assignment Jan 31, 2022
@zackkrida zackkrida added the bug Something isn't working label Feb 4, 2022
@krysal
Copy link
Member

krysal commented Feb 7, 2022

Lately, I notice more that it stays in the "Loading..." state (the main branch, not production). Perhaps this is a silly question but @obulat making the searchStatus of the VHeader a computed property didn't work for some reason? Locally looks like it solves the issue for me.

@krysal krysal removed the 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work label Feb 7, 2022
@sarayourfriend
Copy link
Contributor Author

I've noticed that behavior locally too @krysal. It doesn't happen in prod or https://search-dev.openverse.engineering so I'm not sure what the issue is locally 🤔

@zackkrida
Copy link
Member

I'm seeing the same behavior locally

@obulat
Copy link
Contributor

obulat commented Feb 8, 2022

I have noticed the "Loading..." state, too, @krysal , and I'm not sure what the reason for it is.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
♿️ aspect: a11y Concerns related to the project's accessibility bug Something isn't working 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants