MCPcopy
hub / github.com/wavetermdev/waveterm / validateMagnifiedNode

Method validateMagnifiedNode

frontend/layout/lib/layoutModel.ts:936–945  ·  view source on GitHub ↗

* When a layout is modified and only one leaf is remaining, we need to make sure it is no longer magnified. * @param leafOrder The new leaf order array to use when validating the number of leafs remaining. * @param addlProps The new additional properties object for all leafs in the layout.

(leafOrder: LeafOrderEntry[], addlProps: Record<string, LayoutNodeAdditionalProps>)

Source from the content-addressed store, hash-verified

934 * @param addlProps The new additional properties object for all leafs in the layout.
935 */
936 private validateMagnifiedNode(leafOrder: LeafOrderEntry[], addlProps: Record<string, LayoutNodeAdditionalProps>) {
937 if (leafOrder.length == 1) {
938 const lastLeafId = leafOrder[0].nodeid;
939 this.treeState.magnifiedNodeId = undefined;
940 this.magnifiedNodeId = undefined;
941
942 // Unset the transform for the sole leaf.
943 if (lastLeafId in addlProps) addlProps[lastLeafId].transform = undefined;
944 }
945 }
946
947 /**
948 * Helper function for the placeholderTransform atom, which computes the new transform value when the pending action changes.

Callers 1

updateTreeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected