Allow targeting Parent / Substates for more shorter state names


Currently state names need to be unique. Which makes sense in the way that actions trigger states. But I think for the examples I did, I would have appreciated if I could use very short but more nested states, that I can adress by using a parent state. An Example of what I might want to do:

   Reset -> SwitchbuttonOne : Off
        click -> Off
        click -> On


This is definitely an issue that we’ve run into as well, and will only become more pressing as people start to design more complex state spaces.

We’ve thrown some ideas around, but we’re not ready to commit to anything — mainly because namespacing introduces quite a bit of complexity (in the spec grammar, how states are exposed to prototypes within the javascript data structure, etc.) and we’re not sure if it’ll be worth it.

That said, if you’re interested in language-design and semantics, I’d definitely be interested to discuss a more complete proposal / RFC that more formally explains the behavior you want.


I have the same issue when I want to describe complex applications with a lot of Async operations I need to add prefix or suffix to all the Async operation it is not critical but a little bit painful everytime.

At the end the graph look a messy


Not sure if my use case if the same as @RolandStuder’s and @jeremyfourna’s, but I’m encountering something similar, running into the limitation that ‘duplicate states’ are not allowed even if they are nested inside different parents.

In the example below I’d like to refer to Playing and Ended inside two different parent states:

Animation Player
  Animation 1
    button press -> Animation 2
      timer -> Ended
  Animation 2
    button press -> Animation 1
      timer -> Ended

I understand that currently in timer -> Ended it is not clear if Ended refers to Animation 1 : Ended or Animation 2 : Ended.

Could there perhaps be a heuristic that prioritizes ‘sibling transitions’ over ‘cousin transitions’? I mean the transition timer -> Ended would take effect inside the parent state Animation 1 or Animation 2 based on which of the two it originates from, transitioning
Animation 1 : Playing to Animation 1 : Ended
Animation 2 : Playing to Animation 2 : Ended