Skip to content
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

Open "near-by" .bib file #12172

Merged
merged 12 commits into from
Nov 13, 2024
Merged

Open "near-by" .bib file #12172

merged 12 commits into from
Nov 13, 2024

Conversation

koppor
Copy link
Member

@koppor koppor commented Nov 10, 2024

Fixes JabRef#377.

Mandatory checks

  • I own the copyright of the code submitted and I licence 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 (for UI changes)
  • 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.

CHANGELOG.md Outdated
@@ -41,6 +41,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added an importer for SSRN URLs. [#12021](https://github.com/JabRef/jabref/pull/12021)
- We added a compare button to the duplicates in the citation relations tab to open the "Possible duplicate entries" window. [#11192](https://github.com/JabRef/jabref/issues/11192)
- We added automatic browser extension install on Windows for Chrome and Edge. [#6076](https://github.com/JabRef/jabref/issues/6076)
- We added support to automatically load a `.bib` file in the current/parent folder if no other library is opened. [koppor#377](https://github.com/koppor/jabref/issues/377)
Copy link
Member

Choose a reason for hiding this comment

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

Loading

Copy link
Member Author

Choose a reason for hiding this comment

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

I did the other way round 😅

@koppor koppor enabled auto-merge November 11, 2024 08:04

while (currentDir != null) {
try {
Optional<Path> bibFile = Files.list(currentDir)
Copy link
Member

Choose a reason for hiding this comment

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

this looks horrible. Did you use chatgpt? Better use Files.find that does all this under the hood already
https://mkyong.com/java/java-files-find-examples/

Copy link
Member Author

Choose a reason for hiding this comment

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

Also climbing up!!!

I search x/y/z. If there not found, go one dir up.

I can also do recursion...

I do NOT want list all files form root (e.g.., / or c:) and then filter. This takes too long!!

Copy link
Member

Choose a reason for hiding this comment

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

I search x/y/z. If there not found, go one dir up.

This does not make sense.
I assume a scenario with JabRef portable. You have the bib file next to JabRef.exe and it will load it. This is fine.
But not randomly searching folders up and up or down

And additionally, this features makes so sense under Mac as you have the Appplications folder and all .app apps.
You would never place a file there.

Copy link
Member Author

Choose a reason for hiding this comment

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

My use case:

image

image

Copy link
Member Author

Choose a reason for hiding this comment

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

image

@Siedlerchr
Copy link
Member

This feature need testing with jpackaged app. If it even works there

@koppor
Copy link
Member Author

koppor commented Nov 11, 2024

This feature need testing with jpackaged app. If it even works there

Tested. Works fine. Therefore, I crossed

image

@koppor
Copy link
Member Author

koppor commented Nov 11, 2024

This feature need testing with jpackaged app. If it even works there

We also tested on Linux in the DevCall - and needed to have modifications 😅.

@InAnYan
Copy link
Collaborator

InAnYan commented Nov 11, 2024

Linux Mint - works!

InAnYan
InAnYan previously approved these changes Nov 11, 2024
@koppor koppor disabled auto-merge November 11, 2024 21:27
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 11, 2024
@koppor koppor marked this pull request as draft November 12, 2024 21:44
@koppor koppor marked this pull request as ready for review November 12, 2024 23:13
@koppor koppor enabled auto-merge November 13, 2024 00:11
@calixtus
Copy link
Member

Test failing bc No space left on device (28)

Copy link
Contributor

github-actions bot commented Nov 13, 2024

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@koppor koppor disabled auto-merge November 13, 2024 19:25
@koppor koppor merged commit 5f1dd59 into main Nov 13, 2024
26 of 27 checks passed
@koppor koppor deleted the open-bib-as-default branch November 13, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When JabRef is started, load the library in the folder of JabRef.bat
4 participants