Skip to content

Conversation

@nakul-py
Copy link
Contributor

@nakul-py nakul-py commented Oct 30, 2025

Description

This PR adds inlineDiffs for unified-cell diffs as a new command argument as allowInlineDiffs
By default it is false for current.

Screencast.From.2025-10-30.11-45-47.mp4

Additional code to test inlineDiffs in details.

void window.jupyterapp.commands.execute('jupyterlab-diff:unified-cell-diff', {
  originalSource: `def add():
    x = 10
    y = 20
    total = x + y
    print("Sum is:", total)
    message = "Result computed successfully"
    print("Message:", message)
    return total`,

  newSource: `def add(a, b):
    x = a
    y = b + 1
    total = x + y
    print("Sum is now:", total)
    msg = "Computation done successfully!"
    print("Info:", msg)
    return total`,

  showActionButtons: true,
  allowInlineDiffs: true
});

@nakul-py nakul-py changed the title Adding inlineDiffs for unified-cell diffs Adding inlineDiffs for unified-cell diffs Oct 30, 2025
@jtpio jtpio added the enhancement New feature or request label Oct 30, 2025
'Whether to show action buttons for chunk acceptance'
)
},
allowInlineDiffs: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's document that new argument in the README.md?

Also maybe we could also add it to the unified-file-diff command? (for file diffs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's document that new argument in the README.md?

Yes we can :)

Also maybe we could also add it to the unified-file-diff command? (for file diffs)

Yes i also implemented it for unified-file-diff but cannot able to test it as the error comes No editor found for file so i removed the changes for unified-file-diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think unified-file-diff not supports notebook because it worked in .py file but not worked in .ipynb file.

@nakul-py
Copy link
Contributor Author

@jtpio will we can also add inlineDiffs for spilt-cell also?

@nakul-py nakul-py requested a review from jtpio October 30, 2025 09:44
README.md Outdated
newSource: 'print("Hello, World!")',
showActionButtons: true
showActionButtons: true,
allowInlineDiffs: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we don't need to include that argument in these small examples, especially if the default is false (same for the other example below).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nakul-py nakul-py requested a review from jtpio October 30, 2025 13:38
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jtpio jtpio merged commit 249205b into jupyter-ai-contrib:main Oct 30, 2025
6 checks passed
@nakul-py nakul-py deleted the fix27 branch October 31, 2025 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose a new command argument for allowInlineDiffs

2 participants