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

Implement Tabular UI and Backend Logic for Linked Files Pattern List Configuration #11368 #12090

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Naaeeen
Copy link

@Naaeeen Naaeeen commented Oct 26, 2024

This PR addresses the issue: Citation Key Generator and Linked Files #11368
Link: #11368

Major Changes Made:

  1. UI Enhancements:
    • Created FilenamePatternPanel to manage filename patterns in a tabular format.
    • Integrated the new panel into LinkedFilesTab to replace the original UI.

image

  1. Backend Logic:

    • Replaced the previous String-based filename pattern storage in FilePreferences with a more flexible solution using GlobalFilenamePattern and AbstractFilenameFormatPatterns.
    • Added storage, load, and listener mechanisms for filename patterns in JabRefCliPreferences to handle these patterns dynamically.
    • Modified FileUtil#createFileNameFromPattern to ensure it generates filenames based on the entry type.
  2. Changes in Tests:

    • Updated some unit tests for FileUtil to reflect the changes in the filename generation logic.
    • Some tests in FileUtil and FilePreferences currently fail to compile or run due to method changes and require further modifications.
    • Additional test cases are still needed to fully validate the new functionality.

Current Progress:

  • The core functionality has been successfully implemented.
  • In manual testing, each cleanup operation correctly updates the filenames based on the configured patterns.

Request for Feedback:

Could you confirm if our direction is correct?
Do you have any suggestions for tests or other areas?
Also, any feedback on the structure or logic would be greatly appreciated.

Thanks a lot!!

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

naaeeen-Anu and others added 10 commits October 18, 2024 19:27
This commit lays the groundwork for a tabular UI to configure filename
patterns for linked files. The core logic is implemented, mirroring the
structure used for Citation Key Patterns. UI implementation and integration
with LinkedFilesTab will be addressed in later commits.
…on UI

This commit replace the old ui with tabular UI to configure filename
patterns for linked files. The core logic is implemented, mirroring the
structure used for Citation Key Patterns. UI implementation and integration
with LinkedFilesTab will be addressed in later commits.
This commit improves the UI and makes it functional. However, core logic still needs to be implemented.

IMPORTANT TODO:
1. Update CleanupPresetPanel.java in gui/cleanup:
   - Temporarily added .toString() to filePreferences.getFileNamePattern()
   - Need to modify this as the new GlobalFilenamePattern object stores patterns
     for different file types, not just a single pattern

2. Refactor getSuggestedFileName in logic/externalfiles/LinkedFileHandler.java:
   - Current implementation expects a single file name pattern
   - Need to update to work with the new GlobalFilenamePattern object

Note: These changes may affect other parts of the application that rely on
the previous file name pattern implementation. Further testing and updates
may be required.
This commit improves the UI and makes it functional. However, core logic still needs to be implemented.

IMPORTANT TODO:
1. Update CleanupPresetPanel.java in gui/cleanup:
   - Temporarily added .toString() to filePreferences.getFileNamePattern()
   - Need to modify this as the new GlobalFilenamePattern object stores patterns
     for different file types, not just a single pattern

2. Refactor getSuggestedFileName in logic/externalfiles/LinkedFileHandler.java:
   - Current implementation expects a single file name pattern
   - Need to update to work with the new GlobalFilenamePattern object

Note: These changes may affect other parts of the application that rely on
the previous file name pattern implementation. Further testing and updates
may be required.
Major change:
- Refactored `createFileNameFromPattern` in `FileUtil` to generate filenames dynamically based on the `EntryType`.
- Add store and load for FilePreferences
**Note:** Related test cases currently encounter compile errors and require fixes.
@calixtus calixtus changed the title Draft Pull Request: Implement Tabular UI and Backend Logic for Linked Files Pattern List Configuration #11368 Implement Tabular UI and Backend Logic for Linked Files Pattern List Configuration #11368 Oct 26, 2024
@calixtus
Copy link
Member

A draft pull request is recognized by having it opened as a draft, not by writing it in the title. Reduce redundancy.

@calixtus
Copy link
Member

calixtus commented Nov 3, 2024

Hi, whats the status here? Are you still working on this project? The changes already look very promising. I would love to see this finished.

Don't forget to remove the commented code in the end. This is what code versioning (git) is for.

Comment on lines +43 to +46
@Override
public String toString() {
return "[" + entryType.getValue().getName() + "," + pattern.getValue() + "]";
}
Copy link
Member

Choose a reason for hiding this comment

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

I would put that in a separate method - toString() is more used for debugging.

@Naaeeen
Copy link
Author

Naaeeen commented Nov 3, 2024

Hi, whats the status here? Are you still working on this project? The changes already look very promising. I would love to see this finished.

Don't forget to remove the commented code in the end. This is what code versioning (git) is for.

Hi, thanks for checking. Yes, I'm still working on it, but I've been tied up with finals over the past few weeks, so progress has been slower than expected. By the way, is there a specific deadline or timeline you have in mind for this issue? That would help me prioritize and plan accordingly.

@koppor
Copy link
Member

koppor commented Nov 3, 2024

Hi, thanks for checking. Yes, I'm still working on it, but I've been tied up with finals over the past few weeks, so progress has been slower than expected. By the way, is there a specific deadline or timeline you have in mind for this issue? That would help me prioritize and plan accordingly.

The beta release is planned for December, 24th. Would be good to have an update on December, 10th to kick-off review rounds to that this can be inclued in the release.

@Naaeeen
Copy link
Author

Naaeeen commented Nov 17, 2024

Hi, thanks for checking. Yes, I'm still working on it, but I've been tied up with finals over the past few weeks, so progress has been slower than expected. By the way, is there a specific deadline or timeline you have in mind for this issue? That would help me prioritize and plan accordingly.

The beta release is planned for December, 24th. Would be good to have an update on December, 10th to kick-off review rounds to that this can be inclued in the release.

Hey all, just a quick update: my Windows 11 23H2 system crashed and I’ve spent the last few days trying to troubleshoot without luck. Had to reset the whole machine this morning, but I’m still in the process of setting up all my environment again.

On top of that, I’ll be flying internationally soon, so things might take a bit longer.

I’ll do my best to get everything ready before the release and leave time for review, but I can’t promise it’ll all go to plan. Really sorry for the delay! (Yeah, I suspect the issue might have been caused by me forgetting to enable the VM when I was working on C. My bad, and I really really apologize for those impact this has had on the issue. Pls forgive me for the oversight.🤦‍♂️😔)

If anyone wants to pick up work based on my progress in the meantime, feel free to jump in and let me know.

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.

4 participants