fix(toolbox_transform_editor): MIMO-aware live preview#178
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 realcreateTransformpath 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 (18MimoTransformTestgreen) 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 viasplitOutputNames(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.readManyRawSamples: resolve the source ghost + all M outputs in one catalog snapshot + scan (was M+1 per tick), reusing a sharedsamplesFromHandle. Reconstructtopic/fieldkeys without doubling the slash, matching the host's single-slash input keys.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 (relaunchrun.sh):radius,angle+return math.sqrt(value*value+v1*v1), math.atan(v1,value)→ preview shows ghost + 2 curves, Create enabled; SISOreturn value*2still previews/creates unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01K4uZtXDT36cdFQayeuPJ5r