jabref
jabref copied to clipboard
Auto-Completion in search bar not working until switching tabs
JabRef version
5.13 (latest release)
Operating system
Windows
Details on version and operating system
Windows 11
Checked with the latest development build (copy version output from About dialog)
- [X] I made a backup of my libraries before testing the latest development version.
- [X] I have tested the latest development version and the problem persists
Steps to reproduce the behaviour
- Start JabRef and open a library from files.
- Write in the search bar.
- The auto-completion is not working.
- Open another library.
- Return to the first one, and the auto-completion will work.
This is because of the binding of the selected tab:
https://github.com/JabRef/jabref/blob/6f6042d982b0ac10ca7813acd837f88ec5f43b27/src/main/java/org/jabref/gui/frame/JabRefFrame.java#L363 is responsible for setting the auto-completer for the search bar: https://github.com/JabRef/jabref/blob/6f6042d982b0ac10ca7813acd837f88ec5f43b27/src/main/java/org/jabref/gui/frame/JabRefFrame.java#L382-L383 This will not be fired after dataLoadingTask is finished (because the tab is already selected and showing a loading table) https://github.com/JabRef/jabref/blob/06786ec7dd876e8bd4dc4e3046b61d914c257865/src/main/java/org/jabref/gui/LibraryTab.java#L259 (dataLoadingTask will set up the auto-completer but it will not be used in the search bar until switching to another tab).
Appendix
...
Log File
Paste an excerpt of your log file here
Hi, we are @BaronMac08, @Thomas-Bridgart, @xiaojie2008, and Maggie Sun, students at the Australian National University. For one of our assignments, we are tasked with contributing to an open-source project. We would like to take on this issue, and I will be the main contributor.
After reading through your description and code, I am confident that I can fix this bug. I would appreciate it if you could assign this issue to me.
While working, we will cross-review our code and support each other to ensure efficient progress. Once the code meets all the requirements, I will submit a pull request for your review.
Welcome to the vibrant world of open-source development with JabRef!
Newcomers, we're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.
In case you encounter failing tests during development, please check our developer FAQs!
Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.
Happy coding! 🚀
Search is currently under heavy rework, so I hope there will not be any conflicts. See https://github.com/JabRef/jabref/pull/11803.
Search is currently under heavy rework, so I hope there will not be any conflicts. See #11803.
Thanks for the heads up! I'll check out #11803 to see what the search refactoring looks like and make sure my changes don't conflict with current work.
@LoayGhreeb hi, I encountered some problems while reproducing the bug, and I am unsure whether it is solely a tab binding issue, a combination with search problems, or something else altogether. I'm running the latest development version (v5.15) on Windows 11. Following the steps you provided to reproduce the behavior, I reached the final step, but the auto-completion still does not work.
After inspecting the code and using logging for debugging, I found the following:
In jabref/src/main/java/org/jabref/gui/LibraryTab.java, at line 550 (commit: [4644e8d]), the value of autoCompletePreferences.shouldAutoComplete() is false.
Since I added System.out.println("AutoComplete is enabled: " + this.shouldAutoComplete.get()); at the end of the AutoCompletePreferences constructor and found that this.shouldAutoComplete.get() is always false(at the arrow).
This causes the auto-completion to be deactivated, and it directly runs the logic at line 557 to create empty suggestion providers(See the first screenshot).
Additionally, I double-checked and confirmed that the two loaded bib files (as shown in the images) don't seem to be related to the issue.
Kindly ask for your guidance, thank you very much.
@xiaojie2008, ensure that auto-completion is enabled in the preferences.
@xiaojie2008, ensure that auto-completion is enabled in the preferences.
Thank you very much! I was able to successfully reproduce the bug. I will follow your suggestion and look into the binding of the selected tab issue.
Implementation hints: https://github.com/JabRef/jabref/pull/12060#issuecomment-2431699530
/unassign @xiaojie2008
👋 Hey @xiaojie2008, you've been automatically unassigned from this issue due to inactivity.
[!NOTE] If you'd like to be re-assigned, just leave another comment or ask a maintainer to assign you again. If you're still actively working on the issue, let us know by commenting, and we can pin it to prevent automatic unassignment.
MOre info https://github.com/JabRef/jabref/pull/12060#issuecomment-2431699530
/assign-me
👋 Hey @harii55, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality and the code base, you can consult the JabRef Guru or ask on our Gitter chat.
In case you encounter failing tests during development, please check our developer FAQs!
Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.
Happy coding! 🚀
We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.
For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/13816.