From b74a3648579940eef7eaa04efd38f1252e4ecea8 Mon Sep 17 00:00:00 2001 From: topkoa Date: Sun, 12 Jul 2026 19:06:04 -0400 Subject: [PATCH] docs(panes): re-attach the chip when the panel is rebuilt A plugin that rebuilds its panel (Camera Director does, on every mode change) takes the chip with it. attachChip() returns a detach(); call it before re-attaching, and again in teardown, or you leave a stub pointing at DOM that no longer exists. Found by CodeRabbit on #928. Signed-off-by: topkoa --- docs/plugin-panes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/plugin-panes.md b/docs/plugin-panes.md index 7a5ea4a..cd16c03 100644 --- a/docs/plugin-panes.md +++ b/docs/plugin-panes.md @@ -62,6 +62,18 @@ panel lazily on first use, or rebuild it wholesale when something changes (Camer Director rebuilds its panel on every mode change). Asking for it when we need it means we always move the live one. +**If you rebuild your panel, re-attach the chip.** Rebuilding takes the chip with +it. `attachChip()` returns a `detach()`; call it before re-attaching, and again in +your teardown — otherwise you leave a stub pointing at DOM that no longer exists. + +```js +if (chipDetach) chipDetach(); +chipDetach = panes.attachChip(panel, PANE_ID, { header: toolsEl }); +``` + +Re-attaching is safe while the pane is popped out: the chip reconciles against the +pane's real state, so a panel rebuilt mid-pop-out stays correctly stubbed. + ### The one thing core changes about your element `.fb-paned` is added while the pane is out, and it neutralises **placement only**: