Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add streamOutputChange attribute to cell change object #264

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

davidbrochart
Copy link
Collaborator

@davidbrochart davidbrochart commented Aug 21, 2024

@davidbrochart davidbrochart marked this pull request as draft August 21, 2024 16:25
@davidbrochart davidbrochart added the enhancement New feature or request label Aug 21, 2024
Copy link
Collaborator

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

I guess it makes sense? I do not have a full picture of it, I can grab debugger to understand it better later today but I guess we would want the code to be self explanatory anyways.

const length = prevText.length - start;
prevText.delete(start, length);
}, false);
removeStreamOutput(index: number, start: number, origin: any = null): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are valid types/values for origin?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In Yjs an origin can be of any type.

Comment on lines +907 to +910
event =>
event.path.length === 3 &&
event.path[0] === 'outputs' &&
event.path[2] === 'text'
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's hard to understand this without some concrete example. I guess a comment or a test could help here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The event path is an array leading to the changed property, so to access the text property of a cell's stream output, one would do cell['outputs'][output_idx]['text'] and the event path would then be ['outputs', output_idx, 'text']. I'll add a comment 👍

@davidbrochart davidbrochart marked this pull request as ready for review August 22, 2024 08:24
Copy link
Collaborator

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Thank you @davidbrochart!

@krassowski krassowski changed the title Add streamOutputChange Add streamOutputChange attribute to cell change object Aug 23, 2024
@krassowski krassowski merged commit e97181c into jupyter-server:main Aug 23, 2024
11 checks passed
@davidbrochart davidbrochart deleted the stream-output-change branch August 23, 2024 06:30
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.

2 participants