Let’s just dive into what’s been done since I last posted an update….
Modal Dialog Component
With this new-to-us technology stack, we continuously discover that a lot of what we expect to be already done for us has to be created ex nihilo. For example, while there is a “context menu” component available to us in Electron, it isn’t very sophisticated and can only handle the simplest tasks. So we had to create context menu functionality for ourselves.
Similarly, there’s a generic “message box” dialog to use for error messages and to ask simple yes/no questions, but we found ourselves frequently needing to get input from the user, such as entering the name of a new bookmark category or choosing whether or not to clear daily reading progress when changing the start date of a devotional book. The built-in message box can’t do that.
We ended up creating a generic modal dialog that could be used to display error messages, ask simple questions, or gather (and validate) input. This is a little harder than you might think, but taking the time to do it allows us to standardize the way input is gathered in the app and gives us control over the appearance of the dialog so it can match the rest of the app. It also makes it very quick and easy to create a fairly complicated data collection dialog when we need it.
Once we had that component, we went back and made use of it in several dozen places. Some were easy and some required a little more work. But we’re happy with the results. This is the kind of task that takes a long time in the moment but makes future enhancements to the code significantly easier and faster. And it gives the user a much-better experience.
Bookmarks, Highlights, and other Study Panel Features
Since the last update we rounded out the features of bookmarks in the app by giving you the ability to create new categories and move the bookmarks from one category into another. We added a (somewhat dangerous) feature that allows you to delete all your bookmarks in one operation. We used our new modal dialog component (described above) to ask you 2 or 3 times if you’re sure you want to permanently delete all your carefully created bookmarks.
We added the ability to change all the highlights in one color to another color. We changed some existing features to use our new modal dialog, and, like we did in the Bookmarks pane, made sure we were using the user’s global font size preference in the Highlights pane.
With our new modal dialog in-hand, we changed the implementation of some existing features to use it. And we made sure the Study Panel panes were using the global font size we’ve talked about in previous updates.
“Accelerator keys” are the keystrokes displayed next to the application menu items that can be used as shortcuts to that menu item. Many of these you do without thinking about it, like Ctrl+C (Cmd+C on a Mac) to copy and Ctrl+V (Cmd+V) to paste. Others you discover when you realize you’ve been selecting an item from a menu over and over and wish there was an easier way.
Since the last update, we’ve implemented the ability to assign virtually any combination of modifier keys (such as Control and Alt) and a letter or number key to any operation in the program. So if you find it easier to remember Ctrl+S for “search” instead of Ctrl+F for “find”, just reassign Ctrl+S to the “Find” operation in the menu. If you find yourself repeatedly turning verse numbers on and off and get tired of selecting “Hide Verse Numbers” from the “View” menu, just assign Ctrl+Shift+H to that item. Now one key will toggle your verse numbers on and off.
Part of implementing this feature was making sure that everything you might want to do in PocketBible is present in the menus somewhere so that it can be assigned to a key. We discovered, for example, that we hadn’t yet implemented “Next/Previous Pane” and “Next/Previous Book in Pane”, so we added those to the “View” menu and implemented them in the code.
Not every key can be reassigned. Some are just too well-integrated into the way some of the built-in functionality of the code works to be changed. We manage that for you and warn you if you’re trying to do something that isn’t going to work.
We’ve been enduring problems with splitting and resizing panes since the beginning of the project. During this period we attacked these problems.
Let me digress briefly to talk about how programming has changed since I started doing this 40 years ago. Back then we wrote our own code. When we had to, we would purchase a “library” that implemented something hard, like managing a database. These libraries were written by knowledgeable, professional programmers, thoroughly tested, and only updated when necessary to add major new features.
Today, the Internet makes it possible both to distribute and to discover little components that supposedly make programming easier. Yes, there are major components like database managers, but there are also tedious little components that do nothing more than remove leading or trailing spaces from strings. It can be easier to import someone else’s code than write it yourself.
You don’t know the pedigree of the people who write these components. Often they write some complex thing (like the virtual list and context menu components we use in PocketBible) then just vanish into obscurity, leaving you to maintain their code and fix the bugs they left in it (like the virtual list and context menu components we use in PocketBible).
The component we chose very early in the project to manage the splitting and resizing of book panes has been both a blessing and a curse. It definitely saved us some time. At least up until earlier this month.
Example: One of the things it does is notify the app that the user has dragged a splitter between two panes and changed their relative sizes. The sizes are expressed in percentages. So the original size might have been 50/50 and now the new sizes are 30/70. That’s great. PocketBible records the new sizes so that it can restore them the next time you run the app. So far so good.
The problem is that it uses the same notification message to tell you that it has internally changed the size of a pane part-way through an operation. So if you have two panes split 50/50 next to each other, and the left pane is split 30/70 vertically (one above the other), and you close the top left pane, it will notify you that you now have a left pane of size 70 and a right pane of size 50. It doesn’t tell you that the left pane is 70% high and that the right pane is 50% wide. Nor does it tell you that in just a few milliseconds it’s going to reorient and resize the panes, and further, that it’s going to do that incorrectly, leaving your left pane occupying 58.33333% and right pane 41.66667% of the screen where they used to be 50/50 before. (Exercise for the reader: Why those weird sizes?)
One of my tasks recently has been to attack this issue and try to resolve it. I believe it’s mostly conforming to my wishes but it took some doing.
While messing with the screen layout, I made the splitters between the panes a little thicker to make them easier to find with your mouse (or your finger tip if you’re using a touch screen). I gave them little visual “handles” to make it more obvious that they can be dragged to adjust their size.
Speaking of the screen layout, other changes were made to the book panes.
We discovered that closed panes were still “alive” in some respects and were frantically trying to do things in the background as if they were open. This had no visible impact on the app but made it run terribly slow after a while.
We completely re-implemented the book tabs at the bottom of each book pane. They were trying too hard to look all fancy and clever and as a result they didn’t always work correctly. While we were in there we made sure the tabs adjust their size to your chosen font size so you don’t end up with nice, readable Bible text and tiny, unreadable tabs.
The pop-out tooltip that tells you where you are as you drag the scroll bar scroller was getting stuck in the “on” condition. That’s been fixed.
We’ve been ignoring problems with interlinear books like our Greek NT’s and the NIV with Goodrick-Kohlenberger Numbers. Some of the interlinear attributes weren’t being displayed. Now they are.
First, the “easy” part: We now automatically calculate a good color to use for text selection (when you drag your mouse to select text). If you think about it, this isn’t straightforward. It needs to be visible against both the background and the text color. Both of those are user-configurable and can be anything. So you can’t just choose a pleasant shade of blue and call it good. The program now finds a color using an appropriate hue from your chosen color scheme that will work for text selection.
The real challenge was handling “select all” in a book pane. It’s simply not realistic to support the ability to hit Ctrl+A (Command+A on a Mac) then Ctrl+C (Command+C) and expect to copy an entire 400 MB commentary to the clipboard (in both plain-text and rich-text HTML). The copyright owners from whom we license texts wouldn’t like it, and it would present some real programming challenges.
On top of this, there’s the fact that PocketBible does not keep the entire book displayed all the time. We just make it look like it is. In fact, it works more like Facebook, where we render additional paragraphs of text as you scroll farther and farther into the book. So when you say “select all”, we actually only select the portion of the text that has already been rendered, which consists of 1 or 2 screen heights above and below what you can see.
A similar problem happens when you start selecting in the middle of the book and drag off to the right of the pane. Selection will extend toward the bottom of the book. (If you drag off to the left, it extends toward the top of the book.) Again, the rest of the book isn’t really there.
The best answer we could come up with was to just make sure we highlight and copy what is rendered. This has the benefit of limiting the amount of text you put on the clipboard, satisfying both our copyright owners and making it so you don’t have to wait while we render an entire Bible into your clipboard.
Miscellaneous New and Updated Features
- Changed the Journal icon (AFS feature).
- Adjustments to the way bookmarks are handled in the context menu. It can’t realistically handle the situation where dozens of verses are selected, because it lists options for each selected verse. So if you select 100 verses, you can bookmark them all, but you won’t see each one of the individual verses listed on the context menu.
- Cloud Library wasn’t showing all owned books. Made changes mostly on the server to deal with this.
- Fixed user interface misbehavior of icons on buttons when the buttons got smaller.
- Fixed a database initialization bug that was causing tables to constantly be recreated, which would fail after the first call. This resulted in the database operation also failing.
I haven’t talked about this for a while, and a few of you have asked. There’s a very common belief that writing software is like baking a cake. If you break down the tasks and and add the amount of time each takes, you’ll get the total time and can accurately predict when it will be ready to eat.
But it turns out it’s more like writing a college textbook for a subject you know well, but doing it in a language you’ve never learned using publishing tools you may have to create yourself. You can quickly learn bits of the language and maybe write an initial draft that looks pretty good. But as you write, you learn more about the language and have to go back and make corrections to previously written chapters. Then you have to decide on where illustrations are needed, figure out how to create them and how to arrange them in the text. Then there’s choosing paper, fonts, ink colors, cover design, binding style, dust jacket design.
Some parts of our probably ill-considered textbook analogy will be easy; other parts will be hard; and some of the hard parts will have to be re-done 2-3 times until you get them right. You might be able to predict completion dates for portions of it, but it’s pointless to try to predict a completion date for the entire project because you don’t really know what needs to be done until you do it.
People don’t believe me when I say we literally don’t have a planned release date for this product. You’d think after 40 years of writing software for business and pleasure, I’d know how long something is going to take. Instead, what I’ve learned in 40 years is that the “ship date” question is one that has no answer. If you try to answer it along the way, you’ll only disappoint people.
That being said, I felt going into this project that it was going to take 12-18 months. However, the further we got into it, the more we didn’t know.
The good news is that I feel like the to-do list is getting shorter. The bug list grows about as fast as we shrink it by fixing things, but those tend to be small tasks. In the interest of total transparency, I’ve included my list of remaining tasks below.
Interestingly, in the process of capturing screenshots for this article, I had to add items to the to-do list.
As you can see, a lot of these tasks are fairly minor; there’s just a lot of them. Some are harder or more unknown than they look.
- When multiple verses are selected, the reference isn’t formatted correctly in the context menu.
- When multiple verses are selected, the last verse appears before the first one in the context menu bookmark list.
- Dragging a book into a new pane results in an infinite render loop.
- Moving study pane to the right side (or moving it back to left side) causes the resizing controls to be lost.
- When moving study pane to the right, the book panes are not getting refreshed.
- Thoroughly test back/forward. May be capturing view state for history too often, like after normal scrolling.
- Verify that we’re loading the latest book ordering database when we see newer Bibles.
- Verify scroll by line and scroll by page is working. Not sure of the latter
- Manage input focus throughout.
- Implement date-sync for devotionals; save last date sync so we can use it when opening devotionals to the last synced date.
- Consider an option to make pane splitters narrow for mouse ops or wide for touch ops.
- If book panes get too small, it’s easy to scroll well past the end and confuse the loader
Go To Pane
- Consider moving book names to top of Go To pane for all book types.
- Make it look better when empty.
- Consider “add note” that adds at current location in active book. There have been serious problems with that on other platforms.
- Deleting Journal notes doesn’t refresh the list correctly. (AFS)
- Can sometimes get duplicate Journal notes somehow. (AFS)
- See if we can honor newlines in plaintext and retain those in the rich editor. Right now they are retained in the viewer but not the editor.
- Low priority: Switch to enable/disable enhanced search (even for book searches where it defaults “on”)
Preferences: Color Theme
Settle on color themes for free version and for AFS.
- Consider moving search back into main process.
- Verify we’re using global ui styles in the study tab.
- Verify we’re tracking the last-synced customer and don’t sync when it changes.
- Verify we’re always requesting data from the server when we need to and saving when we should.
- Use standard font sizes in preferences.
- Code review
- Organize the list of functions
Advanced Feature Set
Consider whether or not to release the base version before finishing AFS features
- Library Search
- Saved Desktops
- Today button
- Hover Tooltip over Links
Prepare for Release
- Resolve issues related to doing a release build
- Search task
- Locations of pre-installed books and images
- Locations of image caches; rendering caches
- Add platform landing page and catalog page for the app.
- Add catalog page for AFS subscription.
- Remove other Windows platforms (consider leaving the desktop version for Win7 die-hards).