Refining Peruse Creator

Introduction

As per my last blog, the plan was to work more on Peruse Creator to extend it with a new functionality/approach to modify existing objects. So far, I’ve worked on extending the navigation between the visualized jump objects on Reader, extended Creator with a new component to handle modifying created objects, and refined some bits and pieces in Peruse generally. So, in this blog post, I’m going to describe briefly what have been done, and the future plans for the remaining days of SoK.

Extending Reader to Support Jumps Navigation Using Keyboard

This has been the most challenging part for me so far, I had to think more reactively instead of the usual imperative programming paradigm. But, with the highly appreciated help, and guidance from Leinir, we were able to refactor our original approach to a slightly different generic one that would help us in the future support visualizing/navigating other objects like Textareas for example. In Peruse, we support both viewing the comic book pages, as well as viewing the frames in these pages. Our original approach was to load all jump objects upon loading a new page, then setting the visibility of these objects accordingly upon switching to frames. However, this introduced a synchronization problem while initializing the frame. So we refactored this a bit, by actually setting/initializing the frame along with the frame model after the switching happens, then setting the new jumps model to a Repeater component to view them on the frame. That way we avoided the mentioned problem and we were able to easily select/unselect and activate particular jumps using the Tab and the Return keys accordingly. Here’s is the merged MR link.

The New EditPageArea Component

Originally, Peruse had a separate view for modifying page objects, it contained all page objects and user can modify objects as they like. For convenience we wanted to extend this with an overlay sheet that pops up whenever a user clicks on a particular object to edit. Heavily inspired by the original sheet AddPageArea used to create new objects, the EditPageArea modifies its layout according to the passed object’s type. It’s important to note though that the new sheet shouldn’t be opened using the regular approach of calling the open() function of a Kirigami.OverlaySheet, instead, the sheet should be opened via our function called editObject() this function accepts an object, along with its type. Here’s a video below illustrating the new functionality

IMAGE ALT TEXT HERE

Upon hitting the save button, we change the properties of the passed value to the new modified properties in the new form. Here’s the merged MR link

I’ve also fixed some minor bugs that occur while saving a comic book. The first one, is that some of the values are being reset before they get saved due to breaking property bindings, but that has been refactored by the new EditPageArea component MR :). The second one, is sending the correct ACBF (a file that contains all information about book including pages, frames, and pages’ objects) file size.

The Upcoming Days Plan

Me and Leinir agreed upon testing the added stuff during the past two months, making sure everything is working and behaving correctly, and fixing anything that seems to be abnormal. I’ll work then on extending Peruse to support creating polygonal shapes, instead of only creating rectangular ones. Here’s a MR made by wolthera for this, I’ll have a look at it, and see what can be done. Wish me luck!

Written on March 23, 2021