From 880dcc820f10f8f89a89a10d3721af5f5821aa1a Mon Sep 17 00:00:00 2001 From: markellekelly Date: Mon, 2 Dec 2019 15:47:49 -0800 Subject: [PATCH 1/2] Updated to avoid conflict with celltags core extension --- README.md | 2 +- environment.yml | 2 +- package.json | 6 +++--- src/components/tagstool.tsx | 5 ++++- src/index.tsx | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 889c086..20b6090 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The JupyterLab cell tags extension enables users to easily add, view, and manipu ## Install ```bash -jupyter labextension install @jupyterlab/celltags +jupyter labextension install @jupyterlab/celltags-ext ``` ## Development diff --git a/environment.yml b/environment.yml index 1b72a6c..267dbba 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ -name: jupyterlab-celltags +name: jupyterlab-celltags-ext channels: - conda-forge dependencies: diff --git a/package.json b/package.json index bffe7cb..bc0c312 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@jupyterlab/celltags", + "name": "@jupyterlab/celltags-ext", "version": "0.2.0", "description": "Extension for adding descriptive tags to notebook cells (Beta)", "keywords": [ @@ -34,8 +34,8 @@ "deduplicate": "jlpm yarn-deduplicate -s fewer", "lab:install": "jupyter labextension install .", "lab:link": "jupyter labextension install . --no-build", - "lab:uninstall": "jupyter labextension uninstall @jupyterlab/celltags", - "lab:unlink": "jupyter labextension uninstall @jupyterlab/celltags --no-build", + "lab:uninstall": "jupyter labextension uninstall @jupyterlab/celltags-ext", + "lab:unlink": "jupyter labextension uninstall @jupyterlab/celltags-ext --no-build", "precommit": "lint-staged", "prepublishOnly": "jlpm run clean && jlpm run build", "prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'", diff --git a/src/components/tagstool.tsx b/src/components/tagstool.tsx index 057345a..c902535 100644 --- a/src/components/tagstool.tsx +++ b/src/components/tagstool.tsx @@ -226,7 +226,10 @@ export class TagsTool extends NotebookTools.Tool { }); } - protected onMetadataChanged(msg: ObservableJSON.ChangeMessage): void { + protected onActiveCellMetadataChanged( + msg: ObservableJSON.ChangeMessage + ): void { + // only detects the entire 'tags' list being added/deleted, not changes to it if (!this.widget.tagsListShallNotRefresh) { this.widget.validateMetadataForActiveCell(); this.widget.loadTagsForActiveCell(); diff --git a/src/index.tsx b/src/index.tsx index d2655fe..9a2439d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -7,7 +7,7 @@ import { TagsTool } from './components'; import '../style/index.css'; /** - * Initialization data for the jupyterlab-celltags extension. + * Initialization data for the jupyterlab-celltags-ext extension. */ function activate( app: JupyterLab, @@ -19,7 +19,7 @@ function activate( } const extension: JupyterFrontEndPlugin = { - id: 'jupyterlab-celltags', + id: 'jupyterlab-celltags-ext', autoStart: true, requires: [INotebookTools, INotebookTracker], activate: activate From 3365e04a22ff7e9ea1c58e49f4d95302e7afc753 Mon Sep 17 00:00:00 2001 From: markellekelly Date: Mon, 2 Dec 2019 16:08:39 -0800 Subject: [PATCH 2/2] temp fix to avoid missing changes from core extension --- src/components/tagstool.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/tagstool.tsx b/src/components/tagstool.tsx index c902535..535bada 100644 --- a/src/components/tagstool.tsx +++ b/src/components/tagstool.tsx @@ -208,6 +208,7 @@ export class TagsTool extends NotebookTools.Tool { protected onActiveCellChanged(msg: Message): void { this.widget.currentActiveCell = this.notebookTools.activeCell; this.widget.loadTagsForActiveCell(); + this.widget.getAllTagsInNotebook(); } protected onAfterShow() {