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

[WIP][GSOC22] - C - Improve the external changes resolver dialog #9021

Merged
merged 497 commits into from
Aug 30, 2022

Conversation

HoussemNasri
Copy link
Member

@HoussemNasri HoussemNasri commented Aug 3, 2022

Contributes to #6190


does not fix:


Screenshots

Before:
grafik

After:
image
image
When clicking "Merge..":
grafik

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

- Sorted fields by name
- Removed internal fields
- When cell is empty there is no point of creating a label object
- Implemented UnifiedDiffHighlighter
- Only unified diff view will be shown for now
- Added "updated" style class for styling CHANGE diffs
HoussemNasri and others added 3 commits August 23, 2022 19:29
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());
Copy link
Member

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?

Copy link
Member Author

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());

Copy link
Member Author

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.

Copy link
Member

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);
Copy link
Member

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 {
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

see ExternalChangeDetailsViewFactory

Co-authored-by: Christoph <siedlerkiller@gmail.com>
@Siedlerchr
Copy link
Member

I only got some minor comments left, will need to test it but I think overall this is an excellent improvement

Copy link
Member

@Siedlerchr Siedlerchr left a 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!

@calixtus
Copy link
Member

I'll have the honor.

@calixtus calixtus merged commit 05ff677 into main Aug 30, 2022
@calixtus calixtus deleted the GSOC-improve-collab-dialog branch August 30, 2022 18:57
Siedlerchr added a commit that referenced this pull request Sep 2, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collaboration project: GSoC status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants