-
-
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
[WIP][GSOC22] - C - Improve the external changes resolver dialog #9021
Conversation
- Sorted fields by name - Removed internal fields
- When cell is empty there is no point of creating a label object
- Implemented UnifiedDiffHighlighter
- Just for testing
- Just for testing
- Only unified diff view will be shown for now
- Added "updated" style class for styling CHANGE diffs
src/main/java/org/jabref/gui/collab/preamblechange/PreambleChangeDetailsView.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/collab/stringadd/StringAddDetailsView.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
public final class StringRenameDetailsView extends ExternalChangeDetailsView { | ||
|
||
public StringRenameDetailsView(StringRename stringRename) { | ||
Label label = new Label(stringRename.getNewString().getName() + " : " + stringRename.getOldString().getContent()); |
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.
Maybe some comment about what is to be displayed here... huh?
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.
This view shows the state of the string after it is renamed, so if we have a string oldString : 1
and we rename it to newString
then this should display newString : 1
. I believe the use of stringRename.getOldString().getContent()
is what causes the confusion. So I think using getNewString()
might be a better fix than a comment.
Label label = new Label(stringRename.getNewString().getName() + " : " + stringRename.getNewString().getContent());
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.
Since this PR has already been merged, this could be addressed in another PR while working on the external changes resolver dialog.
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.
Yes, you can change the name as a side quest to the test PR.
} | ||
|
||
private ExternalChangeDetailsView createDetailsViewOrLoadFromCache(ExternalChange externalChange) { | ||
ExternalChangeDetailsView cachedDetailsView = DETAILS_VIEW_CACHE.get(externalChange); |
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.
Use the new computeIfAbsent method of the Map?
import org.jabref.gui.util.OptionalObjectProperty; | ||
import org.jabref.model.database.BibDatabaseContext; | ||
|
||
public sealed abstract class ExternalChange permits EntryAdd, EntryChange, EntryDelete, GroupChange, MetadataChange, PreambleChange, BibTexStringAdd, BibTexStringChange, BibTexStringDelete, BibTexStringRename { |
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.
Making an abstract class sealed imho defies its purpose to be extended. Sealed only make sense to prevent a normal class from being extended further or to use with interfaces and soon pattern matching
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.
see ExternalChangeDetailsViewFactory
src/main/java/org/jabref/gui/collab/ExternalChangeDetailsViewModel.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/collab/ExternalChangeResolverFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/collab/ExternalChangesResolverDialog.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Christoph <siedlerkiller@gmail.com>
src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java
Show resolved
Hide resolved
I only got some minor comments left, will need to test it but I think overall this is an excellent improvement |
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.
Okay, tested it also with a shared database and two instances of JabRef. Works fine!
I'll have the honor. |
* upstream/main: (387 commits) Show a warning in the merge dialog when authors are the same but formatted differently (#9088) Fix subdatabase from aux on cli (#9117) Visual improvements to LinkedFilesEditor (#9114) SLR Remove "last-search-date" (#9116) Hide diffs when one of the field values is blank a.k.a no conflict (#9110) Squashed 'buildres/csl/csl-locales/' changes from e637746677..b2afeb4d87 Squashed 'buildres/csl/csl-styles/' changes from c750b6e..8d69f16 Fix title case capitalization after en-dash characters (#9102) Update journal abbrev list (#9109) Fix CSL rendering in case of article (#8607) [WIP][GSOC22] - C - Improve the external changes resolver dialog (#9021) Bump jsoup from 1.15.1 to 1.15.3 (#9103) Bump checkstyle from 10.3.2 to 10.3.3 (#9104) Bump postgresql from 42.4.2 to 42.5.0 (#9105) Bump unirest-java from 3.13.10 to 3.13.11 (#9106) Include check for TimeStamp (#9089) Close OO connection on JabRef exit (#9076) Bump slf4j-tinylog from 2.4.1 to 2.5.0 (#9085) Bump bcprov-jdk18on from 1.71 to 1.71.1 (#9079) Bump tinylog-impl from 2.4.1 to 2.5.0 (#9086) ... # Conflicts: # src/main/java/org/jabref/gui/shared/SharedDatabaseUIManager.java # src/main/java/org/jabref/gui/util/DefaultTaskExecutor.java # src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java
Contributes to #6190
does not fix:
Screenshots
Before:
After:
When clicking "Merge..":
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)