BLOG

Combining manual and automatic edits

When we use tools like spreadsheets that can transform data, we often want to manually edit the outcome. The challenge is that we don't want our changes to be over-written if the source data changes. Instead, we want our tools to magically reapply our manual changes.

Example

Let us assume we have a tool for creating lists. The user can manually edit lists by adding, moving or changing items or they could apply automatic transformations.

For example, they might create a list, filter it, combine it with another list and then manually edit the result:

1. Manually create source lists
cats : ["Tabby", "burmese", "Siamese"]
dogs : ["Poodle"]
3. Transformation join
pets : =cats.Join(dogs)
2. Transformation filter
pedigree_pets : =pets.Filter(x => isPedigree(x))
4. Manually edit pedigree_pets
add, "Koi", at position 2
edit, "burmese" -> "Burmese"
result
pedigree_pets : ["Burmese", "Siamese", "Koi", "Poodle"]

If the user changes the cats list we want the change to ripple through the transformations 2 and 3 and still have the manual edits in 4 reapplied e.g.

5. Manually remove Siamese from cats
cats : ["Tabby", "burmese"]
result
pedigree_pets : ["Burmese", "Koi", "Poodle"]

Edits and Intention

Thorny supports operational transform for real-time collaboration. It records the stream of edits which can be reversed, replayed or merged with another stream of edits. This gives us a mechanism to record and re-apply manual edits after automatic transformations.

The problem is that the intention behind an edit is often ambiguous. Have we deleted an item because it is a duplicate, has a particular attribute or because we only want a list of three items? We can't achieve the user's goals unless we know their intention.

For example, if we edit the source list cats to change burmese to blue burmese we have to decide what happens to the manual edit that changes b to B. Was the user's intention to capitalise the specific word burmese or was it to capitalise the first word which is now blue? We can guess at intention but unless we ask a user what each key-stroke means we can't preserve intention just from raw edits.

UX challenges

  1. If making a change, how to identify you are making a change to the output or the source?

  2. Maybe allow a user to select intention later when they see an automatic update hasn't done what they wanted?