-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Allow users to review backup changes before restoring them or merge them selectively #9311
Conversation
- This logic will be used for diffing backup and current library, so it make sense to move it from ChangeScanner to its own class.
* Included localization prefs in GeneralPreferences * Convertet getLanguage to new prefs pattern * Extracted localization from MetaDataDiff in logic * Refactored FileHistory and converted getFileHistory to new prefs model * Partial localization without restart * Convert list to EnumSet * Used pattern matching and applied IDE suggestions * Fixed comparison of optionals
* Fix for issue #9157. Added method that capitalizes first letter of every word, including words after hyphens. * Added test cases for CapitalizeFormatter
I was attempting to handle the dialog actions within the dialog class, but encountered some roadblocks. For example, when the user clicked restore from backup, I wanted to run the restore backup code without blocking the FX thread, so I wrapped it in a BackgroundTask#wrap. However, the database loading task in OpenDatabaseAction#loadDatabase will continue because the dialog is closed once the action is clicked, and the JVM continues running the code at BackupUIManager#showRestoreBackupDialog.
- An external change used to represent a database modification received from an external program. After this pr, an external change can also be a modification received from a backup library, and maybe later someone will use it to compare two libraries . For the above reasons, DatabaseChange is a better name.
- Because 'applyChanges' doesn't perform any IO operations or heavy computing, wrapping it in 'Platform.runLater' is unnecessary.
src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java
Show resolved
Hide resolved
This is a great feature! However, I believe the 'Backup found' dialog is not the best place to access the feature. Thinking about it from the users' perspective, they would want to see their library as soon as possible. They may have lost one entry or all of them; they can't know (Maybe we should load the library before showing the dialog?). Browsing and comparing backups can take time, and it isn't necessary at that point because the backup libraries aren't going anywhere. At that point, it is preferable to have a simple UI with limited options. Once the library loads and they have done reviewing the damage, they can browse the backups and select the appropriate backup. I really like the idea, but it is unfortunately out of scope. I would even argue that developing it would require more lines of code than this PR. This would make an excellent university project, in my opinion. |
I don't believe it's the best place to have the open backup folder feature. Perhaps we should include an 'Open backup folder' and an 'Open application data folder' button in the about dialog. |
In addition, we can make the backup file name a hyperlink, when it's clicked it opens the backup folder and selects the latest backup. |
Sounds somewhat nice, but does it fit in our current design pattern? Or should it be a button? |
@calixtus Four buttons/options seem excessive and overwhelming for one dialog. I don't recall seeing hyperlinks for opening folders in JabRef, so this could be a new pattern. If we can have a non-blocking dialog like the one shown below from Adobe PDF Reader, users will be able to access their backups from the about dialog if they wanted to. |
…e dialog - In line 98, calling getVisibleChanges().remove(oldChange) might trigger the accepted changes to be applied and the dialog to close, thus, any change marked as accepted after that line will not be applied.
# Conflicts: # src/main/resources/l10n/JabRef_en.properties
# Conflicts: # src/main/java/org/jabref/gui/collab/ChangeScanner.java # src/main/java/org/jabref/gui/collab/DatabaseChangeResolverFactory.java # src/main/java/org/jabref/gui/collab/entrychange/EntryChangeResolver.java
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.
At a first glance looks good. Will test it and take a other look tomorrow
src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java
Outdated
Show resolved
Hide resolved
@@ -256,7 +255,7 @@ | |||
} | |||
|
|||
.unchanged { | |||
-rtfx-background-color:#0000; | |||
-rtfx-background-color: #0000; |
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.
Extract that to a color constant?
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.
Tested locally and works fine.! Hyperlink is cool feature!
* upstream/main: (37 commits) Update database context in state manager after loading (JabRef#9450) Bump classgraph from 4.8.151 to 4.8.152 (JabRef#9448) Bump appleboy/ssh-action from 0.1.5 to 0.1.6 (JabRef#9443) Bump Pendect/action-rsyncer from 1.1.0 to 2.0.0 (JabRef#9444) Bump jackson-dataformat-yaml from 2.14.0 to 2.14.1 (JabRef#9445) Bump unirest-java from 3.14.0 to 3.14.1 (JabRef#9447) Bump postgresql from 42.5.0 to 42.5.1 (JabRef#9446) New Crowdin updates (JabRef#9435) Return absolute path in case an absolute one is given (JabRef#9433) New Crowdin updates (JabRef#9434) Fix for issue: right click menu 6601 (JabRef#9271) Fix modernizer and refactor protected terms (JabRef#9427) Observable Preferences (OpenOffice) (JabRef#9422) Allow users to review backup changes before restoring them or merge them selectively (JabRef#9311) Bump slf4j-api from 2.0.4 to 2.0.5 (JabRef#9428) Bump archunit-junit5-api from 1.0.0 to 1.0.1 (JabRef#9429) Bump jackson-datatype-jsr310 from 2.14.0 to 2.14.1 (JabRef#9430) Bump lucene-highlighter from 9.4.1 to 9.4.2 (JabRef#9431) Fix weird checkbox styling (JabRef#9425) New translations JabRef_en.properties (Italian) (JabRef#9424) ...
Closes #9066
Notes
The majority of the changed files are the result of changing terminology from 'ExternalChange' to 'DatabaseChange.' 'DatabseChange' now makes more sense because it can represent a change from a backup database too (rather than just external files).
Description
The goal of this feature is to prevent data loss in the event of a corrupted backup (see #9063). Users can review the changes that would happen to their database when they choose to restore the backup. Alternatively, they can selectively merge some of the changes from the backup database into their database.
Feature Workflow
a. User opens a library
b. JabRef detects a difference between the library and the latest backup
c. JabRef launches the restore backup dialog
d. User selects Review backup to review backup changes
e. User has done reviewing and chooses to close the Review backup dialog
f. If the user approves the changes then he can select Restore from backup, otherwise he can select Ignore backup.
a. User opens a library
b. JabRef detects a difference between the library and the latest backup
c. JabRef launches the restore backup dialog
d. User selects Review backup to review backup changes
e. User resolves the changes by selecting Accept or Deny for each change
f. User resolved all changes and the dialog is closed
g. JabRef applies the accepted changes to the current library
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)