Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
python -m pip install .[test]
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-cell-diff.*OK"
jupyter labextension list 2>&1 | grep -ie "jupyterlab-diff.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
pip install "jupyterlab>=4.0.0,<5" jupyterlab_cell_diff*.whl
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-cell-diff.*OK"
jupyter labextension list 2>&1 | grep -ie "jupyterlab-diff.*OK"
python -m jupyterlab.browser_check --no-browser-test
check_links:
Expand Down
42 changes: 21 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,75 @@

## 0.5.1

([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/compare/v0.5.0...04e46da359755617d98a10311c0604fd331c72cb))
([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-diff/compare/v0.5.0...04e46da359755617d98a10311c0604fd331c72cb))

### Bugs fixed

- Fix gutter styling with dark themes [#14](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/14) ([@jtpio](https://github.com/jtpio))
- Fix gutter styling with dark themes [#14](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/14) ([@jtpio](https://github.com/jtpio))

### Documentation improvements

- Document command arguments [#15](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/15) ([@jtpio](https://github.com/jtpio))
- Document command arguments [#15](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/15) ([@jtpio](https://github.com/jtpio))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/graphs/contributors?from=2025-09-17&to=2025-09-23&type=c))
([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-diff/graphs/contributors?from=2025-09-17&to=2025-09-23&type=c))

[@jtpio](https://github.com/search?q=repo%3Ajupyter-ai-contrib%2Fjupyterlab-cell-diff+involves%3Ajtpio+updated%3A2025-09-17..2025-09-23&type=Issues)
[@jtpio](https://github.com/search?q=repo%3Ajupyter-ai-contrib%2Fjupyterlab-diff+involves%3Ajtpio+updated%3A2025-09-17..2025-09-23&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 0.5.0

([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/compare/v0.4.2...787f10383f9ce4eb2b6d781b57ddd808b859b14c))
([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-diff/compare/v0.4.2...787f10383f9ce4eb2b6d781b57ddd808b859b14c))

### New features added

- Allow diffing with `@codemirror/merge` [#6](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/6) ([@jtpio](https://github.com/jtpio))
- Allow diffing with `@codemirror/merge` [#6](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/6) ([@jtpio](https://github.com/jtpio))

### Enhancements made

- Localize user-facing strings with `ITranslator` [#8](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/8) ([@jtpio](https://github.com/jtpio))
- Localize user-facing strings with `ITranslator` [#8](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/8) ([@jtpio](https://github.com/jtpio))

### Maintenance and upkeep improvements

- Drop support for `nbdime` diffs [#12](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/12) ([@jtpio](https://github.com/jtpio))
- Fix links after the move to the `jupyter-ai-contrib` organization [#7](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/7) ([@jtpio](https://github.com/jtpio))
- Delete Untitled.ipynb [#4](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/4) ([@jtpio](https://github.com/jtpio))
- Drop support for `nbdime` diffs [#12](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/12) ([@jtpio](https://github.com/jtpio))
- Fix links after the move to the `jupyter-ai-contrib` organization [#7](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/7) ([@jtpio](https://github.com/jtpio))
- Delete Untitled.ipynb [#4](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/4) ([@jtpio](https://github.com/jtpio))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/graphs/contributors?from=2025-01-03&to=2025-09-17&type=c))
([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-diff/graphs/contributors?from=2025-01-03&to=2025-09-17&type=c))

[@jtpio](https://github.com/search?q=repo%3Ajupyter-ai-contrib%2Fjupyterlab-cell-diff+involves%3Ajtpio+updated%3A2025-01-03..2025-09-17&type=Issues)
[@jtpio](https://github.com/search?q=repo%3Ajupyter-ai-contrib%2Fjupyterlab-diff+involves%3Ajtpio+updated%3A2025-01-03..2025-09-17&type=Issues)

## 0.4.2

([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/compare/v0.4.1...822c684ae378d6c22af60940bf38d0f7c2a89ab4))
([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-diff/compare/v0.4.1...822c684ae378d6c22af60940bf38d0f7c2a89ab4))

### Bugs fixed

- add logic to remove the 'compare' button [#2](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/2) ([@Zsailer](https://github.com/Zsailer))
- add logic to remove the 'compare' button [#2](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/2) ([@Zsailer](https://github.com/Zsailer))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/graphs/contributors?from=2025-01-03&to=2025-01-03&type=c))
([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-diff/graphs/contributors?from=2025-01-03&to=2025-01-03&type=c))

[@Zsailer](https://github.com/search?q=repo%3AZsailer%2Fjupyterlab-cell-diff+involves%3AZsailer+updated%3A2025-01-03..2025-01-03&type=Issues)
[@Zsailer](https://github.com/search?q=repo%3AZsailer%2Fjupyterlab-diff+involves%3AZsailer+updated%3A2025-01-03..2025-01-03&type=Issues)

## 0.4.1

([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/compare/v0.4.0...8a4b27aaef88370762f7173b94d472be7b230e52))
([Full Changelog](https://github.com/jupyter-ai-contrib/jupyterlab-diff/compare/v0.4.0...8a4b27aaef88370762f7173b94d472be7b230e52))

### Enhancements made

- Remove old diffs when a new diff is created [#1](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/pull/1) ([@Zsailer](https://github.com/Zsailer))
- Remove old diffs when a new diff is created [#1](https://github.com/jupyter-ai-contrib/jupyterlab-diff/pull/1) ([@Zsailer](https://github.com/Zsailer))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/graphs/contributors?from=2024-12-20&to=2025-01-03&type=c))
([GitHub contributors page for this release](https://github.com/jupyter-ai-contrib/jupyterlab-diff/graphs/contributors?from=2024-12-20&to=2025-01-03&type=c))

[@Zsailer](https://github.com/search?q=repo%3AZsailer%2Fjupyterlab-cell-diff+involves%3AZsailer+updated%3A2024-12-20..2025-01-03&type=Issues)
[@Zsailer](https://github.com/search?q=repo%3Ajupyter-ai-contrib%2Fjupyterlab-diff+involves%3AZsailer+updated%3A2024-12-20..2025-01-03&type=Issues)

## 0.4.0

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pip uninstall jupyterlab_cell_diff

In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
folder is located. Then you can remove the symlink named `jupyterlab-cell-diff` within that folder.
folder is located. Then you can remove the symlink named `jupyterlab-diff` within that folder.

### Packaging the extension

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# jupyterlab-cell-diff
# jupyterlab-diff

[![Github Actions Status](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/workflows/Build/badge.svg)](https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/actions/workflows/build.yml)
[![Github Actions Status](https://github.com/jupyter-ai-contrib/jupyterlab-diff/workflows/Build/badge.svg)](https://github.com/jupyter-ai-contrib/jupyterlab-diff/actions/workflows/build.yml)

A JupyterLab extension for showing cell diffs with multiple diffing strategies.

Expand All @@ -20,8 +20,8 @@ pip install jupyterlab_cell_diff

```bash
# Clone the repository
git clone https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff.git
cd jupyterlab-cell-diff
git clone https://github.com/jupyter-ai-contrib/jupyterlab-diff.git
cd jupyterlab-diff

# Install the extension in development mode
pip install -e .
Expand All @@ -34,9 +34,9 @@ jupyter labextension develop . --overwrite

The extension provides commands to show diffs in multiple formats:

- `jupyterlab-cell-diff:split-cell-diff` - Show cell diff using split view (side-by-side comparison)
- `jupyterlab-cell-diff:unified-cell-diff` - Show cell diff using unified view
- `jupyterlab-cell-diff:unified-file-diff` - Show file diff using unified view for regular Python files and other text files
- `jupyterlab-diff:split-cell-diff` - Show cell diff using split view (side-by-side comparison)
- `jupyterlab-diff:unified-cell-diff` - Show cell diff using unified view
- `jupyterlab-diff:unified-file-diff` - Show file diff using unified view for regular Python files and other text files

https://github.com/user-attachments/assets/0dacd7f0-5963-4ebe-81da-2958f0117071

Expand All @@ -45,7 +45,7 @@ https://github.com/user-attachments/assets/0dacd7f0-5963-4ebe-81da-2958f0117071
#### Split Cell Diff (Side-by-side View)

```typescript
app.commands.execute('jupyterlab-cell-diff:split-cell-diff', {
app.commands.execute('jupyterlab-diff:split-cell-diff', {
cellId: 'cell-id',
originalSource: 'print("Hello")',
newSource: 'print("Hello, World!")',
Expand All @@ -57,7 +57,7 @@ app.commands.execute('jupyterlab-cell-diff:split-cell-diff', {
#### Unified Cell Diff

```typescript
app.commands.execute('jupyterlab-cell-diff:unified-cell-diff', {
app.commands.execute('jupyterlab-diff:unified-cell-diff', {
cellId: 'cell-id',
originalSource: 'print("Hello")',
newSource: 'print("Hello, World!")',
Expand All @@ -68,7 +68,7 @@ app.commands.execute('jupyterlab-cell-diff:unified-cell-diff', {
#### Unified File Diff

```typescript
app.commands.execute('jupyterlab-cell-diff:unified-file-diff', {
app.commands.execute('jupyterlab-diff:unified-file-diff', {
filePath: '/path/to/file.py',
originalSource: 'print("Hello")',
newSource: 'print("Hello, World!")',
Expand All @@ -78,7 +78,7 @@ app.commands.execute('jupyterlab-cell-diff:unified-file-diff', {

### Command Arguments

#### `jupyterlab-cell-diff:split-cell-diff` (Split View)
#### `jupyterlab-diff:split-cell-diff` (Split View)

| Argument | Type | Required | Description |
| ------------------- | --------- | -------- | ------------------------------------------------------------------------------------ |
Expand All @@ -89,7 +89,7 @@ app.commands.execute('jupyterlab-cell-diff:unified-file-diff', {
| `notebookPath` | `string` | No | Path to the notebook containing the cell. If not provided, uses the current notebook |
| `openDiff` | `boolean` | No | Whether to open the diff widget automatically (default: `true`) |

#### `jupyterlab-cell-diff:unified-cell-diff` (Unified View)
#### `jupyterlab-diff:unified-cell-diff` (Unified View)

| Argument | Type | Required | Description |
| ------------------- | --------- | -------- | ------------------------------------------------------------------------------------ |
Expand All @@ -99,7 +99,7 @@ app.commands.execute('jupyterlab-cell-diff:unified-file-diff', {
| `showActionButtons` | `boolean` | No | Whether to show action buttons for chunk acceptance (default: `true`) |
| `notebookPath` | `string` | No | Path to the notebook containing the cell. If not provided, uses the current notebook |

#### `jupyterlab-cell-diff:unified-file-diff` (File Diff)
#### `jupyterlab-diff:unified-file-diff` (File Diff)

| Argument | Type | Required | Description |
| ------------------- | --------- | -------- | --------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab_cell_diff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@


def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "jupyterlab-cell-diff"}]
return [{"src": "labextension", "dest": "jupyterlab-diff"}]
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "jupyterlab-cell-diff",
"name": "jupyterlab-diff",
"version": "0.5.1",
"description": "A JupyterLab Extension for showing cell (git) diffs.",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff",
"homepage": "https://github.com/jupyter-ai-contrib/jupyterlab-diff",
"bugs": {
"url": "https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff/issues"
"url": "https://github.com/jupyter-ai-contrib/jupyterlab-diff/issues"
},
"license": "BSD-3-Clause",
"author": {
Expand All @@ -27,7 +27,7 @@
"style": "style/index.css",
"repository": {
"type": "git",
"url": "https://github.com/jupyter-ai-contrib/jupyterlab-cell-diff.git"
"url": "https://github.com/jupyter-ai-contrib/jupyterlab-diff.git"
},
"scripts": {
"build": "jlpm build:lib && jlpm build:labextension:dev",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ artifacts = ["jupyterlab_cell_diff/labextension"]
exclude = [".github", "binder"]

[tool.hatch.build.targets.wheel.shared-data]
"jupyterlab_cell_diff/labextension" = "share/jupyter/labextensions/jupyterlab-cell-diff"
"install.json" = "share/jupyter/labextensions/jupyterlab-cell-diff/install.json"
"jupyterlab_cell_diff/labextension" = "share/jupyter/labextensions/jupyterlab-diff"
"install.json" = "share/jupyter/labextensions/jupyterlab-diff/install.json"

[tool.hatch.build.hooks.version]
path = "jupyterlab_cell_diff/_version.py"
Expand Down
2 changes: 1 addition & 1 deletion src/diff/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function createCodeMirrorSplitDiffWidget(
trans
});

diffWidget.addClass('jupyterlab-cell-diff');
diffWidget.addClass('jupyterlab-diff');
diffWidget.addToFooter();

return diffWidget;
Expand Down
14 changes: 7 additions & 7 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { CodeMirrorEditor } from '@jupyterlab/codemirror';
/**
* The translation namespace for the plugin.
*/
const TRANSLATION_NAMESPACE = 'jupyterlab-cell-diff';
const TRANSLATION_NAMESPACE = 'jupyterlab-diff';

/**
* Find a notebook by path using the notebook tracker
Expand Down Expand Up @@ -67,7 +67,7 @@ export function findCell(
* Split cell diff plugin - shows side-by-side comparison
*/
const splitCellDiffPlugin: JupyterFrontEndPlugin<void> = {
id: 'jupyterlab-cell-diff:split-cell-diff-plugin',
id: 'jupyterlab-diff:split-cell-diff-plugin',
description: 'Show cell diff using side-by-side split view',
requires: [ICellFooterTracker, INotebookTracker],
optional: [ITranslator],
Expand All @@ -81,7 +81,7 @@ const splitCellDiffPlugin: JupyterFrontEndPlugin<void> = {
const { commands } = app;
const trans = (translator ?? nullTranslator).load(TRANSLATION_NAMESPACE);

commands.addCommand('jupyterlab-cell-diff:split-cell-diff', {
commands.addCommand('jupyterlab-diff:split-cell-diff', {
label: trans.__('Show Cell Diff (Split View)'),
describedBy: {
args: {
Expand Down Expand Up @@ -177,7 +177,7 @@ const splitCellDiffPlugin: JupyterFrontEndPlugin<void> = {
* Unified cell diff plugin
*/
const unifiedCellDiffPlugin: JupyterFrontEndPlugin<void> = {
id: 'jupyterlab-cell-diff:unified-cell-diff-plugin',
id: 'jupyterlab-diff:unified-cell-diff-plugin',
description: 'Show cell diff using unified view',
requires: [ICellFooterTracker, INotebookTracker],
optional: [ITranslator],
Expand All @@ -194,7 +194,7 @@ const unifiedCellDiffPlugin: JupyterFrontEndPlugin<void> = {
// Track active unified diff managers to avoid creating duplicates
const cellDiffManagers = new Map<string, UnifiedCellDiffManager>();

commands.addCommand('jupyterlab-cell-diff:unified-cell-diff', {
commands.addCommand('jupyterlab-diff:unified-cell-diff', {
label: trans.__('Show Cell Diff (Unified)'),
describedBy: {
args: {
Expand Down Expand Up @@ -292,7 +292,7 @@ const unifiedCellDiffPlugin: JupyterFrontEndPlugin<void> = {
* Unified file diff plugin
*/
const unifiedFileDiffPlugin: JupyterFrontEndPlugin<void> = {
id: 'jupyterlab-cell-diff:unified-file-diff-plugin',
id: 'jupyterlab-diff:unified-file-diff-plugin',
description: 'Show file diff using unified view',
requires: [IEditorTracker],
optional: [ITranslator],
Expand All @@ -308,7 +308,7 @@ const unifiedFileDiffPlugin: JupyterFrontEndPlugin<void> = {
// Track active unified diff managers to avoid creating duplicates
const fileDiffManagers = new Map<string, UnifiedFileDiffManager>();

commands.addCommand('jupyterlab-cell-diff:unified-file-diff', {
commands.addCommand('jupyterlab-diff:unified-file-diff', {
label: trans.__('Diff File (Unified)'),
describedBy: {
args: {
Expand Down
4 changes: 2 additions & 2 deletions src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export abstract class BaseDiffWidget extends Widget {
return;
}

footer.removeWidget('jupyterlab-cell-diff');
footer.removeWidget('jupyterlab-diff');
footer.removeToolbarItem('accept-diff');
footer.removeToolbarItem('reject-diff');
footer.removeToolbarItem('toggle-diff');
Expand Down Expand Up @@ -178,7 +178,7 @@ export abstract class BaseDiffWidget extends Widget {
const cellId = this._cell.id;
const footer = this._cellFooterTracker.getFooter(cellId);
if (footer) {
footer.removeWidget('jupyterlab-cell-diff');
footer.removeWidget('jupyterlab-diff');
footer.removeToolbarItem('accept-diff');
footer.removeToolbarItem('reject-diff');
footer.removeToolbarItem('toggle-diff');
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/tests/split-cell-diff.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NotebookPanel } from '@jupyterlab/notebook';
/**
* The command to open the cell split diff view.
*/
const SPLIT_CELL_DIFF_COMMAND = 'jupyterlab-cell-diff:split-cell-diff';
const SPLIT_CELL_DIFF_COMMAND = 'jupyterlab-diff:split-cell-diff';

/**
* Setup a notebook cell with diff view.
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/tests/unified-cell-diff.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NotebookPanel } from '@jupyterlab/notebook';
/**
* The command to open the cell unified diff view.
*/
const UNIFIED_CELL_DIFF_COMMAND = 'jupyterlab-cell-diff:unified-cell-diff';
const UNIFIED_CELL_DIFF_COMMAND = 'jupyterlab-diff:unified-cell-diff';

/**
* Setup a notebook cell with unified diff view.
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/tests/unified-file-diff.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect, IJupyterLabPageFixture, test } from '@jupyterlab/galata';
/**
* The command to open the file unified diff view.
*/
const UNIFIED_FILE_DIFF_COMMAND = 'jupyterlab-cell-diff:unified-file-diff';
const UNIFIED_FILE_DIFF_COMMAND = 'jupyterlab-diff:unified-file-diff';

/**
* Default name for new Python files.
Expand Down
Loading
Loading