Result Element

Execution output display. Shows stdout, stderr, and errors from element execution.

Spawning

Result elements are not user-spawned. They are created automatically when a py, ts, or prompt element executes. The result auto-melds below its parent element via autoMeldResultBelow.

Structure

Close behavior

Closing a result that is inside a melded composition unmelds the entire composition first (via unmeldComposition), then removes the result element.

Meld position

Result receives bottom connections from py and prompt elements. It can also chain downward to other result elements (bottom → result).

Chaining

Result elements chain via bottom meld edges for conversational follow-ups. A hover-reveal input appears at the bottom edge of a result; typing a follow-up and pressing Enter sends the previous output plus the new prompt to the LLM, spawning a chained result below. Chains extend indefinitely through melded compositions.

Content persistence

The ExecutionResult object is JSON-serialized into the element's content field for persistence across page reloads. updateResultElementContent updates an existing result in-place when re-execution occurs.

Files

FileRole
web/ts/components/element/result-element.tsElement factory, createResultElement, updateResultElementContent
web/ts/components/element/meld/auto-meld-result.tsAuto-meld helper used by py/ts/prompt elements
web/ts/components/element/result-element.dom.test.tsDOM structure tests
web/ts/components/element/result-drag.test.tsDrag behavior tests