Update Frame Children
update_frame_childrenReplace a frame's owned elements (shapes, notes, groups) by providing a list of element IDs. Optionally resize the frame to fit its new contents or leave its position unchanged.
Instructions
Replace a frame block's contents wholesale. Accepts ids of surface elements (shapes/connectors/groups) AND edgeless blocks (notes/frames/edgeless-text) — all go into BlockSuite's prop:childElementIds map, matching what the editor writes when you drag members into a frame. Dragging the frame drags every owned member. Ids that don't resolve come back under 'missing'. By default the frame is resized to fit its new contents (plus padding + title band); set resizeToFit=false to leave xywh untouched. Pass [] to clear ownership (resize is skipped in that case).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | No | Workspace ID (optional if default set) | |
| docId | Yes | Document ID | |
| blockId | Yes | Frame block id (flavour affine:frame). | |
| childElementIds | Yes | Full list of ids the frame should own/contain. Replaces any existing ownership. | |
| resizeToFit | No | If true (default), recompute xywh from the union of resolvable child bounds + padding + title band. Set to false to preserve the frame's current box (useful when you want ownership-only edits or manual positioning). | |
| padding | No | Padding (px) used when resizeToFit is true (default 40). Ignored when resizeToFit=false. |