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

feat(mandelbrot): improve variants searchability #984

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

mihkeleidast
Copy link
Member

Should resolve #962.

Made some improvements to the search as well.

  • Mainly, instead of directly looking for text matches in DOM, I now look for <mark> elements. That's because the highlighting via mark.js takes place before traversing the navigation to open/close things. Since mark.js actually does the search as well, it should be fine to use its results instead of trying to come up with my own.
  • The previous change has the side effect of making search a bit fuzzier. E.g. if searching for multiple words, the results to not have to include all keywords, instead only one.
  • Search now looks at the navigation group title as well. That is partially because of the issue highlighted in Searching hides component variants in split variant navigation #962, but additionally because of the functionality to pull collections to root. This change should make searching for collections behave the same for root and non-root collections. Example: if a root collection is labelled "root", but does not have any subitems that include the word "root", it should be kept visible in the navigation.
  • Search now also looks at variant collections of not-current components and shows/hides them appropriately. This should fix the issue brought up in #775 (comment), which was really the previous behavior from pre-split navigation.

@mihkeleidast mihkeleidast changed the title fix(mandelbrot): improve variants searchability feat(mandelbrot): improve variants searchability Apr 25, 2021
@mihkeleidast mihkeleidast merged commit 96f5099 into main Nov 4, 2021
@mihkeleidast mihkeleidast deleted the fix/search-variants branch November 4, 2021 18:16
khamer pushed a commit to imarc/fractal that referenced this pull request Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Searching hides component variants in split variant navigation
1 participant