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

External Changes resolver should show the bib entry source next to the preview #9509

Closed
Siedlerchr opened this issue Jan 1, 2023 · 1 comment · Fixed by #9533
Closed

Comments

@Siedlerchr
Copy link
Member

Is your suggestion for improvement related to a problem? Please describe.
I am frustrated because I cannot see the BibTeX source for the changes

Describe the solution you'd like
Put the Preview and the bibtex source field display (read only) in a tab so I can toggle between it

Additional context
See screenshpt

grafik

@HoussemNasri
Copy link
Member

HoussemNasri commented Jan 2, 2023

Some context

The external changes resolver dialog is used to display the differences between the external version of your library (.e.g. the version stored on the filesystem) and the version loaded in JabRef. The differences (or changes as referred to in the code) can be read as the transformation done by an external program to our library. For instance, Added entry 'Dag2' implies that an external program added a new entry with a citation key 'Dag2'. In addition to displaying changes, the dialog allows you to review them by providing the option to accept or deny each change in your library.

In the code, changes are modeled in two classes, DatabaseChange and DatabaseChangeDetailsView:

  • DatabaseChange: This class provides the code that modifies the database when the user accepts a change. Not that this is an abstract class and should have a different implementation for each type of change.
  • DatabaseChangeDetailsView: This class creates the UI to show more information about the change. For example, when an EntryAdd change is selected, the details UI is a preview of the added entry with its title, authors, journal, etc. Note that this is an abstract class too.

The problem at hand originates from the way EntryAdd, EntryDelete, and EntryChange details UI is constructed. Currently, the details UI for the mentioned change types shows only a preview panel of the added/deleted or changed entry. The preview shows only a subset of the fields that the entry contains. For example, if an external program added a new entry that has a custom field I wouldn't be able to see the value of the field in the preview.

Since we can't show all fields of an entry in the preview panel without messing up the UI, the best solution here is to show the BibTeX source of the entry.

Code Hints

public final class EntryAdd extends DatabaseChange {

PreviewViewer previewViewer = new PreviewViewer(bibDatabaseContext, dialogService, stateManager, themeManager);
previewViewer.setLayout(preferencesService.getPreviewPreferences().getSelectedPreviewLayout());
previewViewer.setEntry(entryAdd.getAddedEntry());

public class SourceTab extends EntryEditorTab {

Requirements

  • Show the BibTeX source along the preview panel in the details UI of the deleted/added entry for EntryAdd and EntryDelete changes.
  • Show the BibTeX source of the on Disk/on JabRef versions of an entry in the details UI for EntryChange changes as described in this comment
  • The preview panel and BibTeX source UI should be in separate tabs
  • The BibTeX source UI should be read-only.
  • (OPTIONAL) Show a label to indicate when the BibTeX source is read-only.

Useful Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants