[bug] Nested instance replaced inside an instance is reset when the main is edited; swap_instance refuses nested instances #11

Closed
opened 2026-10-25 00:24:28 +00:00 by masi · 0 comments
Owner

Expected: A nested instance swapped or replaced inside an instance (e.g. a badge inside a row component) keeps that override when the row's main component is edited later.
Actual: swap_instance on the nested badge fails with "not a component instance root". write_html mode replace on that nested badge works at first. But any later update_styles on the row main (for example gap) re-syncs the instance, and the nested badge goes back to the main's badge. <x-paper-clone> of a frame holding such rows also drops the replacement.
Repro: 1) Make main Row holding an instance of Badge / Green with Label "OK". 2) Place an instance of Row. 3) write_html {mode:"replace", targetNodeId:<nested badge>, html:'<x-paper-instance component="Badge / Amber" overrides=\'{"Label":"Late"}\'/>'}. 4) update_styles on the Row main {gap:"0px"}. 5) The instance shows Badge / Green "OK" again.
Workaround: Take the badge out of the row component and place it next to the row instance inside a wrapper frame.
Impact: Status overrides inside list rows are lost silently, with no warning.


Filed from PaperCraft 0.7.2 (macos).

**Expected:** A nested instance swapped or replaced inside an instance (e.g. a badge inside a row component) keeps that override when the row's main component is edited later. **Actual:** `swap_instance` on the nested badge fails with "not a component instance root". `write_html` mode `replace` on that nested badge works at first. But any later `update_styles` on the row main (for example `gap`) re-syncs the instance, and the nested badge goes back to the main's badge. `<x-paper-clone>` of a frame holding such rows also drops the replacement. **Repro:** 1) Make main `Row` holding an instance of `Badge / Green` with Label "OK". 2) Place an instance of `Row`. 3) `write_html {mode:"replace", targetNodeId:<nested badge>, html:'<x-paper-instance component="Badge / Amber" overrides=\'{"Label":"Late"}\'/>'}`. 4) `update_styles` on the `Row` main `{gap:"0px"}`. 5) The instance shows `Badge / Green` "OK" again. **Workaround:** Take the badge out of the row component and place it next to the row instance inside a wrapper frame. **Impact:** Status overrides inside list rows are lost silently, with no warning. --- Filed from PaperCraft 0.7.2 (macos).
masi closed this issue 2026-10-25 00:45:06 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: masi/papercraft#11