Implemented Diff View Before Comitting feature - #16569
Conversation
PR Summary by QodoAdd per-library Git diff preview dialog to Git Commit workflow
AI Description
Diagram
High-Level Assessment
Files changed (12)
|
Code Review by Qodo
1.
|
| @Inject | ||
| private GuiPreferences preferences; | ||
|
|
||
| private ImportFormatPreferences importFormatPreferences; |
There was a problem hiding this comment.
When i was doing @Inject for for Importpreference it was not working as it was not registered so inject GuiPrefrence and using this i passed Importpreference
| commitMessage.textProperty().bindBidirectional(viewModel.commitMessageProperty()); | ||
| commitMessage.setPromptText(Localization.lang("Enter commit message here")); | ||
|
|
||
| showDiffButton.setOnAction(_ -> showDiff()); |
There was a problem hiding this comment.
There is no need, as you already have onAction="#showDiff" in FXML
There was a problem hiding this comment.
Okay i will test this and will do the changes accordingly
| GitHandlerRegistry gitHandlerRegistry) { | ||
| GitHandlerRegistry gitHandlerRegistry, | ||
| GuiPreferences guiPreferences, | ||
| ImportFormatPreferences importFormatPreferences, |
There was a problem hiding this comment.
you can already get it from guiPreferences via getImportFormatPreferences()
|
|
||
| import org.jabref.logic.bibtex.comparator.BibEntryDiff; | ||
|
|
||
| public record EntryDiffFiles(String fileName, List<BibEntryDiff> entryDiffs) implements DiffFiles { |
There was a problem hiding this comment.
But since we work only with 1 .bib file, is there a need for String fileName?
Ping @wanling0000 , for more information. Because if yes, I think we can remove the fileName
There was a problem hiding this comment.
Yesss we can later i realised i can remove it in later commit i will remove this
Internal discussion: The current view is fine as well. |
|
Your pull request conflicts with the target branch. Please merge |
|
Is it okay for organisational reasons to mark this PR as draft? |
ThinkerDesigns
left a comment
There was a problem hiding this comment.
Summary
Nice addition -- a "Show Diff" button in the Git commit dialog for the current .bib file. Clean UI work with proper reuse of existing infrastructure.
Comments
Dependency injection bloat
The ViewModel constructor gained 3 new params (GuiPreferences, ImportFormatPreferences, FileUpdateMonitor) when only importFormatPreferences and fileUpdateMonitor are actually needed. Pass those two directly instead of the wrapper + deriving -- fewer parameters and more explicit dependencies.
Stale diff caveat (non-blocking)
The diff is computed against HEAD at button-click time, not at commit-time. If the file was modified externally between clicking "Show Diff" and "Commit", the user sees a stale diff worth noting in the PR description so users are aware.
Verdict: LGTM with above comments
@ThinkerDesigns note that this is a public platform, everyone knows what you're doing - it won't help you. Anywhere else you are seen spamming in this project again using AI generated reviews to get GitHub activity, we'll make sure it is made even more public before we ban you. |
Replaced the line based diff view with existing sematic diff UI using DatabaseChangesResolverDialog parse the (HEAD) from last commited version of file Parse the current on disk saved version of that .bib file Comaparing both as BibDatabaseContect and rander via DatabaseChangesResolverDialog
Added missing keys to JabRef_en.properties fixed the format of module-info.java
|
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 |
|
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. 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 "Source Code Tests / Checkstyle (pull_request)" and click on it. In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues, commit, and push. |



PR Description
Screen.Recording.2026-08-25.192944.mp4
Steps to test
Related issues and pull requests
Closes #16341
AI usage
Most of my brain is used but for some testing ans errors i was getting during implementation i used gpt
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)