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

Cell attachment cleanup tool improvement in diff editor #161132

Merged
merged 4 commits into from Sep 16, 2022

Conversation

rebornix
Copy link
Member

Jupyter notebook support attachments in nbdocument.cell but this concept doesn't exist in notebook, thus the ipynb extension stores this special data in cell metadata. Our attachment cleanup tool will listen to content changes and make sure the attachment stored in the cell metadata is cleared/restored when attachment links in cell content changed.

However this doesn't work well in diff editor, when users try to revert attachment link change in cell content, the diff editor is not aware that we need to restore some of the metadata properties. This PR is an attempt to allow serializers to mark which metadata properties are related to cell content and should be restored when cell content is being modified in the diff editor.

The long term solution might be that we delegate the diffing work to serializers, serializers can build up mappings between attachment link, attachment data and cell diffs, so it can listen to cell content changes in modified editor and restore cell metadata from the original document properly.

@rebornix rebornix self-assigned this Sep 16, 2022
@rebornix rebornix added this to the September 2022 milestone Sep 16, 2022
mjbvz
mjbvz previously approved these changes Sep 16, 2022
@rebornix rebornix merged commit 6e8bc02 into main Sep 16, 2022
@rebornix rebornix deleted the rebornix/attachment-refactor branch September 16, 2022 21:12
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants