Skip to content

Rework subgraphStack slice to merge it into displayedWorkflowInfo slice

Loic Huder requested to merge subgraph-store into main

As far as my understanding goes, subgraphStack is an array storing the id and labels of the ancestors of the displayed workflow, plus the ones of the displayed workflow in last position. Its only purpose is to be able to build the interactive breadcrumbs (formely SubgraphStack the component).

This means that subgraphStack only needs to change when the displayed workflow changes, in the following scenarios:

  • We go one layer down in the hierarchy (double-click on a subgraph) so the new subgraph is added at the end of subgraphStack
  • We go one (or several) layer up in the hierarchy (click on a parent crumb) so the subgraphStack must be emptied up to the new displayed workflow.
  • We open a completely different workflow: the subgraphStack must be reset to a single member: the new displayed workflow.

Drawing on this postulate, I merged subgraphStack in the displayedWorkflowInfo slice (renamed displayedWorkflowHierarchy). This hierarchy is now updated each time the displayedWorkflowInfo changes, according to the aforementioned scenarios. Also, since the label can be recovered from loadedGraphs, displayedWorkflowHierarchy now only stores workflow ids.

Edited by Loic Huder

Merge request reports