From 0f63da459442f9a5312ddf77cbf03df0ee50d246 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 05:56:22 +0000 Subject: [PATCH 01/11] Initial plan From de2c8e48015983601d1edaafd7b22bf1f384d5da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 06:08:12 +0000 Subject: [PATCH 02/11] Fix jsoneditor extension warning by auto-loading extension in ReactFlow.__init__ Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com> --- src/panel_reactflow/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/panel_reactflow/base.py b/src/panel_reactflow/base.py index a683be1..91e37af 100644 --- a/src/panel_reactflow/base.py +++ b/src/panel_reactflow/base.py @@ -1161,6 +1161,11 @@ class ReactFlow(ReactComponent): _stylesheets = [DIST_PATH / "panel-reactflow.bundle.css", DIST_PATH / "css" / "reactflow.css"] def __init__(self, **params: Any): + # Ensure jsoneditor extension is loaded since we use JSONEditor widgets + # in our default editors (JsonEditor and SchemaEditor fallback) + from panel.config import panel_extension as extension + extension('jsoneditor') + self._node_ids: list[str] = [] self._edge_ids: list[str] = [] # Normalize type specs before parent init so the frontend receives From 2f5d9284a297735ee1c198c020160fe69d9c98dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 06:10:07 +0000 Subject: [PATCH 03/11] Optimize extension loading to check if already loaded Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com> --- src/panel_reactflow/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panel_reactflow/base.py b/src/panel_reactflow/base.py index 91e37af..da4dd83 100644 --- a/src/panel_reactflow/base.py +++ b/src/panel_reactflow/base.py @@ -1164,7 +1164,10 @@ def __init__(self, **params: Any): # Ensure jsoneditor extension is loaded since we use JSONEditor widgets # in our default editors (JsonEditor and SchemaEditor fallback) from panel.config import panel_extension as extension - extension('jsoneditor') + from panel.io.state import state + # Only load if not already loaded (state._extensions is None before pn.extension() is called) + if state._extensions is None or 'jsoneditor' not in state._extensions: + extension('jsoneditor') self._node_ids: list[str] = [] self._edge_ids: list[str] = [] From 62cfa1b39f4a8b36a3691eda403835d9d1dac6e9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 06:11:55 +0000 Subject: [PATCH 04/11] Simplify extension loading - rely on panel_extension idempotency Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com> --- src/panel_reactflow/base.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/panel_reactflow/base.py b/src/panel_reactflow/base.py index da4dd83..2390e65 100644 --- a/src/panel_reactflow/base.py +++ b/src/panel_reactflow/base.py @@ -1162,13 +1162,11 @@ class ReactFlow(ReactComponent): def __init__(self, **params: Any): # Ensure jsoneditor extension is loaded since we use JSONEditor widgets - # in our default editors (JsonEditor and SchemaEditor fallback) + # in our default editors (JsonEditor and SchemaEditor fallback). + # panel_extension() is idempotent so this is safe to call multiple times. from panel.config import panel_extension as extension - from panel.io.state import state - # Only load if not already loaded (state._extensions is None before pn.extension() is called) - if state._extensions is None or 'jsoneditor' not in state._extensions: - extension('jsoneditor') - + extension('jsoneditor') + self._node_ids: list[str] = [] self._edge_ids: list[str] = [] # Normalize type specs before parent init so the frontend receives From 912430a6716aeafdf15f2202cf57367d2af18938 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 06:12:39 +0000 Subject: [PATCH 05/11] Improve code readability - use full panel_extension name Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com> --- src/panel_reactflow/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panel_reactflow/base.py b/src/panel_reactflow/base.py index 2390e65..3c006e1 100644 --- a/src/panel_reactflow/base.py +++ b/src/panel_reactflow/base.py @@ -1164,8 +1164,8 @@ def __init__(self, **params: Any): # Ensure jsoneditor extension is loaded since we use JSONEditor widgets # in our default editors (JsonEditor and SchemaEditor fallback). # panel_extension() is idempotent so this is safe to call multiple times. - from panel.config import panel_extension as extension - extension('jsoneditor') + from panel.config import panel_extension + panel_extension('jsoneditor') self._node_ids: list[str] = [] self._edge_ids: list[str] = [] From d86ae04e56b17ea987283c9e07dc367118599f95 Mon Sep 17 00:00:00 2001 From: MarcSkovMadsen Date: Mon, 9 Feb 2026 09:26:51 +0000 Subject: [PATCH 06/11] review feedback --- src/panel_reactflow/base.py | 6 ------ src/panel_reactflow/schema.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/panel_reactflow/base.py b/src/panel_reactflow/base.py index 3c006e1..a683be1 100644 --- a/src/panel_reactflow/base.py +++ b/src/panel_reactflow/base.py @@ -1161,12 +1161,6 @@ class ReactFlow(ReactComponent): _stylesheets = [DIST_PATH / "panel-reactflow.bundle.css", DIST_PATH / "css" / "reactflow.css"] def __init__(self, **params: Any): - # Ensure jsoneditor extension is loaded since we use JSONEditor widgets - # in our default editors (JsonEditor and SchemaEditor fallback). - # panel_extension() is idempotent so this is safe to call multiple times. - from panel.config import panel_extension - panel_extension('jsoneditor') - self._node_ids: list[str] = [] self._edge_ids: list[str] = [] # Normalize type specs before parent init so the frontend receives diff --git a/src/panel_reactflow/schema.py b/src/panel_reactflow/schema.py index ae0c2aa..3822e40 100644 --- a/src/panel_reactflow/schema.py +++ b/src/panel_reactflow/schema.py @@ -1,7 +1,7 @@ import pandas as pd import panel as pn import param # type: ignore -from panel.layout.base import Panel +from panel.layout.base import ListLike, Panel from panel.pane.base import PaneBase from panel.widgets.base import WidgetBase from panel_material_ui import ( @@ -25,9 +25,15 @@ class JSONSchema(PaneBase): + # The default Paper component from + # panel_material_ui inherits from ReactComponent/ListLike, not from + # panel.layout.base.Panel. default_layout = param.ClassSelector( default=Paper, - class_=(Panel,), + class_=( + Panel, + ListLike, + ), is_instance=False, doc=""" Defines the layout the model(s) returned by the pane will From eec295db30f9b820a78a446b6d2c1d639734160e Mon Sep 17 00:00:00 2001 From: Marc Skov Madsen Date: Mon, 9 Feb 2026 10:31:40 +0100 Subject: [PATCH 07/11] Update schema.py --- src/panel_reactflow/schema.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/panel_reactflow/schema.py b/src/panel_reactflow/schema.py index 3822e40..1bbb6a2 100644 --- a/src/panel_reactflow/schema.py +++ b/src/panel_reactflow/schema.py @@ -25,9 +25,6 @@ class JSONSchema(PaneBase): - # The default Paper component from - # panel_material_ui inherits from ReactComponent/ListLike, not from - # panel.layout.base.Panel. default_layout = param.ClassSelector( default=Paper, class_=( From 4a380896d92cadce20804882f08f72032e059e98 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 09:39:13 +0000 Subject: [PATCH 08/11] Document jsoneditor extension requirement in quickstart and examples Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com> --- README.md | 2 +- docs/index.md | 6 +++++- docs/quickstart.md | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ffb95c0..24f929d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ import panel as pn from panel_reactflow import ReactFlow -pn.extension() +pn.extension("jsoneditor") nodes = [ { diff --git a/docs/index.md b/docs/index.md index a199a9a..7d6c6b3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,11 +22,15 @@ generate forms, and plug in editors where you need full control. ## Quickstart +!!! tip "JSONEditor Extension Required" + ReactFlow requires the `jsoneditor` Panel extension for editing node and edge data. + Always call `pn.extension("jsoneditor")` at the start of your application. + ```python import panel as pn from panel_reactflow import NodeType, ReactFlow -pn.extension() +pn.extension("jsoneditor") task_schema = { "type": "object", diff --git a/docs/quickstart.md b/docs/quickstart.md index 3422b2f..cf1198e 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -14,6 +14,12 @@ pip install panel-reactflow ## Minimal app +!!! note "Required Extension" + ReactFlow uses Panel's JSONEditor widget for editing node and edge data. + You must call `pn.extension("jsoneditor")` before creating ReactFlow instances + to ensure the extension loads correctly. This should be done early in your + application, typically right after your imports. + ```python import panel as pn From 73f2bf19dc4c71257db8a6185251dc0ad95dbeec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 09:45:07 +0000 Subject: [PATCH 09/11] Fix UI tests to load jsoneditor extension Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com> --- tests/ui/test_ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui/test_ui.py b/tests/ui/test_ui.py index 8e9414e..ea8a631 100644 --- a/tests/ui/test_ui.py +++ b/tests/ui/test_ui.py @@ -10,7 +10,7 @@ from playwright.sync_api import expect -pn.extension() +pn.extension("jsoneditor") pytestmark = pytest.mark.ui From 09e4913481af6010165a59ccfc29697e70d8cac7 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Wed, 11 Feb 2026 10:04:15 +0000 Subject: [PATCH 10/11] Remove extension load in docs --- tests/ui/test_ui.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/ui/test_ui.py b/tests/ui/test_ui.py index ea8a631..b28b868 100644 --- a/tests/ui/test_ui.py +++ b/tests/ui/test_ui.py @@ -10,8 +10,6 @@ from playwright.sync_api import expect -pn.extension("jsoneditor") - pytestmark = pytest.mark.ui From 9ff015760ef786882ae7b12350f3a7f83f1e473c Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Wed, 11 Feb 2026 10:10:30 +0000 Subject: [PATCH 11/11] Load JSONEditor model --- tests/ui/test_ui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ui/test_ui.py b/tests/ui/test_ui.py index b28b868..4f8a636 100644 --- a/tests/ui/test_ui.py +++ b/tests/ui/test_ui.py @@ -1,6 +1,7 @@ """UI tests for ReactFlow using Playwright.""" import panel as pn +import panel.models.jsoneditor # noqa import pytest from panel.tests.util import serve_component, wait_until