DataLab icon indicating copy to clipboard operation
DataLab copied to clipboard

Add an History Panel

Open PierreRaybaut opened this issue 1 year ago • 1 comments

Here is what an History Panel could looks like:

Main features of the History Panel:

  • Record all actions from signal/image creation to processing actions
  • Ability to replay a single action or a sequence of actions
  • Restore the selection state (optionally) before replaying the action
  • Save/load history actions to/from the workspace HDF5 file

PierreRaybaut avatar Jul 22 '24 12:07 PierreRaybaut

Issue: Development Ideas for the History Panel

Branch: feature/history-panel


Summary of Original Ideas (for posterity)

  1. Action Tracking

    • Each action is represented as a line, allowing replaying the workflow from the start.
    • Actions are objects containing:
      • A description (displayed in the UI).
      • Method identifier (class name, method name) and associated arguments:
        • Dataset-type parameters.
        • Signal/image arguments replaced with local identifiers (e.g., s003).
      • An attribute with the DataLab workspace state:
        • Determines if the action can be executed.
        • Validates the number of signals/images and data array dimensions.
      • Serialization/deserialization methods for the action object.
      • A method to execute the action.
  2. History Panel Management

    • Contains multiple lists of actions:
      • A new list is created each time the workspace is cleared.
      • Each list may have a default title based on the timestamp.
    • Handles backward compatibility:
      • Verifies action references upon initialization.
      • Removes incompatible actions, optionally warning the user.
      • Future support for backward compatibility by updating method/class names.
  3. Widget Capabilities

    • Visualize the action tree: branches correspond to action lists.
    • Remove action lists or specific actions.
    • Display workspace state for each action:
      • Left: table of signals with data sizes.
      • Right: table of images with dimensions.
    • Highlight executable actions (with icons).
    • Execute actions or sequences from a compatible workspace state:
      • Replay actions with stored parameters or user-modified ones.
      • Support interactive execution (dialogs open with saved parameters).
      • Enable non-interactive execution (reuse parameters without dialogs).
  4. Advanced Features

    • Button to generate macros from all or part of the history.

Suggested Priority

  • Critical:

    • Implement action serialization/deserialization and execution.
    • Add workspace state validation for actions.
  • Medium:

    • Backward compatibility handling.
    • Widget enhancements for visualization and usability.
  • Optional:

    • Non-interactive execution.
    • Macro generation.

PierreRaybaut avatar Jul 22 '24 12:07 PierreRaybaut