There are currently 4 context shape types in Lens and relative flows:
No context for regular flows (new Lens viz, new Lens viz from dashboard, opening existing Lens viz, etc..)
this is the regular flow where state is extracted from a document, if it exists, or created an empty state
Discover to Lens context
this is a custom flow from where from a Discover field it is possible to leverage the Lens suggestion system to produce a new Lens state
Agg-based/TSVB "open in Lens" context (ad hoc state shape => Lens state)
this is a tricky one as we already know what the final state should be, but it passes thru the suggestion system as 2. but some special flags to force chart types and other choices.
Lens (locator) to Lens context (share plugin)
this is very similar to 1. when a document exists but it has still some special branching
My idea would be to refactor part of these different context types into 3 context shapes:
no context as 1.
field-based context type as 2.
Lens state context type as 4.
Basically 3. and 4. from the previous list should be merged together into a unique shape, most probably the Lens state shape.
It would also be great to unify the bootstrapping flow of 1. with existing document with the new Lens state shape of the 3. and 4. case in order to reduce the amount of code.
There are currently 4 context shape types in Lens and relative flows:
My idea would be to refactor part of these different context types into 3 context shapes:
Basically 3. and 4. from the previous list should be merged together into a unique shape, most probably the Lens state shape. It would also be great to unify the bootstrapping flow of 1. with existing document with the new Lens state shape of the 3. and 4. case in order to reduce the amount of code.