Tabular UI for naming linked files
Closes #11368
This PR adds a tabular construct similar to "Key patterns" for "Linked files name" in the Linked files tab in preferences.
Mandatory checks
- [x] I own the copyright of the code submitted and I licence it under the MIT license
- [x] Change in
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user) - [/] Tests created for changes (if applicable)
- [x] Manually tested changed features in running JabRef (always required)
- [x] Screenshots added in PR description (for UI changes)
- [x] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
- [x] 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.
Sorry, for the clutter the pull request is based on another branch instead of the main branch by mistake.
In progress...
Screenshot for a sneak peak would be nice ;)
https://github.com/user-attachments/assets/194e4837-0c08-40d1-a4e5-de1d3cb0437a
Works fine!
You also should add a migration when. a user has defined a pattern already to the new field, see PreferencesMigrations
I have try to add but I am very unclear about how preference migration works.
I have try to add but I am very unclear about how preference migration works.
Not sure how to help.
Example method: org.jabref.migrations.PreferencesMigrations#upgradeImportFileAndDirePatterns
It first checks if a prefernce is there. If yes, it checks the content. Then, it check whether the current content is an old content. Then it updates to the new content. Then it wirtes the new string.
Similar at org.jabref.migrations.PreferencesMigrations#upgradeKeyBindingsToJavaFX - and all other migrations.
To remove code duplication ,
Renamed LinkedFileNamePattern and CitationKeyPattern to Pattern
Renamed LinkedFileNamePatternsPanelItemModel and CitationKeyPatternsItemModel to PatternsItemModel
Renamed LinkedFileNamePatternsSuggestionCell and CitationKeyPatternsSuggestionCell to PatternsSuggestionCell
The thing I am not sure about is whether the preference migration is correct or not.
Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of [x] (done), [ ] (not done yet) or [/] (not applicable).
Your pull request conflicts with the target branch.
Please merge upstream/main with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.
Your pull request conflicts with the target branch.
Please merge upstream/main with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.
https://github.com/user-attachments/assets/dd0a2acc-62c6-492a-81fd-e5e55c45224c
There is a problem with this, it is not storing the values.
You have to press enter to accept the value (there is no commit on focus lost)
JUnit tests are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Tests / Unit tests (pull_request)" and click on it.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
https://github.com/user-attachments/assets/9f3ec9e6-8454-4807-bc5e-185edd47fd2e
Works fine, solved the problem of not storing values. After resolving conflicts, I pulled the changes, after which the checks failed as this newly added task is giving some error.
Please review.
Your pull request conflicts with the target branch.
Please merge upstream/main with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.
@trag-bot didn't find any issues in the code! ✅✨