Skip to content

Commit

Permalink
fix(changes): observe component when attaching it to the site.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
IcaroG authored and actions-user committed Dec 23, 2024
1 parent 8fef3c5 commit f1a57a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions platform/wab/src/wab/shared/TplMgr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f1a57a2

Please sign in to comment.