jupyterlab-refresh-view-extension 0.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. jupyterlab_refresh_view_extension-0.6.3/.claude/JOURNAL.md +11 -0
  2. jupyterlab_refresh_view_extension-0.6.3/.claude/settings.local.json +17 -0
  3. jupyterlab_refresh_view_extension-0.6.3/.copier-answers.yml +15 -0
  4. jupyterlab_refresh_view_extension-0.6.3/.gitignore +125 -0
  5. jupyterlab_refresh_view_extension-0.6.3/.prettierignore +6 -0
  6. jupyterlab_refresh_view_extension-0.6.3/.yarnrc.yml +1 -0
  7. jupyterlab_refresh_view_extension-0.6.3/CHANGELOG.md +5 -0
  8. jupyterlab_refresh_view_extension-0.6.3/LICENSE +29 -0
  9. jupyterlab_refresh_view_extension-0.6.3/Makefile +92 -0
  10. jupyterlab_refresh_view_extension-0.6.3/PKG-INFO +181 -0
  11. jupyterlab_refresh_view_extension-0.6.3/README.md +126 -0
  12. jupyterlab_refresh_view_extension-0.6.3/RELEASE.md +80 -0
  13. jupyterlab_refresh_view_extension-0.6.3/babel.config.js +1 -0
  14. jupyterlab_refresh_view_extension-0.6.3/install.json +5 -0
  15. jupyterlab_refresh_view_extension-0.6.3/jest.config.js +28 -0
  16. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/__init__.py +16 -0
  17. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/_version.py +4 -0
  18. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/labextension/package.json +205 -0
  19. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/labextension/static/509.7740681a1f5e2c107832.js +1 -0
  20. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/labextension/static/728.130fe2a94ea19093a146.js +1 -0
  21. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/labextension/static/remoteEntry.8c8bc3f821b0770499ea.js +1 -0
  22. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/labextension/static/style.js +4 -0
  23. jupyterlab_refresh_view_extension-0.6.3/jupyterlab_refresh_view_extension/labextension/static/third-party-licenses.json +16 -0
  24. jupyterlab_refresh_view_extension-0.6.3/package-lock.json +13865 -0
  25. jupyterlab_refresh_view_extension-0.6.3/package.json +200 -0
  26. jupyterlab_refresh_view_extension-0.6.3/pyproject.toml +77 -0
  27. jupyterlab_refresh_view_extension-0.6.3/setup.py +1 -0
  28. jupyterlab_refresh_view_extension-0.6.3/src/__tests__/jupyterlab_refresh_view_extension.spec.ts +9 -0
  29. jupyterlab_refresh_view_extension-0.6.3/src/index.ts +121 -0
  30. jupyterlab_refresh_view_extension-0.6.3/style/base.css +5 -0
  31. jupyterlab_refresh_view_extension-0.6.3/style/index.css +1 -0
  32. jupyterlab_refresh_view_extension-0.6.3/style/index.js +1 -0
  33. jupyterlab_refresh_view_extension-0.6.3/tsconfig.json +25 -0
  34. jupyterlab_refresh_view_extension-0.6.3/tsconfig.test.json +3 -0
  35. jupyterlab_refresh_view_extension-0.6.3/ui-tests/README.md +167 -0
  36. jupyterlab_refresh_view_extension-0.6.3/ui-tests/jupyter_server_test_config.py +12 -0
  37. jupyterlab_refresh_view_extension-0.6.3/ui-tests/package.json +15 -0
  38. jupyterlab_refresh_view_extension-0.6.3/ui-tests/playwright.config.js +14 -0
  39. jupyterlab_refresh_view_extension-0.6.3/ui-tests/tests/jupyterlab_refresh_view_extension.spec.ts +21 -0
  40. jupyterlab_refresh_view_extension-0.6.3/ui-tests/yarn.lock +0 -0
  41. jupyterlab_refresh_view_extension-0.6.3/yarn.lock +9787 -0
@@ -0,0 +1,11 @@
1
+ # JupyterLab Refresh View Extension - Journal
2
+
3
+ This journal tracks substantive work on the JupyterLab Refresh View Extension.
4
+
5
+ ---
6
+
7
+ 1. **Task - JupyterLab Refresh View Extension**: Implemented context menu refresh functionality for JupyterLab markdown and notebook files<br>
8
+ **Result**: Created jupyterlab_refresh_view_extension from scratch using JupyterLab extension template (Copier v4.4.0). Implemented "Refresh View" command executing context.revert() to reload file content from disk with intelligent scroll position preservation (captures scroll state from .jp-RenderedMarkdown, .jp-Notebook, .jp-OutputArea-output elements, restores positions after 150ms rendering delay). Registered command with IDocumentManager (required), ICommandPalette and IFileBrowserFactory (optional dependencies). Added context menu integration using .jp-Document selector to cover all document types without duplication. Resolved TypeScript compilation errors (removed unused MarkdownDocument and NotebookPanel imports). Fixed duplicate menu item issue by consolidating 4 overlapping selectors (.jp-MarkdownViewer, .jp-RenderedMarkdown, .jp-NotebookPanel, .jp-FileEditor) into single parent selector (.jp-Document). Added dependencies to package.json: @jupyterlab/apputils, @jupyterlab/docmanager, @jupyterlab/docregistry, @jupyterlab/filebrowser, @jupyterlab/markdownviewer, @jupyterlab/notebook (all ^4.0.0). Used Makefile build system throughout: make install target handles version increment (0.1.0 -> 0.1.4), dependency installation (npm/yarn), TypeScript compilation, Python package build (hatch), and pip installation. Extension successfully installed and verified via jupyter labextension list showing jupyterlab_refresh_view_extension v0.1.4 enabled OK. Context menu "Refresh View" item appears once when right-clicking markdown/notebook content, enables only when document context exists, preserves scroll position during refresh, and integrates with command palette under "File Operations" category. Build infrastructure: TypeScript (strict mode), Jest unit tests, Playwright integration tests, ESLint/Prettier/Stylelint, GitHub Actions CI/CD workflows (build, test, release). Extension provides in-place file refresh without scrolling to top - critical for iterative document editing workflows.
9
+
10
+ 2. **Task - Package Metadata and Documentation**: Updated package metadata and comprehensive documentation for publishing<br>
11
+ **Result**: Updated version from 0.1.4 to 0.6.2 in package.json. Added GitHub repository URLs: homepage (https://github.com/the-cog-conf/jupyterlab_refresh_view_extension), bugs tracker (/issues), and repository git URL. Improved package description from generic text to feature-focused: "JupyterLab extension adding context menu 'Refresh View' command to reload file content from disk while preserving scroll position". Enhanced README.md with professional structure: added GitHub Actions, npm, and PyPI badges with working links; created Features section highlighting context menu integration, scroll preservation, command palette access, and smart enable/disable; added Use Cases section covering iterative editing, live documentation, collaborative work, and build system integration; expanded Installation section with both PyPI and npm methods; added detailed Usage section with step-by-step instructions and command palette alternative. Created local project journal at .claude/JOURNAL.md documenting complete implementation history. Committed changes with conventional commit message and pushed to GitHub (commit 14fe948). Package now ready for publishing to npm and PyPI with complete metadata and user-facing documentation.
@@ -0,0 +1,17 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(make install:*)",
5
+ "Bash(tee:*)",
6
+ "Bash(jupyter labextension list:*)",
7
+ "Read(//tmp/**)",
8
+ "Read(//home/lab/workspace/.claude/**)",
9
+ "Bash(git add:*)",
10
+ "Bash(git commit:*)",
11
+ "Bash(git push:*)",
12
+ "Bash(make publish:*)"
13
+ ],
14
+ "deny": [],
15
+ "ask": []
16
+ }
17
+ }
@@ -0,0 +1,15 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: v4.4.0
3
+ _src_path: https://github.com/jupyterlab/extension-template
4
+ author_email: konrad.jelen@gmail.com
5
+ author_name: Stellars Henson
6
+ has_binder: false
7
+ has_settings: false
8
+ kind: frontend
9
+ labextension_name: jupyterlab_refresh_view_extension
10
+ project_short_description: A JupyterLab to allow context menu option to refresh markdown
11
+ or notebook
12
+ python_name: jupyterlab_refresh_view_extension
13
+ repository: ''
14
+ test: true
15
+
@@ -0,0 +1,125 @@
1
+ *.bundle.*
2
+ lib/
3
+ node_modules/
4
+ *.log
5
+ .eslintcache
6
+ .stylelintcache
7
+ *.egg-info/
8
+ .ipynb_checkpoints
9
+ *.tsbuildinfo
10
+ jupyterlab_refresh_view_extension/labextension
11
+ # Version file is handled by hatchling
12
+ jupyterlab_refresh_view_extension/_version.py
13
+
14
+ # Integration tests
15
+ ui-tests/test-results/
16
+ ui-tests/playwright-report/
17
+
18
+ # Created by https://www.gitignore.io/api/python
19
+ # Edit at https://www.gitignore.io/?templates=python
20
+
21
+ ### Python ###
22
+ # Byte-compiled / optimized / DLL files
23
+ __pycache__/
24
+ *.py[cod]
25
+ *$py.class
26
+
27
+ # C extensions
28
+ *.so
29
+
30
+ # Distribution / packaging
31
+ .Python
32
+ build/
33
+ develop-eggs/
34
+ dist/
35
+ downloads/
36
+ eggs/
37
+ .eggs/
38
+ lib/
39
+ lib64/
40
+ parts/
41
+ sdist/
42
+ var/
43
+ wheels/
44
+ pip-wheel-metadata/
45
+ share/python-wheels/
46
+ .installed.cfg
47
+ *.egg
48
+ MANIFEST
49
+
50
+ # PyInstaller
51
+ # Usually these files are written by a python script from a template
52
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
53
+ *.manifest
54
+ *.spec
55
+
56
+ # Installer logs
57
+ pip-log.txt
58
+ pip-delete-this-directory.txt
59
+
60
+ # Unit test / coverage reports
61
+ htmlcov/
62
+ .tox/
63
+ .nox/
64
+ .coverage
65
+ .coverage.*
66
+ .cache
67
+ nosetests.xml
68
+ coverage/
69
+ coverage.xml
70
+ *.cover
71
+ .hypothesis/
72
+ .pytest_cache/
73
+
74
+ # Translations
75
+ *.mo
76
+ *.pot
77
+
78
+ # Scrapy stuff:
79
+ .scrapy
80
+
81
+ # Sphinx documentation
82
+ docs/_build/
83
+
84
+ # PyBuilder
85
+ target/
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # celery beat schedule file
91
+ celerybeat-schedule
92
+
93
+ # SageMath parsed files
94
+ *.sage.py
95
+
96
+ # Spyder project settings
97
+ .spyderproject
98
+ .spyproject
99
+
100
+ # Rope project settings
101
+ .ropeproject
102
+
103
+ # Mr Developer
104
+ .mr.developer.cfg
105
+ .project
106
+ .pydevproject
107
+
108
+ # mkdocs documentation
109
+ /site
110
+
111
+ # mypy
112
+ .mypy_cache/
113
+ .dmypy.json
114
+ dmypy.json
115
+
116
+ # Pyre type checker
117
+ .pyre/
118
+
119
+ # End of https://www.gitignore.io/api/python
120
+
121
+ # OSX files
122
+ .DS_Store
123
+
124
+ # Yarn cache
125
+ .yarn/
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ **/node_modules
3
+ **/lib
4
+ **/package.json
5
+ !/package.json
6
+ jupyterlab_refresh_view_extension
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ <!-- <START NEW CHANGELOG ENTRY> -->
4
+
5
+ <!-- <END NEW CHANGELOG ENTRY> -->
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Stellars Henson
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,92 @@
1
+ .PHONY: build install clean uninstall publish dependencies mrproper increment_version install_dependencies help
2
+ .DEFAULT_GOAL := help
3
+
4
+ # Read current version from package.json (only if node is available)
5
+ VERSION := $(shell command -v node >/dev/null 2>&1 && node -p "require('./package.json').version" || echo "0.0.0")
6
+
7
+ ## increment project version
8
+ increment_version:
9
+ @echo "Current version: $(VERSION)"
10
+ @bash -c 'CURRENT_VERSION=$(VERSION); \
11
+ IFS="." read -r major minor patch <<< "$$CURRENT_VERSION"; \
12
+ NEW_PATCH=$$((patch + 1)); \
13
+ NEW_VERSION="$$major.$$minor.$$NEW_PATCH"; \
14
+ echo "New version: $$NEW_VERSION"; \
15
+ sed -i "s/\"version\": \"$$CURRENT_VERSION\"/\"version\": \"$$NEW_VERSION\"/" package.json; '
16
+
17
+ ## build packages
18
+ build: clean increment_version
19
+ npm install
20
+ yarn install
21
+ python -m build
22
+
23
+ ## install package
24
+ install: build
25
+ pip install dist/*.whl --force-reinstall
26
+
27
+ ## clean builds and installables
28
+ clean: uninstall
29
+ @command -v npm >/dev/null 2>&1 && npm run clean || true
30
+ @command -v npm >/dev/null 2>&1 && npm run clean:labextension || true
31
+ rm -rf dist lib || true
32
+
33
+ ## uninstall package
34
+ uninstall:
35
+ pip uninstall -y dist/*.whl 2>/dev/null || true
36
+
37
+ ## publish package to public repository
38
+ publish: install
39
+ twine upload dist/*
40
+
41
+ ## install all required build dependencies
42
+ install_dependencies:
43
+ conda install -y nodejs yarn --update-all
44
+ pip install twine
45
+
46
+ ## cleanup all build and metabuild artefacts
47
+ mrproper: clean uninstall
48
+ rm -rf node_modules .yarn || true
49
+
50
+ ## prints the list of available commands
51
+ help:
52
+ @echo ""
53
+ @echo "$$(tput bold)Available rules:$$(tput sgr0)"
54
+ @sed -n -e "/^## / { \
55
+ h; \
56
+ s/.*//; \
57
+ :doc" \
58
+ -e "H; \
59
+ n; \
60
+ s/^## //; \
61
+ t doc" \
62
+ -e "s/:.*//; \
63
+ G; \
64
+ s/\\n## /---/; \
65
+ s/\\n/ /g; \
66
+ p; \
67
+ }" ${MAKEFILE_LIST} \
68
+ | LC_ALL='C' sort --ignore-case \
69
+ | awk -F '---' \
70
+ -v ncol=$$(tput cols) \
71
+ -v indent=19 \
72
+ -v col_on="$$(tput setaf 6)" \
73
+ -v col_off="$$(tput sgr0)" \
74
+ '{ \
75
+ printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
76
+ n = split($$2, words, " "); \
77
+ line_length = ncol - indent; \
78
+ for (i = 1; i <= n; i++) { \
79
+ line_length -= length(words[i]) + 1; \
80
+ if (line_length <= 0) { \
81
+ line_length = ncol - indent - length(words[i]) - 1; \
82
+ printf "\n%*s ", -indent, " "; \
83
+ } \
84
+ printf "%s ", words[i]; \
85
+ } \
86
+ printf "\n"; \
87
+ }'
88
+ @echo ""
89
+
90
+
91
+ # EOF
92
+
@@ -0,0 +1,181 @@
1
+ Metadata-Version: 2.4
2
+ Name: jupyterlab_refresh_view_extension
3
+ Version: 0.6.3
4
+ Summary: JupyterLab extension adding context menu 'Refresh View' command to reload file content from disk while preserving scroll position
5
+ Project-URL: Homepage, https://github.com/the-cog-conf/jupyterlab_refresh_view_extension
6
+ Project-URL: Bug Tracker, https://github.com/the-cog-conf/jupyterlab_refresh_view_extension/issues
7
+ Project-URL: Repository, https://github.com/the-cog-conf/jupyterlab_refresh_view_extension.git
8
+ Author-email: Stellars Henson <konrad.jelen@gmail.com>
9
+ License: BSD 3-Clause License
10
+
11
+ Copyright (c) 2025, Stellars Henson
12
+ All rights reserved.
13
+
14
+ Redistribution and use in source and binary forms, with or without
15
+ modification, are permitted provided that the following conditions are met:
16
+
17
+ 1. Redistributions of source code must retain the above copyright notice, this
18
+ list of conditions and the following disclaimer.
19
+
20
+ 2. Redistributions in binary form must reproduce the above copyright notice,
21
+ this list of conditions and the following disclaimer in the documentation
22
+ and/or other materials provided with the distribution.
23
+
24
+ 3. Neither the name of the copyright holder nor the names of its
25
+ contributors may be used to endorse or promote products derived from
26
+ this software without specific prior written permission.
27
+
28
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
32
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
34
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ License-File: LICENSE
39
+ Keywords: jupyter,jupyterlab,jupyterlab-extension
40
+ Classifier: Framework :: Jupyter
41
+ Classifier: Framework :: Jupyter :: JupyterLab
42
+ Classifier: Framework :: Jupyter :: JupyterLab :: 4
43
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
44
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
45
+ Classifier: License :: OSI Approved :: BSD License
46
+ Classifier: Programming Language :: Python
47
+ Classifier: Programming Language :: Python :: 3
48
+ Classifier: Programming Language :: Python :: 3.9
49
+ Classifier: Programming Language :: Python :: 3.10
50
+ Classifier: Programming Language :: Python :: 3.11
51
+ Classifier: Programming Language :: Python :: 3.12
52
+ Classifier: Programming Language :: Python :: 3.13
53
+ Requires-Python: >=3.9
54
+ Description-Content-Type: text/markdown
55
+
56
+ # JupyterLab Refresh View Extension
57
+
58
+ [![Github Actions Status](https://github.com/the-cog-conf/jupyterlab_refresh_view_extension/workflows/Build/badge.svg)](https://github.com/the-cog-conf/jupyterlab_refresh_view_extension/actions/workflows/build.yml)
59
+ [![npm version](https://badge.fury.io/js/jupyterlab_refresh_view_extension.svg)](https://www.npmjs.com/package/jupyterlab_refresh_view_extension)
60
+ [![PyPI version](https://badge.fury.io/py/jupyterlab-refresh-view-extension.svg)](https://pypi.org/project/jupyterlab-refresh-view-extension/)
61
+
62
+ JupyterLab extension that adds a **"Refresh View"** context menu command to reload file content from disk while preserving scroll position.
63
+
64
+ ## Features
65
+
66
+ - **Context Menu Integration** - Right-click on markdown files, notebooks, or text editors to access the refresh command
67
+ - **Scroll Position Preservation** - Automatically maintains your current scroll position after refreshing content
68
+ - **Command Palette Access** - Available via command palette under "File Operations" category
69
+ - **Smart Enable/Disable** - Only enabled when a document with context is active
70
+
71
+ ## Use Cases
72
+
73
+ - **Iterative Editing** - Refresh files edited externally without losing your place
74
+ - **Live Documentation** - Keep markdown files in sync with external updates
75
+ - **Collaborative Work** - View changes from teammates without manual reload
76
+ - **Build System Integration** - Refresh generated files after build processes
77
+
78
+ ## Requirements
79
+
80
+ - JupyterLab >= 4.0.0
81
+
82
+ ## Installation
83
+
84
+ ### From PyPI
85
+
86
+ ```bash
87
+ pip install jupyterlab-refresh-view-extension
88
+ ```
89
+
90
+ ### From npm
91
+
92
+ ```bash
93
+ jupyter labextension install jupyterlab_refresh_view_extension
94
+ ```
95
+
96
+ ## Usage
97
+
98
+ 1. Open a markdown file, notebook, or text file in JupyterLab
99
+ 2. Right-click anywhere in the document content
100
+ 3. Select **"Refresh View"** from the context menu
101
+ 4. The file reloads from disk while maintaining your scroll position
102
+
103
+ Alternatively, open the command palette (`Ctrl+Shift+C` or `Cmd+Shift+C`) and search for "Refresh View".
104
+
105
+ ## Uninstall
106
+
107
+ ```bash
108
+ pip uninstall jupyterlab-refresh-view-extension
109
+ ```
110
+
111
+ ## Contributing
112
+
113
+ ### Development install
114
+
115
+ Note: You will need NodeJS to build the extension package.
116
+
117
+ The `jlpm` command is JupyterLab's pinned version of
118
+ [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
119
+ `yarn` or `npm` in lieu of `jlpm` below.
120
+
121
+ ```bash
122
+ # Clone the repo to your local environment
123
+ # Change directory to the jupyterlab_refresh_view_extension directory
124
+ # Install package in development mode
125
+ pip install -e "."
126
+ # Link your development version of the extension with JupyterLab
127
+ jupyter labextension develop . --overwrite
128
+ # Rebuild extension Typescript source after making changes
129
+ jlpm build
130
+ ```
131
+
132
+ You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
133
+
134
+ ```bash
135
+ # Watch the source directory in one terminal, automatically rebuilding when needed
136
+ jlpm watch
137
+ # Run JupyterLab in another terminal
138
+ jupyter lab
139
+ ```
140
+
141
+ With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
142
+
143
+ By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
144
+
145
+ ```bash
146
+ jupyter lab build --minimize=False
147
+ ```
148
+
149
+ ### Development uninstall
150
+
151
+ ```bash
152
+ pip uninstall jupyterlab_refresh_view_extension
153
+ ```
154
+
155
+ In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
156
+ command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
157
+ folder is located. Then you can remove the symlink named `jupyterlab_refresh_view_extension` within that folder.
158
+
159
+ ### Testing the extension
160
+
161
+ #### Frontend tests
162
+
163
+ This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.
164
+
165
+ To execute them, execute:
166
+
167
+ ```sh
168
+ jlpm
169
+ jlpm test
170
+ ```
171
+
172
+ #### Integration tests
173
+
174
+ This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
175
+ More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.
176
+
177
+ More information are provided within the [ui-tests](./ui-tests/README.md) README.
178
+
179
+ ### Packaging the extension
180
+
181
+ See [RELEASE](RELEASE.md)
@@ -0,0 +1,126 @@
1
+ # JupyterLab Refresh View Extension
2
+
3
+ [![Github Actions Status](https://github.com/the-cog-conf/jupyterlab_refresh_view_extension/workflows/Build/badge.svg)](https://github.com/the-cog-conf/jupyterlab_refresh_view_extension/actions/workflows/build.yml)
4
+ [![npm version](https://badge.fury.io/js/jupyterlab_refresh_view_extension.svg)](https://www.npmjs.com/package/jupyterlab_refresh_view_extension)
5
+ [![PyPI version](https://badge.fury.io/py/jupyterlab-refresh-view-extension.svg)](https://pypi.org/project/jupyterlab-refresh-view-extension/)
6
+
7
+ JupyterLab extension that adds a **"Refresh View"** context menu command to reload file content from disk while preserving scroll position.
8
+
9
+ ## Features
10
+
11
+ - **Context Menu Integration** - Right-click on markdown files, notebooks, or text editors to access the refresh command
12
+ - **Scroll Position Preservation** - Automatically maintains your current scroll position after refreshing content
13
+ - **Command Palette Access** - Available via command palette under "File Operations" category
14
+ - **Smart Enable/Disable** - Only enabled when a document with context is active
15
+
16
+ ## Use Cases
17
+
18
+ - **Iterative Editing** - Refresh files edited externally without losing your place
19
+ - **Live Documentation** - Keep markdown files in sync with external updates
20
+ - **Collaborative Work** - View changes from teammates without manual reload
21
+ - **Build System Integration** - Refresh generated files after build processes
22
+
23
+ ## Requirements
24
+
25
+ - JupyterLab >= 4.0.0
26
+
27
+ ## Installation
28
+
29
+ ### From PyPI
30
+
31
+ ```bash
32
+ pip install jupyterlab-refresh-view-extension
33
+ ```
34
+
35
+ ### From npm
36
+
37
+ ```bash
38
+ jupyter labextension install jupyterlab_refresh_view_extension
39
+ ```
40
+
41
+ ## Usage
42
+
43
+ 1. Open a markdown file, notebook, or text file in JupyterLab
44
+ 2. Right-click anywhere in the document content
45
+ 3. Select **"Refresh View"** from the context menu
46
+ 4. The file reloads from disk while maintaining your scroll position
47
+
48
+ Alternatively, open the command palette (`Ctrl+Shift+C` or `Cmd+Shift+C`) and search for "Refresh View".
49
+
50
+ ## Uninstall
51
+
52
+ ```bash
53
+ pip uninstall jupyterlab-refresh-view-extension
54
+ ```
55
+
56
+ ## Contributing
57
+
58
+ ### Development install
59
+
60
+ Note: You will need NodeJS to build the extension package.
61
+
62
+ The `jlpm` command is JupyterLab's pinned version of
63
+ [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
64
+ `yarn` or `npm` in lieu of `jlpm` below.
65
+
66
+ ```bash
67
+ # Clone the repo to your local environment
68
+ # Change directory to the jupyterlab_refresh_view_extension directory
69
+ # Install package in development mode
70
+ pip install -e "."
71
+ # Link your development version of the extension with JupyterLab
72
+ jupyter labextension develop . --overwrite
73
+ # Rebuild extension Typescript source after making changes
74
+ jlpm build
75
+ ```
76
+
77
+ You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
78
+
79
+ ```bash
80
+ # Watch the source directory in one terminal, automatically rebuilding when needed
81
+ jlpm watch
82
+ # Run JupyterLab in another terminal
83
+ jupyter lab
84
+ ```
85
+
86
+ With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
87
+
88
+ By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
89
+
90
+ ```bash
91
+ jupyter lab build --minimize=False
92
+ ```
93
+
94
+ ### Development uninstall
95
+
96
+ ```bash
97
+ pip uninstall jupyterlab_refresh_view_extension
98
+ ```
99
+
100
+ In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
101
+ command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
102
+ folder is located. Then you can remove the symlink named `jupyterlab_refresh_view_extension` within that folder.
103
+
104
+ ### Testing the extension
105
+
106
+ #### Frontend tests
107
+
108
+ This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.
109
+
110
+ To execute them, execute:
111
+
112
+ ```sh
113
+ jlpm
114
+ jlpm test
115
+ ```
116
+
117
+ #### Integration tests
118
+
119
+ This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
120
+ More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.
121
+
122
+ More information are provided within the [ui-tests](./ui-tests/README.md) README.
123
+
124
+ ### Packaging the extension
125
+
126
+ See [RELEASE](RELEASE.md)