jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Auto-Completion in search bar not working until switching tabs

Open LoayGhreeb opened this issue 1 year ago • 7 comments

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

  1. Start JabRef and open a library from files.
  2. Write in the search bar.
  3. The auto-completion is not working.
  4. Open another library.
  5. 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

LoayGhreeb avatar Jun 25 '24 14:06 LoayGhreeb

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.

xiaojie2008 avatar Oct 09 '24 11:10 xiaojie2008

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! 🚀

github-actions[bot] avatar Oct 09 '24 11:10 github-actions[bot]

Search is currently under heavy rework, so I hope there will not be any conflicts. See https://github.com/JabRef/jabref/pull/11803.

ThiloteE avatar Oct 09 '24 15:10 ThiloteE

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.

xiaojie2008 avatar Oct 10 '24 00:10 xiaojie2008

@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. Image

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). Image

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. Image Image

Kindly ask for your guidance, thank you very much.

xiaojie2008 avatar Oct 13 '24 13:10 xiaojie2008

@xiaojie2008, ensure that auto-completion is enabled in the preferences. Image

LoayGhreeb avatar Oct 13 '24 13:10 LoayGhreeb

@xiaojie2008, ensure that auto-completion is enabled in the preferences. Image 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.

xiaojie2008 avatar Oct 14 '24 07:10 xiaojie2008

Implementation hints: https://github.com/JabRef/jabref/pull/12060#issuecomment-2431699530

koppor avatar Dec 09 '24 20:12 koppor

/unassign @xiaojie2008

koppor avatar Dec 09 '24 20:12 koppor

👋 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.

github-actions[bot] avatar Dec 09 '24 20:12 github-actions[bot]

MOre info https://github.com/JabRef/jabref/pull/12060#issuecomment-2431699530

Siedlerchr avatar Dec 09 '24 20:12 Siedlerchr

/assign-me

harii55 avatar Sep 02 '25 14:09 harii55

👋 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! 🚀

github-actions[bot] avatar Sep 02 '25 14:09 github-actions[bot]

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.

github-actions[bot] avatar Sep 04 '25 10:09 github-actions[bot]