Skip to content

Add focus to field Link in the "Add file link" dialog.#13520

Merged
koppor merged 11 commits into
JabRef:mainfrom
ankamde:issue-13486
Jul 15, 2025
Merged

Add focus to field Link in the "Add file link" dialog.#13520
koppor merged 11 commits into
JabRef:mainfrom
ankamde:issue-13486

Conversation

@ankamde

@ankamde ankamde commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

Closes #13486

This is the PR request for issue no #13486

Steps to test

  1. Open JabRef
  2. Create a new library: File → New library
  3. Click the + button in the toolbar to add a new entry
  4. In the entry editor, select the General tab
  5. In the File section, click the + button
  6. The "Add file link" dialog appears and the "Link" is focused

image

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (if change is visible to the user)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@koppor

koppor commented Jul 9, 2025

Copy link
Copy Markdown
Member

Please follow the review given at #13500 (comment)

@ankamde

ankamde commented Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

@koppor My PR is obsolete - there's existing PR for this issue (#13500). Can I just close this one? I haven't seen anyone being assinged so I grabbed it.
[UPDATE] I've made required change, please have a look.

@ankamde

ankamde commented Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

Do I also have to remove link.requestFocus() from this method:

@FXML
private void openBrowseDialog(ActionEvent event) {
    viewModel.openBrowseDialog();
    link.requestFocus();
}

@koppor

koppor commented Jul 10, 2025

Copy link
Copy Markdown
Member

Do I also have to remove link.requestFocus() from this method:

@FXML
private void openBrowseDialog(ActionEvent event) {
    viewModel.openBrowseDialog();
    link.requestFocus();
}

Why should it be removed? Because your functionality also covers this case?

Comment thread CHANGELOG.md Outdated

### Changed

- We added focus

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please complete this. Also add a link

@ankamde ankamde Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should it be removed? Because your functionality also covers this case? -> Hmmm...Let me have alook later on this code. Perhaps my commen is obsolete.
Please complete this... -> goot catch!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you think aloud? Not sure if this an AI-generated comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) Yes - I was thinkig aloud. No AI involvement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koppor Hi, CHANGELOG.MD has been updated. Please have a look.

@koppor

koppor commented Jul 11, 2025

Copy link
Copy Markdown
Member

Do I also have to remove link.requestFocus() from this method:

@FXML
private void openBrowseDialog(ActionEvent event) {
    viewModel.openBrowseDialog();
    link.requestFocus();
}

Why should it be removed? Because your functionality also covers this case?

I think, the answer is yes - remove it.

Please look at https://github.com/JabRef/jabref/pull/13520/files for another view on the comments by format checkers. Should be easy to fix.

@ankamde

ankamde commented Jul 11, 2025

Copy link
Copy Markdown
Contributor Author

@koppor I've addressed all of the comments. Please have a look.

}

private void onDialogShow(DialogEvent event) {
Platform.runLater(() -> link.requestFocus());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use UiTaskExecutor::runInJavaFxThread . Though it is only a wrapper for Platform::runLater , idea is to have an abstraction on javafx und keep some flexibility in the codebase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@calixtus Done, please have a look.

Comment thread CHANGELOG.md Outdated

### Changed

- We added focus on the field Link in the "Add file link" dialog. [#13486](https://github.com/JabRef/jabref/issues/13486)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second word is "added". Thus, please, add this to section "Added". Or rephrase. As is, it is confusing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koppor Moved to appropiate section, please have a look.

@trag-bot

trag-bot Bot commented Jul 13, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@koppor koppor enabled auto-merge July 13, 2025 22:48
@koppor koppor added this pull request to the merge queue Jul 15, 2025
Merged via the queue into JabRef:main with commit 281ffac Jul 15, 2025
1 check passed
Siedlerchr added a commit that referenced this pull request Aug 2, 2025
* upstream/main:
  Bump com.squareup.okhttp3:okhttp from 5.0.0 to 5.1.0 in /versions (#13541)
  Fixed Issue 13418: "Search ShortSience" should do a latex-to-unicode conversion (#13532)
  New Crowdin updates (#13548)
  Add focus to field Link in the "Add file link" dialog. (#13520)
  Bump org.ow2.asm:asm from 9.6 to 9.8 in /versions (#13547)
  Make validation optional for saving library properties preferences (#13488)
  Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0 in /versions (#13546)
  --porcelain does not output any info or warn errors on the console (#13469)
  Bump jablib/src/main/resources/csl-locales from `7e137db` to `3bad433` (#13545)
  Refine "File exists" warning (#13491)
  Bump org.openrewrite.recipe:rewrite-recipe-bom from 3.8.0 to 3.11.1 (#13544)
  Bump org.openrewrite.rewrite from 7.8.0 to 7.11.0 (#13542)
  Bump jablib/src/main/resources/csl-styles from `704ff9f` to `59f124d` (#13540)
  Add architecture test for logging infrastructure (#13534)
  More harsh test on title of PR
  New Crowdin updates (#13533)
  Update extra-java-module-info plugin (#13527)
  [Junie]: fix: display help output for --help argument (#13446)
  Refactor OpenExternalFileAction  (#13508)
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.

Dialog "Add file link" should focus field "Link" when opening

4 participants