It looks good and behaves nicely but I have found problems. Interactions in display mode are not always being saved.
I haven’t been able to identify anything consistent about this. I first noticed it when I was testing to see what the text looked like after modifying the check list in display mode. Going into edit mode immediately after making a change in display mode, the most recent change in display mode wasn’t stored. (Editing in text mode and going back into display mode is always accurate in my tests). I noticed that when I made a change in display mode, then switched notes, then returned to the recently edited note the change was stored. However, that isn’t always true. I can make changes, switch notes, switch back, and the change is not stored and display mode now reflects the state of the text document. In other words, my changes have disappeared…
I have noticed an issue arising from editing in display mode associated with switching notes.
Make a change to a task list item in display mode.
Click on a different note in the note list view.
2.1 The correct note is displayed for viewing/editing
2.2 The wrong note is highlighted in the list view ( on my machine I can see the correct line highlight in response to my mouse-click then the selection reverts to the previous note.
2.3 The currently selected note in list view does not respond. All other items in the list are responsive.
I’m happy to say that all the hard bits are mostly done.
Convert HTML used for the display from special characters to input tags.
Add Javascript Event Listeners for each checkbox to be notified when the box is changed.
Determine state of the box (checked or unchecked) after each change.
Pass each change back from the page being displayed to the Notenik Swift code.
Store each change for later processing (because it’s too expensive an operation to scan through the body text for checkboxes each time one is clicked in the display).
Find and update all of the different ways a user might indicate that they are done with the display of a particular note (this is the part that needs a bit more work).
When a user leaves the display for a note, check for pending checkbox changes and, when found, apply them to the body of the Note, and save the updated Note to disk.
As we say in the trade, all it lacks is finishing up!
I’ll try to polish it a bit more before the end of the week (assuming Sonoma doesn’t throw me any curves).