Closed jaidetree closed 2 years ago
effect-handler properly enforces ordering (cleanup called before a new transition).
What should happen when activate-modal
is called when the modal is already up?
** Warning:statemachi: In send for action activate from state idle ; Hit prefix
** Warning:statemachi: Calling effect handler
** Warning: modal.fnl: Showing modal
** Warning:statemachi: In send for action activate from state active ; Hit prefix again, already active, this calls active->submenu. This probably isn't correct.
** Warning:statemachi: Calling cleanup
** Warning: modal.fnl: Closing modal
** Warning:statemachi: Calling effect handler
** Warning: modal.fnl: Showing modal
** Warning:statemachi: In send for action activate from state submenu ; Hit W
** Warning:statemachi: Calling cleanup
** Warning: modal.fnl: Closing modal
** Warning:statemachi: Calling effect handler
** Warning: modal.fnl: Showing modal
** Warning:statemachi: In send for action start-timeout from state submenu ; Called from bind-item when Space was hit ** Warning: modal.fnl: Timeout
** Warning:statemachi: Calling cleanup
** Warning: modal.fnl: Closing modal
** Warning:statemachi: Calling effect handler
** Warning: modal.fnl: Showing modal
** Warning:statemachi: In send for action deactivate from state submenu ; Timeout
** Warning:statemachi: Calling cleanup
** Warning: modal.fnl: Closing modal
** Warning:statemachi: Calling effect handler
So I think we have two problems:
activate
when the modal is up and state is active re-shows the modal but also transitions state to submenu when it shouldn't. It should probably recognize it's opening the top modal and return the old state and not fire an effect in that case.add-timeout-transition
is called when the submenu is opened. This seems to happen as part of the effect handler:show-modal-menu -> bind-menu-keys -> bind-item -> select-trigger -> create-action-trigger -> start-modal-timeout -> (send :start-timeout).
Notice that the window menu doesn't timeout until we get rid of the 'first' one. I have to think about the semantics here to get this working as expected.
I can repro this without going fast:
Is this the same issue, or should we file another ticket?
Was able to reproduce, seems related
@agzam discovered if you press the bindings to activate the modal too fast, it causes the modal to flicker and perform oddly.
Reproduction
cmd+space
oropt+space
multiple times as fast as possiblespace
to return to the main modalExpected
The main modal closes, the window modal opens
Actual
The main modal closes, opens (appears to flicker), then the window modal opens