Latent Editor Actions

We've revised the paragraph editing logic to be more economical in how and when it sends update actions to a wiki server. This shows as simpler sequences in the page journal and hopefully fewer lost paragraphs while editing over slow connections. github

Type enter to split a paragraph in two.

Type delete to rejoin paragraphs after a split.

We call split & join as paragraph refactorings because they change the item structure of the page.

We once held to the principle that there would be an item on the server underneath every editing textarea on the screen. We've relaxed this expectation in order to optimize the interactions between client and server.

We now withhold information about an open textarea until editing is complete. Where we would once add an empty item before editing it we now add a completed item.

The editor keeps more state in order to know what actions are appropriate in any given sequence of splits, edits and joins. We call this state the latent actions.

We can have latent actions that will be discarded without the server ever seeing them. For example, a long sequence of enter, delete, enter, delete, will create and destroy a latent item without ever sending it to the server or recording it in the journal.

Think of latent actions as provisional actions that prove useless and are then filtered out of the edit stream before they reach the server or the journal.

Nick Hallahan wrote the original split/join logic and suggested this optimization at that time. I argued for the simpler and more tightly synchronized editor and prevailed.

Jon Richter and other contributors complained of useless actions in the journal. Again I argued that they could be condensed in various ways as a post process and prevailed.

I know folks have suffered data loss due to my insistence on guidance from experience. For this I apologize. The optimizations now coded as latent actions have been needed for some time. Agile developers recite YAGNI, You Aren't Going to Need It. This case they are wrong.

For a demonstration of the new editor, see the journal up to this paragraph.