Skip to content

Instantly share code, notes, and snippets.

@Ahmad45123
Last active February 3, 2023 14:45
Show Gist options
  • Save Ahmad45123/96471c91a33998ce586b0557d35b0a73 to your computer and use it in GitHub Desktop.
Save Ahmad45123/96471c91a33998ce586b0557d35b0a73 to your computer and use it in GitHub Desktop.
GSoC 2021 - Joplin - Conflict Resolution Plugin Project - Work Product

Conflict Resolution Plugin - GSoC 2021

A plugin was developed in order to make the process of resolving conflicts easier. It provides a nice diff-window in which you can see the differences between your current note and the note received from cloud.

Preview

What was done ?

The plugin could be considered to be made of 5 parts:

All planned features were fully developed. The plugin development was based on a "release-early, release-often" strategy where the plugin core was developed and released in the early weeks. After that, the plugin had many updates with gradual improvements. A pull-request almost every week.

Full plugin source code: https://github.com/joplin/plugin-conflict-resolution

Plugin homepage: https://discourse.joplinapp.org/t/plugin-conflict-resolution/19204

Research and decisions made

  • CodeMirror was decided to be used in order to stay consistent with the look of Joplin. Codemirror provides a diff-view builtin which was a huge plus on it's own.
  • The NoteSelectWindow was decided to be added to support conflicts created in older versions which don't have a linked note.
  • JUnit was used as it's the most popular testing library. Besides, it's also used in Joplin.
  • Fontawesome was also decided to be used as it's used already in Joplin.

Detailed timeline

Week 1

More Details

  • Added a context menu option to conflict notes that opens the dialogs.
  • Modified Jopin source code to save the source notes in conflict notes. (PR)
  • Dialog loads the two notes into a diff viewer powered by CodeMirror.

Week 2

More Details - Pull Request

  • Code refactoring in order to make it testable.
  • Titles were added as they could have a conflict as well.
  • UI was changed slightly.

Week 3

More Details - Pull Request 1 & Pull Request 2

  • Added a note select dialog for notes that don't have a conflict note assigned.
  • Changes to how I escape notes for viewing.

Week 4

More Details - Pull Request

  • Code refactored a little more to allow for a more general diff-tool in the future.
  • Added save and cancel actions.
  • Plugin was released for public use and testing.

Week 5

More Details - Pull Request

  • Added unit tests for the merging part.

Week 6

More Details - Pull Request

  • UI was refactored to allow for a better user experience.

Week 7

More Details - Pull Request

  • Joplin source code was modified to allow for plugins that can take almost full screen. (PR)
  • Changed plugin CSS to a responsive design.

Week 8

More Details - Pull Request

  • Added buttons to go to next difference and previous difference.
  • User is able to move all changes from left to right.
  • Added options to toggle wordwrap, align changes and collapse unchanged.
  • Changed to use fontawesome icons.

Week 9

More Details

  • Fixed bug where the context menu buttons were always enabled. (PR)
  • Progress in making the UI match Joplins theme.

Week 10

More Details - Pull Request

  • Dialog design was finalized. It now matches the current Joplin theme.

What's left ?

For a conflict resolution plugin, it does it's job pretty well. Nothing is left to do and the plugin currently works. However, more improvements could indeed be done such as:

  • Notifications when a conflict occurs.
  • Automatic merging of notes.

Challenges and learning

  • Time management, specially with Covid and juggling betweenn university and GSoC.
  • Test driven development.
  • How to make good UI design with good UX.
  • Communication skills.
  • Working in a huge codebase.
  • Project management
  • Git in-depth, used rebaseing and merging extensively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment