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

fix: persist ranking on search #7048

Merged
merged 8 commits into from
Aug 21, 2024
Merged

Conversation

VIKTORVAV99
Copy link
Member

@VIKTORVAV99 VIKTORVAV99 commented Aug 1, 2024

Issue

The ranking panel used the index as the ranking but this always changed when searching in meaning if you searched a single zone it would always be ranked as 1.

Description

This PR rewrites the whole filtering and sorting logic to account for this and persist the ranking even in searches, something that it looked like it was always intended to do as there was already a ranking property that was always set to undefined.

As a bonus it will now also match using the zone key.

This should partially help with the issue described in #6971

TODO:

  • Add tests.

Preview

On master

image

On this branch

image

Double check

  • I have run pnpx prettier@2 --write . and poetry run format in the top level directory to format my changes.

Copy link
Collaborator

@tonypls tonypls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as nice extra feature would be that the search value doesn't get lowercased from the user perspective.

@VIKTORVAV99
Copy link
Member Author

LGTM, as nice extra feature would be that the search value doesn't get lowercased from the user perspective.

I have a few things to follow up on this (like searching in English should always work no matter the language) so I can add that as well.

@VIKTORVAV99 VIKTORVAV99 enabled auto-merge (squash) August 21, 2024 07:39
@VIKTORVAV99 VIKTORVAV99 merged commit e03e55d into master Aug 21, 2024
21 checks passed
@VIKTORVAV99 VIKTORVAV99 deleted the vik/persist_ranking_on_search branch August 21, 2024 07:43
@strassburger
Copy link
Contributor

looks like solved:
the issue described in #6971
Thanks for fixing.
Rainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants