-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[GSOC22] - B - Implement merging fields in the three way merge UI #9022
Merged
Merged
Changes from all commits
Commits
Show all changes
437 commits
Select commit
Hold shift + click to select a range
f6a281a
Encode the resulting string from merging files
HoussemNasri 470bc8b
Refactor merge/unmerge fields command handling
HoussemNasri 7354264
Declare Actions with the builder design pattern
HoussemNasri c9b6db7
Remove MergeableFieldCell dependency from the merge/unmerge commands
HoussemNasri dab2813
Add logs
HoussemNasri 705e8cc
Disable field's merge button when field values are equal
HoussemNasri 0e9a784
Update code documentation
HoussemNasri 2a512c5
Rename 'AbstractCell' to 'ThreeWayMergeCell'
HoussemNasri 8081bc5
Pass arguments to Localization.lang using '%0' not '%'
HoussemNasri 235a243
Decompose the ToggleMergeUnmergeButton into its own class (or component)
HoussemNasri 891feb6
Include original left and right entries in EntriesMergeResult
HoussemNasri feb0628
Make entries merging logic reusable
HoussemNasri 328ce97
Rename ChangeDisplayDialog.java to ExternalChangesResolverDialog.java
HoussemNasri b8ce549
Create ExternalChangesResolverViewModel
HoussemNasri 588db57
Design the ExternalChangesResolverDialog
HoussemNasri 0af8175
Implement a method for opening an advanced merge dialog for modified …
HoussemNasri 0e128d2
Wrap the UI in a dialog pane
HoussemNasri 0f1366a
Convert change name to a StringProperty instead of a raw string
HoussemNasri 241ae86
Populate table view with changes
HoussemNasri b3ddc88
Remove 'Accept changes' and 'Dismiss' buttons from the dialog
HoussemNasri 6bf045b
Allow selecting multiple changes
HoussemNasri 0be74a6
Rename 'Accept Theirs' to 'Accept' and 'Accept Yours' to 'Deny'
HoussemNasri 5cd88eb
Apply changes when before the dialog
HoussemNasri fe4b582
Cleanup FXML
HoussemNasri fc656d9
Remove old UI code
HoussemNasri 12ec6c5
Close dialog when all changes are resolved
HoussemNasri f9292de
Enable the 'Merge...' button only if the selected change has an advan…
HoussemNasri dd46057
Select the first change after opening the dialog
HoussemNasri 57062ce
Open the advanced merge dialog when 'Merge...' is clicked
HoussemNasri d90c418
Don't open the advanced merge dialog when 'makeChange()' is called on…
HoussemNasri ea33534
Display a preview of the deleted entry
HoussemNasri c4274a9
Display information about the selected change in the bottom detail node
HoussemNasri f0d8cb3
Merge branch 'JabRef:main' into GSOC-merge-groups
HoussemNasri ca627bc
Merge branch 'GSOC-merge-groups' into GSOC-improve-collab-dialog
HoussemNasri 5b8e97a
Merge remote-tracking branch 'origin/main' into GSOC-merge-fields
HoussemNasri 3ad3a83
Merge remote-tracking branch 'upstream/main' into GSOC-improve-collab…
Siedlerchr 8ecf890
Update README.md
HoussemNasri ee988f9
Fix Readme
HoussemNasri 0b9a345
Create grid cells for rendering field name and field value
HoussemNasri 93a17c6
Implement FieldNameCell and define style class
HoussemNasri 2d2c1ff
Make FieldValueCell selectable
HoussemNasri 5329e29
Implement MergedFieldCell for rendering editable merged field value
HoussemNasri f184ed2
Change MergedFieldCell text based on the selected FieldValueCell
HoussemNasri 111a211
Style MergedFieldCell
HoussemNasri e30db74
Rename ThreeWayMerge css stylesheet
HoussemNasri 1c7e012
Create HeadView for rendering left, right and merged entry headers
HoussemNasri 249bec9
Fix typo
HoussemNasri c12a352
Fix a bug that causes the selection of both left and right field cell…
HoussemNasri fa86607
Prevent the selection of FieldValueCell when it's disabled
HoussemNasri e8fef63
Display a copy icon inside FieldValueCell
HoussemNasri 70180f2
Disable left or right FieldValueCell when it's empty
HoussemNasri d90fcf2
Update Base CSS style
HoussemNasri a3091c6
Design and implement the merge toolbox
HoussemNasri e9a410e
Implement the initial prototype of the new merge UI
HoussemNasri 180493d
Use ThreeWayMergeView in MergeEntriesDialog
HoussemNasri f80aa41
Fix ThreeWayMergeView.css stylesheet not being imported
HoussemNasri 819ac4e
Span left field value to 2 columns when left and right field values a…
HoussemNasri 7f4cd2f
Wrap the copy icon inside a button
HoussemNasri 823125c
Use HAND cursor when hover over FieldValueCell
HoussemNasri ca5d4f3
Move field cells styles to ThreeWayMergeView.css
HoussemNasri ec78eec
Update merge toolbox FXML UI
HoussemNasri 5c093e0
Implement and style HeaderCell
HoussemNasri 9d6a921
Take row index as an argument in AbstractCell
HoussemNasri db5f3a0
Color cell background based on its row position (odd or even)
HoussemNasri 0918e79
Bind textArea.textProperty() and textProperty() using BindingsHelper
HoussemNasri 32ad571
Copy field value to Clipboard user clicks on the copy button
HoussemNasri 7ed7250
Implement a more complete HeaderView
HoussemNasri 0197257
Pass left and right headers to HeaderView
HoussemNasri 95ea40f
Create merged entry
HoussemNasri 8becfc1
Add the entry type field at the top of the fields list
HoussemNasri 6042d69
Display entry type and bind merged entry
HoussemNasri 390762b
Minor changes
HoussemNasri 91dd860
Style CSS
HoussemNasri 32a9ffb
Update ThreeWayMergeToolbox.fxml
HoussemNasri 0a5fb15
Remove MergeEntries from MergeEntriesDialog
HoussemNasri 4267cf6
Create EmptyCell for optimization
HoussemNasri ef3271c
Update HeaderCell
HoussemNasri cac4f11
Rename HeaderView to ThreeWayMergeHeaderView
HoussemNasri 0f3e154
Add buttons to accept all left or right entry changes to ThreeWayMerg…
HoussemNasri 91b9cd9
Disable right field cell when it's not visible
HoussemNasri d6a7a82
Listen for select all left/right toolbar buttons
HoussemNasri 5a37259
Style stuff
HoussemNasri 3a2f7c4
Add DiffHighlighter
HoussemNasri 48f46c9
Create DiffHighlighter.css
HoussemNasri 6f8d19a
Add left padding to HeaderCell
HoussemNasri d7f91c3
Move diff highlighting styles to Dark.css
HoussemNasri 4716f4b
Show differences between left and right values using a unified diff view
HoussemNasri e7817eb
Change MergeEntriesDialog stage style
HoussemNasri a1f7ac1
Remove BackgroundTone from AbstractCell
HoussemNasri 17787f9
Move CopyFieldValueCommand
HoussemNasri 46fd34e
Make DiffMethod public
HoussemNasri 980a85e
Move CopyFieldValueCommand
HoussemNasri 2ef153b
Implement SplitDiffHighlighter
HoussemNasri ea56047
Show diffs when user selects "Show Diff" in the toolbar UI
HoussemNasri 8a5b534
Fix bugs in UnifiedDiffHighlighter
HoussemNasri 1a25db6
Style css stuff
HoussemNasri 0cf68c7
Fix typos
HoussemNasri 2142192
Refactor SplitDiffHighlighter and fix bugs
HoussemNasri 868f314
Remove redundant constructor from UnifiedDiffHighlighter
HoussemNasri a1fb604
Allow users to switch between split and unified diff view
HoussemNasri 6043305
Set left and right headers in MergeEntriesDialog
HoussemNasri d8d2246
Refactor ThreeWayMergeHeaderView
HoussemNasri e27d8f9
Remove wellbehavedfx module dependency
HoussemNasri 4891fdc
Delete EmptyCell.java
HoussemNasri 3f57163
Refactor FieldValueCell
HoussemNasri fb3509e
Use the new merge UI in DuplicateResolverDialog
HoussemNasri 6bb8f2c
Expose an API to change diff view and highlight method from outside t…
HoussemNasri a9f3254
Use the new merge UI when an entry is changed from external
HoussemNasri 30b4f74
Minor styling
HoussemNasri 7022b74
Remove DiffHighlighter.css stylesheet
HoussemNasri 6fee209
Remove unused dependencies
HoussemNasri 23223de
Allow selecting empty field values
HoussemNasri f9c4a18
Fix readme :(
HoussemNasri a5bc689
Use a theme color for selection box background
HoussemNasri 4bd99c2
Refactor FieldValueCell
HoussemNasri e2d4f76
Add an action to FieldValueCell for opening Urls
HoussemNasri b8a3575
Add the ability to open DOI identifier
HoussemNasri 28fbefb
Cleanup
HoussemNasri a471e20
Checkstyle
HoussemNasri 03ee8c0
Improve URL validation logic
HoussemNasri 06df19e
Use DiffMethod in merge toolbar for consistency
HoussemNasri ddee09c
i18n
Siedlerchr f69c76c
Cleanup css
HoussemNasri 4f6d227
Remove redundant icon style
HoussemNasri baeb1dc
Rename style class field-value to merge-field-value
HoussemNasri 9905fe0
Remove old Merge entries UI
HoussemNasri c37fbd3
Fix missing header styles
HoussemNasri 7dcc348
i18n
Siedlerchr 0434687
Garbage collect right cell when it's invisible
HoussemNasri a4049ba
Fix typo
HoussemNasri 516ca2f
Create GroupsFieldNameCell
HoussemNasri c4ff603
Create MergedGroups to record the state of the groups before and afte…
HoussemNasri 8bd1ccb
Create a factory class for creating field name cells
HoussemNasri 6ace504
Perform experiments for implementing groups merging
HoussemNasri 6187c26
Delegate field name cells creation to ThreeWayMergeView
HoussemNasri 8580d35
Improve groups merging function
HoussemNasri 5703cd4
Implement updateFieldValues to redraw the field row when left or righ…
HoussemNasri 4043a6d
Write a draft version of the logic to merge groups
HoussemNasri 9c152c6
Refactoring
HoussemNasri 4bf7b2e
More Refactoring
HoussemNasri 4dceb2e
Merge groups only when left and right entries have different groups
HoussemNasri 8cf5bc4
Add row constraints to fix UI lagging when updating field values
HoussemNasri ffe4f04
Minor refactoring
HoussemNasri c7edbe3
Don't merge common groups between left and right entries
HoussemNasri 2f59a69
Refactor GroupsFieldNameCell constructor
HoussemNasri 5ba051b
Allow groups field row to grow in height
HoussemNasri fcc0667
Fix select all left/right not working properly
HoussemNasri 99dd862
Update diff when a field value changes
HoussemNasri 754d20f
Add the merge icon and style css
HoussemNasri 9561db2
Extract merge and unmerge commands into their own classes
HoussemNasri b161536
Refactoring
HoussemNasri 1519bb1
Record groups merging operation using CompoundEdit
HoussemNasri 228f56e
Cancel groups merge when user choose 'Cancel' in the merge entries di…
HoussemNasri a9d7a7f
Make FieldNameCell take only one action
HoussemNasri 2bf5f66
Set groups merge action to MERGE by default
HoussemNasri 7e25fe5
Fix Unmerge button always disabled
HoussemNasri 1af0bc4
Cleanup
HoussemNasri 43f8aca
Almost f**** everything up. I deleted GroupsFieldNameCell content by …
HoussemNasri 9faebb6
Checkstyle
HoussemNasri 650fddf
Remove unused MergedGroups class
HoussemNasri 1a599f5
Register groups merge edit into UndoManager
HoussemNasri fde0bb7
Cancel merge groups edit in the DuplicateResolverDialog when user cho…
HoussemNasri 008e7ea
i18n
Siedlerchr 5bf4ad9
Introduce ThreeFieldValuesViewModel
HoussemNasri 73ddbc8
Merge clones of left & right entry rather than the original ones
HoussemNasri d05373b
Optimize imports
HoussemNasri 6522f94
Refactor DuplicateResolverDialog to merge clones of left and right entry
HoussemNasri b7ab235
Select the other entry groups when one entry has no group
HoussemNasri 4212cc7
Remove unused property
HoussemNasri c8d47b4
[WIP] Convert ThreeFieldValues to MVVM
HoussemNasri 884aa53
Move business logic to the view-model and update UI via binding
HoussemNasri ae6babd
Consider equal left and right fields as merged
HoussemNasri f0c1f1c
Move initial selection code to the view model
HoussemNasri ae99ef4
Refactor
HoussemNasri e16ae47
Hide rightValueCell and extend leftValueCell to 2 columns when fields…
HoussemNasri 737045a
Prepare for adding the ability to merge fields other than groups
HoussemNasri acf63ee
Rename ThreeFieldValues to ThreeFieldValuesView
HoussemNasri 1dfe8a4
Delegate FieldNameCell creation to ThreeFieldValuesView
HoussemNasri 0210d71
Pass Bib entries to ThreeFieldValuesView rather than raw string
HoussemNasri 6a768eb
Move merge/unmerge commands to ThreeFieldValuesView
HoussemNasri e48bcbe
Bind field value cell text property
HoussemNasri 12e6f40
Create an undoable edit for undoing fields merging
HoussemNasri 75260de
Update bib entries when left and right field value properties change
HoussemNasri f3efc40
Update left and right field value properties when merging fields rath…
HoussemNasri 6d3e7cd
Unbind MergedFieldValue property because it can't be edited when bound
HoussemNasri 184cd1a
Cleanup
HoussemNasri 874952e
Move merged entry update logic to ThreeFieldValuesViewModel
HoussemNasri 3541cd5
Implement algorithms for merging groups and keywords
HoussemNasri 075da2b
Pass FieldMergerFactory to ThreeFieldValuesView
HoussemNasri b2ddc8a
Move isMergeableField method to FieldMergerFactory
HoussemNasri fb40879
Delete cancelGroupsEdit()
HoussemNasri 2c7339a
Fix KeywordMerger implementation
HoussemNasri 11fb4f1
Fix a bug that deselects both fields after they are unmerged
HoussemNasri ef212c0
Rename 'ThreeFieldValues' to 'FieldRow'
HoussemNasri 3752f16
Cleanup
HoussemNasri 0a8f9d7
Hide diffs when both values are equal
HoussemNasri 6eea335
Fix typos
HoussemNasri e1667d9
Select LEFT value after merging fields
HoussemNasri 383dd76
Logging
HoussemNasri 2f58d9b
Implement merging comments
HoussemNasri 4aaabf0
Improve groups and keywords merger implementation
HoussemNasri ecf1eeb
Change merge/unmerge buttons tooltip text based on the field to merge
HoussemNasri b1e2951
Implement file merging
HoussemNasri dd8457c
Encode the resulting string from merging files
HoussemNasri 8c3a1e0
Refactor merge/unmerge fields command handling
HoussemNasri 15f3de3
Declare Actions with the builder design pattern
HoussemNasri eb8429c
Remove MergeableFieldCell dependency from the merge/unmerge commands
HoussemNasri 09b6073
Add logs
HoussemNasri 2ef9a52
Disable field's merge button when field values are equal
HoussemNasri c3c76cb
Update code documentation
HoussemNasri 4829168
Rename 'AbstractCell' to 'ThreeWayMergeCell'
HoussemNasri fa3927d
Pass arguments to Localization.lang using '%0' not '%'
HoussemNasri d707561
Decompose the ToggleMergeUnmergeButton into its own class (or component)
HoussemNasri 94626dc
Include original left and right entries in EntriesMergeResult
HoussemNasri dc9293d
Make entries merging logic reusable
HoussemNasri a984a97
Rename ChangeDisplayDialog.java to ExternalChangesResolverDialog.java
HoussemNasri fce5ff9
Create ExternalChangesResolverViewModel
HoussemNasri b9d7bc1
Design the ExternalChangesResolverDialog
HoussemNasri 3811561
Implement a method for opening an advanced merge dialog for modified …
HoussemNasri 00722e1
Wrap the UI in a dialog pane
HoussemNasri ba86932
Convert change name to a StringProperty instead of a raw string
HoussemNasri 1f908f6
Populate table view with changes
HoussemNasri 71c2144
Remove 'Accept changes' and 'Dismiss' buttons from the dialog
HoussemNasri 97a5f1d
Allow selecting multiple changes
HoussemNasri bad443b
Rename 'Accept Theirs' to 'Accept' and 'Accept Yours' to 'Deny'
HoussemNasri 3b31d58
Apply changes when before the dialog
HoussemNasri 54daebb
Cleanup FXML
HoussemNasri 3e9cd28
Remove old UI code
HoussemNasri c5599b7
Close dialog when all changes are resolved
HoussemNasri 16bb186
Enable the 'Merge...' button only if the selected change has an advan…
HoussemNasri 263aa60
Select the first change after opening the dialog
HoussemNasri f0fbd87
Open the advanced merge dialog when 'Merge...' is clicked
HoussemNasri 0d33e57
Don't open the advanced merge dialog when 'makeChange()' is called on…
HoussemNasri 358b235
Display a preview of the deleted entry
HoussemNasri 76f8849
Display information about the selected change in the bottom detail node
HoussemNasri 698b801
Merge branch 'GSOC-improve-collab-dialog' of github.com:JabRef/jabref…
Siedlerchr 681edea
Merge remote-tracking branch 'upstream/main' into GSOC-merge-fields
Siedlerchr 20c181c
Merge remote-tracking branch 'upstream/main' into GSOC-fully-function…
Siedlerchr 6178ccb
Merge remote-tracking branch 'upstream/GSOC-improve-collab-dialog' in…
Siedlerchr 0a62304
Revert "[WIP] [GSOC22] Improve the external changes resolver dialog" …
Siedlerchr d43c3f9
Merge branch 'GSOC-fully-functional-three-way-merge' into GSOC-merge-…
HoussemNasri ec992a2
Use '==' to compare enums
HoussemNasri bd7a01c
Merge branch 'GSOC-merge-fields' of https://github.com/JabRef/jabref …
HoussemNasri 11d87a6
Move keyword merging logic to KeywordList class
HoussemNasri 331725a
Remove default constructor
HoussemNasri 5e7a474
Compare keywords equality without considering order
HoussemNasri 4224dab
Test KeywordList#merge
HoussemNasri a4d9d22
Merge remote-tracking branch 'upstream/main' into GSOC-merge-fields
HoussemNasri ad14469
Fix I10n
HoussemNasri d381e9e
Fix I10n
HoussemNasri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.jabref.gui.mergeentries; | ||
|
||
import org.jabref.model.entry.BibEntry; | ||
|
||
public record MergeResult( | ||
BibEntry leftEntry, BibEntry rightEntry, BibEntry mergedEntry | ||
) { | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use the JabRefAction together with the ActionFactory ? It should already cover the cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how that would work. The idea behind the builder and
ActionImpl
is to create instances oforg.jabref.gui.actions.Action
without implementing it; which can be very verbose.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you could either use them as anonymous classes or as separate classes. The latter is probably useful if you are reusing them in multiple placess.