notes · thoughts ·
Fresh data should not erase a form in progress
The server original and the values a user is editing have different roles. Synchronizing an edit form means deciding when input may be overwritten, as well as how to fetch fresh values.
I once worked through a problem where the server original changed but an edit form kept its previous initial values. If fetching server data again does not update the form, synchronization seems to be missing. But overwriting the form every time the server value changes creates another problem: the user’s input may disappear.
Treating the server values and the form values as the same state leaves me wavering between these two problems. Server data is the original consulted when editing began. The form is a draft the user is changing based on that original. They share a starting point, but their roles differ.
When is overwriting acceptable?
If the user has not touched the form, applying a changed original is natural. If editing has begun, preserving the input may take priority. Whether the screen should also notify the user that the original changed depends on its purpose.
Preserving the whole form and preserving only edited fields are different choices too. Updating untouched values can show more current information, but it may mix values from different moments within one form. If fields only make sense together, that combination matters.
Working through this led me to think that the overwrite policy comes before choosing a library option. Behavior depends on whether a screen should continuously follow external values or let a user finish and submit a draft based on values fetched once.
The original being current does not by itself justify erasing the user’s draft. Conversely, preserving input does not necessarily justify indefinitely hiding changes to the original. When building an edit screen, I want to record how fetched data will coexist with user input alongside how to fetch it.