-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Record search history #9647
Record search history #9647
Conversation
} | ||
|
||
public List<String> getLastSearchHistory(int size) { | ||
List<String> lastSearches = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check if there can some code be shared as a new list type with the FileHistory class? I remember that I worked some time ago with a similar mechanic to limit the max number of entries in the list.
src/main/java/org/jabref/gui/search/SearchFieldRightClickMenu.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/search/SearchFieldRightClickMenu.java
Outdated
Show resolved
Hide resolved
Tested it locally works fine! |
I played around with this feature locally and I noticed that sometimes if I type the search query slowly enough, some of the prefixes of the query are recorded along the actual query. Not having a search button that starts the search task made it hard to select the correct time to perform the search. Currently, JabRef waits for the search box to be idle for 400ms and then performs the query. This is a good time to show the search results because JabRef will feel more interactive, but not so good for adding the query to the history because the user may be unhappy with the results and continue to modify the query, or he may simply be a slow typist like myself :^) I gave this some thought and these are a few suggestions: 1. Record query when the search box loses focus
Looking at the workflow above, it seems best to record the search query after step 4: User selects the entry he/she is searching for a.k.a the search box loses focus. 2. Merge recorded search queries with a certain similarity score that were recorded in a close timestamp After a query is recorded the algorithm would loop through the list of the recorded queries and decides if the new query could be an update to an older query. It goes like this:
|
I would suggest we merge this current as is, and I will move @HoussemNasri comment to a follow up issue |
Fixes #7906

CHANGELOG.md
described in a way that is understandable for the average user (if applicable)