incremental HTML update
At the moment the htmlView
editor replaces the entire HTML code in the browser when the content changes. The same problem applied to the content of leaflet map windows. This is not only inefficient, but also leads to unchanged HTML elements loosing state. An example are summary tags, as in:
test = updateInformation () [] ("summary", "details") >&> viewSharedInformation () [ViewAs htmlView]
where
htmlView Nothing = Text ""
htmlView (Just (summary, details)) =
PTag [] [SummaryTag [] [Text summary], DetailsTag [] [Text details]]
The details should remain folded out when the text is updated.
The solution would be to determine a diff and apply minimal updates to the DOM.
Maybe the function iTasks.UI.Editor.Common.diffChildren
can be generalised and reused for determining updates of of children of HTML nodes.
@baslijns do the new editors have any influence on this? I think it's independent of possible new ways of doing incremental updates, as this is a solution only for specific editors.