Skip to content

Interactive X-axis compatibility prompt for multi-signal operations #4

@PierreRaybaut

Description

@PierreRaybaut

Summary

When a multi-signal operation (n→1 or 2→1) receives signals with incompatible X arrays, surface an interactive prompt asking the user how to proceed (interpolate / abort / always interpolate). Matches DataLab Qt's xarray_compat_behavior setting.

Motivation

Today, X-array mismatch in multi-signal operations either silently interpolates (when skip_xarray_compat=False) or fails with a Python error. Users get no chance to confirm the interpolation, and have no way to make the choice once and remember it. DataLab Qt offers an "ask before interpolating" policy that prompts at the boundary and remembers the answer for the session.

Architectural impact

  • Mid-computation modal: Pyodide runs synchronously from the host's perspective, but the prompt must be raised mid-dispatch and resolved before the operation continues. This requires either:
    • splitting the dispatch into a "validate + prompt + execute" pipeline owned by TS, or
    • exposing a Python ↔ TS callback (similar to how progress callbacks could work) so Python can await a user decision.
  • Session memory: the "always interpolate / always abort" choice must be scoped (per-session? until Preferences change? per-operation type?) and stored somewhere the dispatcher can read it without a round trip.
  • Action surface: the dispatcher already accepts skip_xarray_compat=True for operations that intentionally use mismatched X arrays — the new flow must respect that bypass.
  • Error reporting: when the user picks "abort", the failure must surface in the existing notification system without dumping a Python traceback.

Acceptance criteria

  • A dispatcher hook detects X-axis incompatibility before executing a multi-signal computation and raises a structured event consumable by TS.
  • A reusable modal (or notification with action buttons) lets the user pick Interpolate, Abort, Always interpolate (this session), Always abort (this session).
  • The session-scoped choice short-circuits subsequent prompts during the same session.
  • Unit tests in tests/python/ cover the detection logic and the bypass via skip_xarray_compat=True.
  • A Playwright spec triggers a sum between two signals with different X arrays and asserts the prompt appears, then the result is produced after clicking Interpolate.

References

  • DataLab desktop: X-axis compatibility logic in datalab/gui/processor/base.py (lines ~1764, 1886) and the xarray_compat_behavior setting
  • Web today: skip_xarray_compat flag on register_2_to_1 / register_n_to_1 in src/runtime/processor.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions