From f1a57a2c0c033f1db50dee5a17817eff92dac354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dcaro=20Guerra?= Date: Mon, 23 Dec 2024 12:17:04 -0300 Subject: [PATCH] fix(changes): observe component when attaching it to the site. When first creating a component via add/clone, we observe the tree in the same .change() to make the instances appear in the change summary as new instances. GitOrigin-RevId: ce6ca19beb73eb9323b869f508cf0b4613143787 --- platform/wab/src/wab/shared/TplMgr.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/wab/src/wab/shared/TplMgr.ts b/platform/wab/src/wab/shared/TplMgr.ts index 3b54ca596f7..da6a6dda1da 100644 --- a/platform/wab/src/wab/shared/TplMgr.ts +++ b/platform/wab/src/wab/shared/TplMgr.ts @@ -203,6 +203,7 @@ import { ScreenSizeSpec } from "@/wab/shared/css-size"; import { CONTENT_LAYOUT_INITIALS } from "@/wab/shared/default-styles"; import { DEVFLAGS } from "@/wab/shared/devflags"; import { Pt, Rect, findSpaceForRectSweepRight } from "@/wab/shared/geom"; +import { ensureComponentsObserved } from "@/wab/shared/mobx-util"; import { instUtil } from "@/wab/shared/model/InstUtil"; import { Arena, @@ -1406,6 +1407,8 @@ export class TplMgr { this.ensureDedicatedArena(comp, originalComp, originalComponentSite); } + ensureComponentsObserved([component]); + if (isContextCodeComponent(component)) { this.site().globalContexts.push( mkTplComponent(component, this.site().globalVariant)