Skip to content

Conversation

@goanpeca
Copy link
Collaborator

@goanpeca goanpeca commented Oct 17, 2025

Fixes datalayer/vscode-datalayer#28

So, maybe something still needs to be fixed on lexical loro side, but this allows selection and deletion of orphaned output cells which is what the bug manifested as.

We should probably not get to this state in the first place, but at least this allows to delete the orphan output nodes for documents that resulted in this.

@goanpeca goanpeca self-assigned this Oct 17, 2025
@goanpeca goanpeca requested a review from echarles October 17, 2025 23:58
@goanpeca goanpeca force-pushed the enh/orphan-output-nodes branch from c8660d0 to c6b9f84 Compare October 18, 2025 00:00
@goanpeca goanpeca marked this pull request as ready for review October 18, 2025 00:00
Copilot AI review requested due to automatic review settings October 18, 2025 00:00
@goanpeca goanpeca changed the title Allow deletion of orphan nodes! Allow deletion of orphan output nodes! Oct 18, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses orphaned output nodes in Jupyter notebooks by allowing their selection and deletion. When input cells are deleted, their associated output nodes can become orphaned, and this change provides a mechanism to identify and clean up these orphaned nodes.

  • Added utility function to detect orphaned output nodes
  • Modified output node behavior to make orphaned nodes selectable and deletable
  • Preserved protection for output nodes with valid parent input nodes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/lexical/src/nodes/JupyterOutputNodeUtils.ts New utility file with function to detect orphaned output nodes
packages/lexical/src/nodes/JupyterOutputNode.tsx Updated output node class to allow selection and deletion of orphaned nodes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@goanpeca goanpeca force-pushed the enh/orphan-output-nodes branch from c6b9f84 to f1dadaa Compare October 18, 2025 00:04
Copy link
Member

@echarles echarles left a comment

Choose a reason for hiding this comment

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

LGTM Thx @goanpeca

@goanpeca goanpeca force-pushed the enh/orphan-output-nodes branch from f1dadaa to ba89989 Compare October 20, 2025 22:11
@goanpeca goanpeca merged commit f8a52d7 into datalayer:main Oct 20, 2025
6 checks passed
@goanpeca goanpeca deleted the enh/orphan-output-nodes branch October 20, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated placeholder text appears in code cells after assigning a kernel

2 participants