jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Tabular UI for naming linked files

Open priyanshu16095 opened this issue 9 months ago • 17 comments

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.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)
  • [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.

Screenshot (202)

priyanshu16095 avatar Mar 05 '25 15:03 priyanshu16095

Sorry, for the clutter the pull request is based on another branch instead of the main branch by mistake.

priyanshu16095 avatar Mar 05 '25 16:03 priyanshu16095

In progress...

priyanshu16095 avatar Mar 05 '25 17:03 priyanshu16095

Screenshot for a sneak peak would be nice ;)

Siedlerchr avatar Mar 05 '25 17:03 Siedlerchr

https://github.com/user-attachments/assets/194e4837-0c08-40d1-a4e5-de1d3cb0437a

Works fine!

priyanshu16095 avatar Mar 06 '25 19:03 priyanshu16095

You also should add a migration when. a user has defined a pattern already to the new field, see PreferencesMigrations

Siedlerchr avatar Mar 07 '25 14:03 Siedlerchr

I have try to add but I am very unclear about how preference migration works.

priyanshu16095 avatar Mar 11 '25 16:03 priyanshu16095

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.

koppor avatar Mar 11 '25 19:03 koppor

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.

priyanshu16095 avatar Mar 21 '25 04:03 priyanshu16095

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).

jabref-machine avatar Mar 26 '25 14:03 jabref-machine

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.

jabref-machine avatar Apr 10 '25 14:04 jabref-machine

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.

jabref-machine avatar Apr 10 '25 14:04 jabref-machine

https://github.com/user-attachments/assets/dd0a2acc-62c6-492a-81fd-e5e55c45224c

There is a problem with this, it is not storing the values.

priyanshu16095 avatar Apr 10 '25 19:04 priyanshu16095

You have to press enter to accept the value (there is no commit on focus lost)

Siedlerchr avatar Apr 11 '25 05:04 Siedlerchr

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.

jabref-machine avatar Apr 18 '25 20:04 jabref-machine

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.

image

Please review.

priyanshu16095 avatar Apr 18 '25 21:04 priyanshu16095

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.

jabref-machine avatar May 24 '25 08:05 jabref-machine

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

trag-bot[bot] avatar May 24 '25 08:05 trag-bot[bot]