hunk.code_window:       .${Classes.OVERLAY_BACKDROP} {
           z-index: ${(props) => props.zIndex || 2 - 1};
         }
         position: fixed;
         top: 0;
         right: 0;
         bottom: 0;
  
hunk.labels: keep keep keep keep replace keep keep
hunk.after_edit:       top: var(--view-mode-header-height, 0);
  
hunk.file_path: app/client/src/widgets/ModalWidget/component/index.tsx
hunk.type: replace
file: import {
    CanvasStructure,
    DSL,
  } from "reducers/uiReducers/pageCanvasStructureReducer";
  
  export const compareAndGenerateImmutableCanvasStructure = (
    original: CanvasStructure,
    current: DSL,
  ) => {
    const newStructure = getCanvasStructureFromDSL(current);
    if (JSON.stringify(newStructure) === JSON.stringify(original)) {
      return original;
    }
    return newStructure;
  };
  
  const getCanvasStructureFromDSL = (dsl: DSL): CanvasStructure => {
    let children = dsl.children;
    let structureChildren: CanvasStructure[] | undefined = undefined;
    // Todo(abhinav): abstraction leak
    if (dsl.type === "TABS_WIDGET") {
      if (children && children.length > 0) {
        structureChildren = children.map((childTab) => ({
          widgetName: childTab.tabName,
          widgetId: childTab.widgetId,
          type: "TABS_WIDGET",
          children: childTab.children,
        }));
      }
    } else if (children && children.length === 1) {
      if (children[0].type === "CANVAS_WIDGET") {
        children = children[0].children;
      }
    }
  
    return {
      widgetId: dsl.widgetId,
      widgetName: dsl.widgetName,
      type: dsl.type,
      children:
        structureChildren ||
        children?.filter(Boolean).map(getCanvasStructureFromDSL),
    };
  };
  