Skip to content

fix(toolbox_transform_editor): MIMO-aware live preview#178

Merged
pabloinigoblasco merged 1 commit into
mainfrom
fix/transform-editor-mimo-preview
Jul 1, 2026
Merged

fix(toolbox_transform_editor): MIMO-aware live preview#178
pabloinigoblasco merged 1 commit into
mainfrom
fix/transform-editor-mimo-preview

Conversation

@Alvvalencia

Copy link
Copy Markdown
Contributor

Problem

Creating a MIMO (N→M) transform from the GUI was blocked. The Transform Editor already supports N→M (output-name field is a comma-separated list; the body returns M values; the real createTransform path passes M outputs). But the live preview declared a single ephemeral output (__te_preview__), so a multi-output body returned M values into a 1-output node → arity mismatch → zero rows → a false "function produced no output" error → which disabled the Create button. Result: MIMO worked in the engine (18 MimoTransformTest green) but could never be created from the UI.

This was not a regression — the plugin shipped this way since #158.

Fix

  • refreshPreview: declare M ephemeral outputs via splitOutputNames(outputName()) (same source of truth as the real create path), plot one curve per output (cycling a small color palette), and fall back to one slot while the name field is mid-typing.
  • "no output" guard: fire only when the source has data and every declared output is empty (one empty channel among several is a legitimate suppressed output).
  • Arity error message: symmetric — names the declared output count and demands exactly that many returns, in either direction (too few OR too many), instead of a misleading "must return a number".
  • readManyRawSamples: resolve the source ghost + all M outputs in one catalog snapshot + scan (was M+1 per tick), reusing a shared samplesFromHandle. Reconstruct topic/field keys without doubling the slash, matching the host's single-slash input keys.

⚠️ Cross-repo coordination

Pairs with PlotJuggler/PJ4#325 (joinTopicField / resolveInputField). The single-slash ghost reconstruction here assumes the host emits single-slash keys (that PR). The MIMO half is independent, but the ghost/// half is coupled — the two should merge together.

Verification

Plugin builds clean (./build.sh toolbox_transform_editor). Live GUI check (relaunch run.sh): radius,angle + return math.sqrt(value*value+v1*v1), math.atan(v1,value) → preview shows ghost + 2 curves, Create enabled; SISO return value*2 still previews/creates unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K4uZtXDT36cdFQayeuPJ5r

The preview declared a single ephemeral output, so a multi-output (N->M) function
returned M values into a 1-output node -> zero rows -> a false "function produced
no output" error that disabled Create. Declare M ephemeral outputs (from the
comma-separated name field, same as the real create path), plot one curve per
output, and only flag "no output" when ALL declared outputs are empty. The arity
error now names the declared count symmetrically (too few OR too many returns).

Resolve the source ghost + all outputs in ONE catalog pass (readManyRawSamples)
and reconstruct topic/field keys without doubling the slash, matching the host's
single-slash input keys (pairs with PJ4 joinTopicField / resolveInputField).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K4uZtXDT36cdFQayeuPJ5r
@pabloinigoblasco pabloinigoblasco merged commit 6c10be2 into main Jul 1, 2026
30 checks passed
@pabloinigoblasco pabloinigoblasco deleted the fix/transform-editor-mimo-preview branch July 1, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants