From 7b1e3b35955ab335dc33af2c27528a00936b03e4 Mon Sep 17 00:00:00 2001 From: zhuweileo Date: Wed, 9 Apr 2025 14:50:46 +0800 Subject: [PATCH] fix: customizable cell sidebar doesn't work. --- .../notebook/cell/sidebar/CellSidebarExtension.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/react/src/components/notebook/cell/sidebar/CellSidebarExtension.tsx b/packages/react/src/components/notebook/cell/sidebar/CellSidebarExtension.tsx index e11e7a10..66e7b5bb 100644 --- a/packages/react/src/components/notebook/cell/sidebar/CellSidebarExtension.tsx +++ b/packages/react/src/components/notebook/cell/sidebar/CellSidebarExtension.tsx @@ -32,7 +32,8 @@ class CellSidebarFactory implements IDisposable { protected panel: NotebookPanel, protected commands: CommandRegistry, protected nbgrader: boolean = false, - protected sidebarWidth: number = 120 + protected sidebarWidth: number = 120, + protected factory: React.JSXElementConstructor = CellSidebar ) { this._onModelChanged(panel.content); panel.content.modelChanged.connect(this._onModelChanged, this); @@ -59,9 +60,10 @@ class CellSidebarFactory implements IDisposable { private _addSidebar(model: ICellModel): void { const cell = this._getCell(model); if (cell) { + const Element = this.factory; const sidebar = ReactWidget.create( -