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.
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 listscats : ["Tabby", "burmese", "Siamese"]dogs : ["Poodle"]3. Transformation joinpets : =cats.Join(dogs)2. Transformation filterpedigree_pets : =pets.Filter(x => isPedigree(x))4. Manually edit pedigree_petsadd, "Koi", at position 2edit, "burmese" -> "Burmese"resultpedigree_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 catscats : ["Tabby", "burmese"]resultpedigree_pets : ["Burmese", "Koi", "Poodle"]
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
blue burmese we have to decide what happens to the manual edit that changes
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.
If making a change, how to identify you are making a change to the output or the source?
Maybe allow a user to select intention later when they see an automatic update hasn't done what they wanted?