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

[Feature Request] Highlight search results #525

Closed
thequilo opened this issue May 13, 2024 · 7 comments
Closed

[Feature Request] Highlight search results #525

thequilo opened this issue May 13, 2024 · 7 comments
Labels
feature-request New feature request

Comments

@thequilo
Copy link

Describe your feature request

It would be nice to highlight the words that match the query in the search results. For me, it makes it much easier to find the item I am looking for when I see the matched words highlighted.

@thequilo thequilo added the feature-request New feature request label May 13, 2024
@GeoffreyChen777
Copy link
Member

From the programming implementation aspect, this is difficult

@thequilo
Copy link
Author

I can imagine that. How about doing this just for the simple search and add a second pass, after matching, with something along the lines of result.replace(query_word, "<span class=highlight>" + query_word +"</span>")?

@GeoffreyChen777
Copy link
Member

Thanks for your suggestion, will consider that

@igoogolx
Copy link
Member

We can use https://github.com/kawamataryo/vue-word-highlighter with less code.

@GeoffreyChen777
Copy link
Member

GeoffreyChen777 commented May 13, 2024

@igoogolx that looks pretty good!

Currently, we can get the searing string:

commandBarText: string;

with vue-word-highlighter, it would be easy to implement this feature.

However, we still need to test the rendering performance to make sure it will not slow down the UI if we have numerous papers.

@GeoffreyChen777
Copy link
Member

Seems the performance is ok. #528

This will be available with the next version.

image

@thequilo
Copy link
Author

Thanks a lot!

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

No branches or pull requests

3 participants