approval flow loading text#1419
Conversation
There was a problem hiding this comment.
Anyone is of the opinion that endFlow should set the loading text back to null? It might be inconvenient in the event of an approval flow within another approval flow, but I think that's going to be a very rare occurrence.
On the other hand, not clearing it after a previous approval flow could cause some interesting bugs depending in which order approval flows happen.
An alternative to this would be to add a loadingText parameter when a flow starts and set it back to default if nothing is passed.
And even though the ticket explicitly says not to, another alternative would be for the loading text to be linked to an approval flow.
There was a problem hiding this comment.
I initially wanted to do it per flow but the issue is ownership. If a nested flow exists, is the parent flow loading text displayed as it was the initial flow and has more high level context, or is the child flow loading text shown as it's more specific and more aware of what is happening?
On reflection, perhaps there is a compromise where the loading text is per flow and so setFlowLoadingText has a flowId argument, and by default the nested flow text is displayed as it's most relevant to the current work, unless the parent flow wants to be stubborn and was started with an option such as overrideNestedLoadingText?
We could be extra thorough and also have a ignoreNestedLoadingText which simply ignores all nested text even when there is no parent text.
Clearing the text on endFlow would then make sense, but not having default loading text to start with as we can't really know that until the first approval is requested.
There was a problem hiding this comment.
So...
Without doing text by flowId, we can't just clear the text at endFlow, as that would inadvertently clear the parent loading text.
If we attach the flow to a specific flowId, then it won't matter. We can even come up with ways of inheriting the parent text if one is not provided.
Having said that, it's going to be difficult to predict what the functionality should exactly be if we don't have any use case for a nested approval flow.
Description
Adds a method to set loading text for the approval flow pages.
Changes
setFlowLoadingTextto the controllerReferences
Fixes https://github.com/MetaMask/MetaMask-planning/issues/567
Checklist