HGVSnomenclature / hgvs-nomenclature

HGVS Nomenclature website
https://hgvs-nomenclature.org/
MIT License
5 stars 6 forks source link

Optimize search feature #143

Open ifokkema opened 9 months ago

ifokkema commented 9 months ago

The search feature could use some fixing. I don't know how it's implemented, so this may require discussion or somebody else to step in and fix it.

Screenshot_2024-02-05_12-13-19

When searching for indel, I've noticed the following two issues;

ahwagner commented 2 weeks ago

I looked into this a little; I'm not sure this is something we can address ourselves. It would likely require working with the MkDocs-Material maintainers. This issue thread seems to focus on this specific challenge across implementations.

One workaround, provided in this comment, addresses the issue:

.md-search-result .md-typeset {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 120px; /* <- adjust to fit */
}

However, I think this just makes our results look worse by truncating the actual occurrences of the search term, e.g.: image

ifokkema commented 1 week ago

Thanks for checking this out, Alex!

I looked into this a little; I'm not sure this is something we can address ourselves. It would likely require working with the MkDocs-Material maintainers. This issue thread seems to focus on this specific challenge across implementations.

Right... looks like we'll just have to wait until they rebuild that search feature, then. It'll maybe also solve the current mismatches that I mentioned.

One workaround, provided in this comment, addresses the issue:

.md-search-result .md-typeset {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 120px; /* <- adjust to fit */
}

However, I think this just makes our results look worse by truncating the actual occurrences of the search term (...)

Hmmm... the CSS has no clue where the search term occurs, so it will just blindly truncate the boxes. In this example, you can still see a tiny bit of the term match on the "Older versions" page, but that's just luck. Perhaps, if we'd increase the size of the given max-height to something longer, it will show a bit more of those long results, but not excessively much. I do think it's a good workaround because matches on the glossary page make a search very difficult. Or, another possibility is that we break up long lists into separate lists. This may not change how the list is rendered much, but it should improve the search a lot. It will, however, require a massive amount of changes to work. I could test it out a bit on one page and see how it looks... what do you think?