Skip to content

Conversation

VishakhaMathur
Copy link

@VishakhaMathur VishakhaMathur commented Oct 19, 2025

Closes #8888

Issue

The issue was that, earlier when we opened the citation key generator in the preferences and pressing esc did not close the dialog when we were inside the table of key patterns. For example, clicking on Article and then pressing esc didn't close the preference dialog. This was a bug.
Screenshot 2025-10-14 121102

Fix

What we tried to do was implement consistent functionality of esc across the table.
If we the table in preference dialog is being edited, and somebody wants to escape in between, pressing first esc clears the changes and second esc closes the dialog view. We used JavaFX and created event filter on the dialog scene (installGlobalCloseBehavior). It checks whether any table or list is being edited, if it is so, then first esc cancels the changes, otherwise close the dialog.

Steps to test

Test plan: Preferences dialog close behaviour (ESC vs edit)
Note: The below assumes ESC is bound to the Close dialog keyboard shortcut
A. Baseline: ESC closes when not editing

  1. Open Preferences.
  2. In the left sidebar, go to Citation key generator.
  3. Scroll to Key patterns.
  4. Single-click a table cell (e.g., Default pattern) so it’s focused but not editing.
  5. Press the Close shortcut (default ESC).
    Expected: The Preferences dialog closes.

B. Two-step ESC while editing (table)

  1. Open Preferences → Citation key generator → Key patterns.
  2. Double-click the Default pattern cell to enter edit mode (you should see a text editor in the cell).
  3. Press ESC once.
    Expected: Edit is cancelled; dialog stays open and the cell exits edit mode.
  4. Press ESC again.
    Expected: The Preferences dialog closes.

C. Other affected tabs (similar issue)
Repeat B in tabs (such as ‘Protected terms files’ and ‘Entry types) had the same incorrect close behaviour with TableView elements:
• Protected terms files → Select a cell in the table: start editing a row → ESC once cancels edit, ESC twice closes dialog.
• Entry types → Select a Entry Type on the left (e.g., ‘Article’) → Select a cell in the Required and optional fields table: start editing a row → ESC once cancels edit, ESC twice closes dialog.

Mandatory checks

Callum-Higginson and others added 2 commits October 19, 2025 13:32
@koppor
Copy link
Member

koppor commented Oct 19, 2025

Steps to test

Since, our OS is windows, we tried to run the app and found that the code works and aligns with the expectation. Everything worked smoothly, so we pushed all the changes.

I am not sure about your aims. Just get a PR merged (which is OK!) or to learn something about SE?

In case of the latter, how can a tester follow these steps? How precise is "aligns with the expectations"?

@VishakhaMathur
Copy link
Author

Steps to test

Since, our OS is windows, we tried to run the app and found that the code works and aligns with the expectation. Everything worked smoothly, so we pushed all the changes.

I am not sure about your aims. Just get a PR merged (which is OK!) or to learn something about SE?

In case of the latter, how can a tester follow these steps? How precise is "aligns with the expectations"?

Hi Koppor, I am sorry for not mentioning test steps clearly. I have made changes in that part of description. I am new to OSS, I have never done something like this before. And I'll take care of all these things in the future projects.

@VishakhaMathur
Copy link
Author

Steps to test

Since, our OS is windows, we tried to run the app and found that the code works and aligns with the expectation. Everything worked smoothly, so we pushed all the changes.

I am not sure about your aims. Just get a PR merged (which is OK!) or to learn something about SE?

In case of the latter, how can a tester follow these steps? How precise is "aligns with the expectations"?

Also, can you please help me with the check that is failing because I am not understanding why it is happening? I tried to follow the documentation and the jabref-machine comment above but it didn't fix it.

@subhramit
Copy link
Member

subhramit commented Oct 19, 2025

Also, can you please help me with the check that is failing because I am not understanding why it is happening?

You just need to link the issue you fixed to this PR.
E.g. see the first line of the description of the merged PR #14102
Use Closes <link>

@VishakhaMathur
Copy link
Author

Also, can you please help me with the check that is failing because I am not understanding why it is happening?

You just need to link the issue you fixed to this PR. E.g. see the first line of the description of the merged PR #14102 Use Closes <link>

Thanks for the reply, Subhramit. I followed what you suggested, but its still same. Is there anything else you think that is causing issues?

@subhramit
Copy link
Member

subhramit commented Oct 20, 2025

Thanks for the reply, Subhramit. I followed what you suggested, but its still same. Is there anything else you think that is causing issues?

Look at the example in the PR template (this is the text that appeared in the PR description when you first opened the PR, which you had to replace):

<!-- LINK THE ISSUE WITH THE "Closes" KEYWORD. Example: Closes https://github.com/JabRef/jabref/issues/13109 OR Closes #13109 -->

Or the examples in the jabref-machine bot message:

Examples
✅ Fixes #xyz links pull-request to issue. Merging the PR will close the issue.
✅ Fixes https://github.com/JabRef/jabref/issues/xyz links pull-request to issue. Merging the PR will close the issue.

It says either link using #number OR the link to the issue.

Or what I said in my comment above:

Use Closes <link>

Instead of Closes <link>, you used Closes [#number](link).

Hope this is clear now.

P.S. Furthermore, the link that you provided in the brackets is not even a proper link to the issue, but a link to a comment on the issue.

@VishakhaMathur
Copy link
Author

Thanks for the reply, Subhramit. I followed what you suggested, but its still same. Is there anything else you think that is causing issues?

Look at the example in the PR template (this is the text that appeared in the PR description when you first opened the PR, which you had to replace):

<!-- LINK THE ISSUE WITH THE "Closes" KEYWORD. Example: Closes https://github.com/JabRef/jabref/issues/13109 OR Closes #13109 -->

Or the examples in the jabref-machine bot message:

Examples
✅ Fixes #xyz links pull-request to issue. Merging the PR will close the issue.
✅ Fixes https://github.com/JabRef/jabref/issues/xyz links pull-request to issue. Merging the PR will close the issue.

It says either link using #number OR the link to the issue.

Or what I said in my comment above:

Use Closes <link>

Instead of Closes <link>, you used Closes [#number](link).

Hope this is clear now.

P.S. Furthermore, the link that you provided in the brackets is not even a proper link to the issue, but a link to a comment on the issue.

Thanks, it makes sense to me now. Sorry to bother you again but I have tried everything now. I added Closes but it is still failing. I also tried Fixes xyz, Fixes and Closes xyz, but it didn't work.

@JabRef JabRef deleted a comment from jabref-machine Oct 20, 2025
@Siedlerchr
Copy link
Member

ignore the PR issue number, I think it sometimes doesn't work when you modify the original pr text

@VishakhaMathur
Copy link
Author

ignore the PR issue number, I think it sometimes doesn't work when you modify the original pr text

Will our PR still be accepted and merged?

@calixtus
Copy link
Member

Your pr will be reviewed and tested. Takes time, as we all are working full time and do JabRef in the spare time. Please be patient.

@subhramit
Copy link
Member

Thanks, it makes sense to me now. Sorry to bother you again but I have tried everything now. I added Closes but it is still failing. I also tried Fixes xyz, Fixes and Closes xyz, but it didn't work

Hi Vishakha, no issues, thanks for pointing this out. There was an issue with our workflow that it didn't re-run on editing the PR description. Should be fixed by #14121.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESC should close the dialog

7 participants