jupyterlab / jupyter-collaboration

A Jupyter Server Extension Providing Support for Y Documents
https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/
Other
170 stars 31 forks source link

Implementing Collaborative Timeline Slider with Undo/Redo Functionality for Jupyter Collaboration #332

Closed Meriem-BenIsmail closed 3 months ago

Meriem-BenIsmail commented 4 months ago

Description:

This pull request introduces a comprehensive timeline and undo/redo functionality to the Jupyter Collaboration project. The primary goal of this feature is to enhance the collaborative experience by allowing users to track changes, restore previous versions of documents, and seamlessly undo or redo actions.

Key Features:

  1. Timeline Slider Component:
    • Added a component (TimelineSliderComponent) that provides an interactive slider to navigate through the history of document changes.
    • The slider fetches and displays timestamps of changes, allowing users to select specific versions of the document and to restore them if needed.
  2. Document Forking and Restoration:
    • Implemented functions to fork the current state of the document and create new versions.
    • Users can restore the document to any previous state using the restore mode.
  3. Undo/Redo Management:
    • Integrated UndoManager to handle undo and redo operations for document edits.
    • Users can perform multiple undo/redo actions to revert or reapply changes.
  4. API Enhancements:
    • Extended the existing API to support timeline fetching and document restoration.
    • Introduced new endpoints for creating document forks and managing undo/redo operations.
  5. Notifications:
    • Implemented user notifications to provide feedback on actions such as successful document restoration or errors.

Usage:

  1. Accessing the Timeline:
    • Click on the history icon in the status bar to open the timeline slider.
    • Use the slider to navigate through different versions of the document.
  2. Restoring a Version:
    • Select a desired timestamp from the slider and click the "Restore version" button to revert the document to the selected state.
    • A notification will confirm the successful restoration or display an error if the operation fails.
  3. Undo/Redo Actions:
    • Use the timeline slider to perform undo/redo operations by moving back and forth between timestamps.

Note: The timeline is tested with various document types, including notebooks and files in different directory structures and also YJCad files of JupyterCAD.

Here is a demo of the functionality timeline-rtc-feature

github-actions[bot] commented 4 months ago

Binder :point_left: Launch a Binder on branch Meriem-BenIsmail/jupyter-collaboration/collaborative-timeline-feature