Week 3
June 21. - 27.
Progress
This week was mostly about university exams for me, so I apologize for not being able to show much, but I've still managed to make some progress. Most notably, here's the first screenshot of an acutal UI (no mockup)!
I was planning on releasing a working test version with this progress update, that's why it got delayed to Monday, but unfortunately a roadblock came up which I haven't managed to resolve.
The way the plugin is constructed, the state of the board (which column each note belongs to) is not kept by the plugin. It fetches the data directly from Joplin, using its native search feature. When a note is dragged between columns, the plugin first updates Joplin's database, then fetches the board state again.
This is really neat, because it keeps the plugin code simple, but there's one major issue: getting the updated board state after a drag is asynchronous, because it involves sending a query to the main Joplin process and waiting for a reply. Of course, this happens very fast, for a user the delay is not noticeable. The problem is that React, the framework I use for the UI, doesn't really know what to render in this short time. If I tell it to render nothing, the UI would flicker. If I don't tell it what to render, it would render the previous last known state, so the dragged note would just snap back for a split second.
Ideally, I'd like to tell it to hold on, and keep the dragged card "floating" in place just for a few more milliseconds, while the state is updated in the background. Sadly, even though I've been trying for the past 1,5 days, I just couldn't make it work with the drag and drop library (react-beautiful-dnd) I was planning to use (which is a really great lib, would be awesome if I could get it to work).
I will keep trying, I'm thinking about switching to a different, lower-level drag&drop library, which hopefully would be more flexible with async updates. If all else fails, I can replicate the board state in the plugin, though I'd prefer to avoid this.
Achieved
- Got a basic UI (drag&drop not working yet)
- Wrote full test suite for backend
- Smaller fixes to backend
Planned for next week
- Fix drag&drop
- Release first working test version
- Fix recursive notebook search
- (if there's time) Get started on the config UI
Thanks for following along, as always feedback is appreciated!