-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Click on entry at "Check integrity" focus bug fixed #12022
Conversation
…); to make sure that focus goes to the field even when dialog window is opened
@koppor |
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.
Please re-iterate on the issue description: #11997
Here, especially for you, another description.
-
Start JabRef
-
Open
chocolate.bib
- you find it at https://github.com/JabRef/jabref/blob/main/src/test/resources/testbib/Chocolate.bib -
Seelct entry "Cocoa and Cardiovascular Health"
-
Select tab "General" in Entry editor
-
Go to Menu "Quality"
-
Click on "Check integrity"
-
See that nothing happens
In Step 9, the tab "Requried fiels" and the field "Citatoinkey" should be focused.
Thank you for your feedback! Will do my best! |
@koppor
|
It should focus on the field that is reported in the integrity check |
Thank you for your response! I'm pretty new to this project. Would it be possible to share a little detailed description? If not, I will do my best to figure all out myself. |
@Siedlerchr Please let me know if I misunderstand you! Thank you! |
That is indeed correct, however, in my tests jumping to another tab only works sometimes:
However, if I now select the general Tab of an entry, I am able to jump to it/again to it Please check why the tab needs to have been selected first |
Oh now I understand where you are getting at! Thank you! |
@Siedlerchr, @koppor Hello! Is this issue still relevant? If so, I would love to continue working on it 😄 File that I suspect contains a bug: |
Sure, that's great to here! You can continue with your PR for this issue |
@Siedlerchr Hello again! |
@mulla028 We need to be fair to all contributors. We try to treat them equally. First, resolve issue #11997 completely. At least one case of it does not work. Thus, maybe the code is buggy and should be changed. If there are follow-up issues, we can create other issues. - But for a single line of code added and not fixing everything, there should be more time spend for a solution. I fully understand that UI programming is hard, because it is very much trial and error. - The hint is to spend time to a minimal working example: Creating a new application from scratch and trying to replicate the issue there - and fixing it there. Then porting back the fix. https://github.com/Siedlerchr/javafxreproducer can be a start. |
Alright, I just tried. If you never try - you never know 😆 |
@Siedlerchr @koppor I noticed that #11997 fixed in one of the PRs. Once updated my branch I witnessed that everything works as you expected: |
@Siedlerchr Can you refine?
I go to Then, I do "Check integrity" Then, I click Is this a macOS / Windows thing? Timing maybe? |
Note that double click does not work, it is a single click! |
I updated the issue title. - Please update the PR description and add a CHANGELOG.md entry, too. |
Proposal to proceed:
|
Do I have to disable single click, and set focus on double click only, right? OS: macOS Sequoia 15.1.1 UPD: According to the new issue title. I guess, I have to leave single click option |
Might need to verify again but it could be that it got fixed by chance
through another commit
Amir Mullagaliev ***@***.***> schrieb am Do., 28. Nov. 2024,
22:14:
… Note that double click does not work, it is a single click!
Do I have to disable single click, and set focus on only double click,
right?
OS: macOS Sequoia 15.1.1
—
Reply to this email directly, view it on GitHub
<#12022 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACOFZC73WZ4XUWVSDEGFA32C6BRXAVCNFSM6AAAAABQG7LQUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBWG43DEMBXHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Probably it got fixed in one of these PRs: #12165 , #12034. But I'm not sure... |
I found another problem that prevents me from focusing e.g., if I try to select entry with Everything that I described is demonstrated in video below! Screen.Recording.2024-11-28.at.7.50.05.PM.mov |
The reason why It starts inside of change.getAddedSubList().stream().findFirst().ifPresent(message ->
libraryTab.editEntryAndFocusField(message.entry(), message.field()));
|
Then try to force opening the tab. Maybe it is as simple as wrapping in |
Yeah, first step for the brain teaser.
|
There is a method getfieldOrAlias...
|
This is the other way round!
|
@koppor @Siedlerchr Thank you for your feedback! Will try to make everything work! |
Alright, I fixed focus for |
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.
Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.
@koppor @Siedlerchr Screen.Recording.2024-11-29.at.10.19.05.AM.mov |
Please test with multiple open libraries as well |
@@ -468,6 +468,7 @@ public void setFocusToField(Field field) { | |||
Field actualField = field; | |||
boolean fieldFound = false; | |||
for (Tab tab : tabbed.getTabs()) { | |||
tabbed.getSelectionModel().select(tab); |
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.
This looks not right without a condition. What happens with multiple open libraries?
Actually there is a condition below. Why is that not triggered?
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.
It works well with multiple opened libraries, just tested.
What condition specifically are you talking about , the very first one inside of for-loop?
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.
Answering the question, why that is not triggered, for the reason, that fieldEditorTab
has a lazy initialization
, so it doesn't render the fields unless tab opened at least once, that's why I added line 471. I updated description, at the top of this PR, there I described all the changes.
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.
Thanks!
Just have tested, works with other libraries that include |
Do you have any other concerns, imo - the only change that I should do is to remove line 468 |
If you have concerns regarding iteration through the |
Tested it, works fine, also with custom field |
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.
Code is OK enough.
I left comments for a follow-up. But we merge now to free energy for finishing other PRs.
@@ -463,11 +465,26 @@ private void fetchAndMerge(EntryBasedFetcher fetcher) { | |||
|
|||
public void setFocusToField(Field field) { | |||
UiTaskExecutor.runInJavaFXThread(() -> { | |||
Field actualField = field; |
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.
This is not necessary as you use recursion in line 484.
// This line explicitly brings focus back to the main window containing the Entry Editor. | ||
getScene().getWindow().requestFocus(); |
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.
I would have wrapped that into Platform.runlater
, too (and before the runLater
above)
// This line explicitly brings focus back to the main window containing the Entry Editor. | ||
getScene().getWindow().requestFocus(); | ||
fieldFound = true; | ||
break; |
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 be a return
.
break; | ||
} | ||
} | ||
if (!fieldFound) { |
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.
If guard can be removed if you use return in 481.
@koppor @Siedlerchr |
@mulla028 That's great to hear and thanks for coming back and finishing this. |
Thank you so much! |
Description
This PR aims on a bug fix, when user was clicking on entry at
Check Integrity
, entry was focused, but not a field inentry editor
.Changes
In
src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
two lines of code were added tosetFocusToField()
tabbed.getSelectionModel().select(tab);
getScene().getWindow().requestFocus();
Field
wasn't selected , so it continues to check ifALIAS
of that field exists, ifALIAS
exists, if so, it replacesField
to it'sALIAS
, otherwise nothing happens.This line explicitly brings focus back to the main window containing the Entry Editor. It fixes a field focus bug.
Video of changed UI
Screen.Recording.2024-11-29.at.10.19.05.AM.mov
As you can see on screenshot bug is fixed!
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)