@tutti-os/workbench-surface 0.0.183 → 0.0.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -717,8 +717,13 @@ function reduceWorkbenchState(state, action) {
717
717
  nodeStack: removeFromWorkbenchStack(state.nodeStack, action.nodeID),
718
718
  lockedLayout: pruneLockedLayout(state.lockedLayout, action.nodeID)
719
719
  };
720
- case "focusNode":
721
- if (!state.nodes.some((node) => node.id === action.nodeID)) {
720
+ case "focusNode": {
721
+ const targetNode = state.nodes.find((node) => node.id === action.nodeID);
722
+ if (!targetNode) {
723
+ return state;
724
+ }
725
+ const isAlreadyFocused = state.nodeStack[state.nodeStack.length - 1] === action.nodeID;
726
+ if (isAlreadyFocused && !targetNode.isMinimized) {
722
727
  return state;
723
728
  }
724
729
  return {
@@ -728,6 +733,7 @@ function reduceWorkbenchState(state, action) {
728
733
  ),
729
734
  nodeStack: focusWorkbenchStack(state.nodeStack, action.nodeID)
730
735
  };
736
+ }
731
737
  case "minimizeNode":
732
738
  return updateNode(
733
739
  state,