That’s a great question @mrthomaswhitehead—and something that we wrestled with in developing the parallel states feature.
One perspective is that “transitions should be defined in the states in which their events are possible.” If that’s the case, then you’d probably want to specify transitions to multiple states, as per your example:
Example& Menu Menu Shown Menu Hidden Section Section A click menu button -> Menu Hidden, Section B Section B click menu button -> Menu Hidden, Section A
To us, this felt a little weird on the “to” side of the transition, since we’re trying to convey the configuration of both parallel children. This transition might make more sense on the parallel parent (
Example&), but then we lose that information about when the text input event can occur.
The other philosophical approach would be to think of events as completely exogenous—and only focus on how the events affect the states:
Example& Menu Menu Shown click menu button -> Menu Hidden Menu Hidden click menu button -> Menu Shown Section Section A click menu button -> Section B Section B click menu button -> Section A
This feels rather repetitive, rather than having a single event cause all the necessary actions to occur.
We ultimately decided on the latter to get the feature shipped, but both sides probably have arguments for them. We’re definitely open to thoughts on which approach is best or alternatives.