Plugin: Lootboxes

Introducing Lootboxes

Hello Joplin Community,

I'm happy to introduce the Lootboxes plugin!

Background

It is loosely ported from an idea I had for a personal project where, in an attempt to bring dopamine to the job search process, logging a certain amount of job applications within a deadline would enable you to open and accumulate lootboxes.

I discovered Joplin when they finally pulled the plug on the older version of OneNote that actually looked nice and simply worked as expected. I appreciate how Joplin is highly versatile yet direct in its design language. When I saw how it took advantage of its open source nature by enabling developers to write their own plugins, I decided I wanted to contribute something of my own.

To my surprise, this plugin was able to take good advantage of many of Joplin's strengths, such as the image caching system to avoid repeatedly re-querying media files, the synchronization engine to maintain state and handle conflict scenarios across devices, and not least the storage infrastructure, which has to be better than my 1 PostgreSQL db on a free hosting service.

Even though this is not a strictly tool-based plugin, I hope some of you who use to-do notes for productivity management can find it entertaining or helpful.


Features

  • Modify the number of to-do notes to complete in order to earn a lootbox within the plugin settings menu. To-do notes will automatically be converted when the lootbox panel is opened, and when a synchronization event is completed.

  • Customize the UI behavior with the checkboxes in the settings menu.

  • Configure a custom keyboard shortcut to toggle the lootbox panel in the Joplin settings. By default this is ctrl+3

Known Issues

  • When a media element is clicked on and expanded into the magnified dialog view, if the user moves their cursor out of the dialog bounds and presses esc twice to close the dialog, the dialog will disappear but the Joplin application will freeze as if there is still a dialog covering the screen. This is avoided for now by clicking the 'close' button to exit from the dialog.

Todo:

  • add more sorting and view options for earned lootboxes
  • enable functionality to specify subset of notebooks which are allowed to earn lootboxes, letting other sections function as normal
  • see if plugin can work well on mobile
  • investigate video element loading behavior
    • looks like Joplin implements native media caching that plays well with the content displayed in the lootbox panel. However, the video elements are often loaded as the blank media fallback element, only loading in when the mouseenter event is triggered...
      • perhaps the video preloading logic can be adjusted, or the caching logic can be adjusted to have these elements load in more smoothly.
  • investigate why clicking out of the big dialog and pressing esc twice causes the application to freeze
  • add more lootboxes
  • determine if it's beneficial to add an optional caching setting for 'all lootboxes' so new lootboxes can be earned offline
  • clean up the verboseLogs value in util.ts; make log messages more consistent in general

suggestions and feedback are welcome!

3 Likes