-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add streamOutputChange
attribute to cell change object
#264
Conversation
09e5990
to
c8603b3
Compare
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
event => | ||
event.path.length === 3 && | ||
event.path[0] === 'outputs' && | ||
event.path[2] === 'text' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @davidbrochart!
streamOutputChange
attribute to cell change object
See jupyterlab/jupyterlab#16692 (comment).