To further help with this, here's some draft documentation from 10.0:
The fact that your Layout creates a Canvas is *probably* analogous to the situation described above where a Window auto-creates a header, and if so, then that relationship is not something you should represent with EditNodes.
In general, you need to make a clear distinction between state that is created by the user (goes into the EditContext) vs state that the system creates automatically (not in the EditContext).
Because this is a distinction of *intent* it's very, very hard to work with highly synthetic test code, because we have no idea what's intended.
<h3>Stored vs Derived or Transient state</h3>
<p>
The purpose of having an <code>EditNode</code> for each UI component is to maintain a
distinction between the current state of the live UI component and the state that should
be saved. For example:
<ul>
<li> a component may have a current width of 510 pixels when viewed within a tool, but what
should persist is the configured width of 40% of available space
<li> a tool may allow end users to create a Window, and then drag components into the Window.
Every Window automatically creates subcomponents such as a header, but these should not be
persisted because they don't represent state created by the end user. Only the components
the end user actually dragged into the Window should be persisted
<li> while being edited, a component may change appearance in response to a mouse hover or
while selected, but we don't want these appearance changes permanently saved
<li> an end user may try out the effect of a property change, then abandon it and revert to the
default value. We don't want the temporary change saved, and we don't even want to save
the reversion to the default value - nothing about the saved state should be changed
</ul>
By being careful to save <i>only intentional changes made by the user</i>:
<ul>
<li> the saved state remains minimal in size, and re-creating components from the stored state
is more efficient
<li> the saved state is much easier to edit since it contains only intentional settings, and not
generated or derived information
<li> the stored state is more robust against changes over time and easier to re-use. When we
avoiding spuriously saving default values that the user has not modified, we avoid
possible conflicts when a saved UI is deployed to a new version or in a different
environment with different defaults
</ul>
<p>
The purpose of having an <code>EditNode</code> for each UI component is to maintain a
distinction between the current state of the live UI component and the state that should
be saved. For example:
<ul>
<li> a component may have a current width of 510 pixels when viewed within a tool, but what
should persist is the configured width of 40% of available space
<li> a tool may allow end users to create a Window, and then drag components into the Window.
Every Window automatically creates subcomponents such as a header, but these should not be
persisted because they don't represent state created by the end user. Only the components
the end user actually dragged into the Window should be persisted
<li> while being edited, a component may change appearance in response to a mouse hover or
while selected, but we don't want these appearance changes permanently saved
<li> an end user may try out the effect of a property change, then abandon it and revert to the
default value. We don't want the temporary change saved, and we don't even want to save
the reversion to the default value - nothing about the saved state should be changed
</ul>
By being careful to save <i>only intentional changes made by the user</i>:
<ul>
<li> the saved state remains minimal in size, and re-creating components from the stored state
is more efficient
<li> the saved state is much easier to edit since it contains only intentional settings, and not
generated or derived information
<li> the stored state is more robust against changes over time and easier to re-use. When we
avoiding spuriously saving default values that the user has not modified, we avoid
possible conflicts when a saved UI is deployed to a new version or in a different
environment with different defaults
</ul>
In general, you need to make a clear distinction between state that is created by the user (goes into the EditContext) vs state that the system creates automatically (not in the EditContext).
Because this is a distinction of *intent* it's very, very hard to work with highly synthetic test code, because we have no idea what's intended.
Comment