Use nbdime in JupyterLab's suggestion system
Opened this issue · 2 comments
I'm working on supporting suggestions in RTC, similarly to Google Docs. Currently, we don't have the "unified view" of all the suggestions that Google Docs provide. Instead, users can only decide to see the document where someone is suggesting (the fork), or see the original document (the root), but they cannot see a diff. When they are satisfied with a fork, they can merge it back into the root.
Do you think nbdime
could be used for that? It obviously cannot show a unified view of all the diffs, but at least it could show a diff of the fork vs the root. It seems that it would allow us to quickly have a nice UI, but I'm wondering if it would be easy to integrate into RTC's suggestion system. Also, is it able to show live editing of the two branches?
cc @trungleduc
My first impression:
nbdime
exposes an endpoint (/api/diff ) via a server extension to compute the diff between two notebooks.- We can create a suggestion widget that keeps a copy of the original notebook, and send requests to the backend on suggestion changed events to compute the diff and then render the output with the current nbdime's
NotebookDiffWidget
widget. - We might want to debounce the diff requests to reduce server load.
OK so not very real-time friendly, but that could be a quick path.