@@ -65,6 +65,14 @@ function renderJsonTree(
6565 return node . op === "-" ? `${ node . op } (${ operandHtml } )` : `${ node . op } ${ operandHtml } ` ;
6666 }
6767
68+ // IteDerivationNode
69+ if ( "condition" in node && "thenBranch" in node && "elseBranch" in node ) {
70+ const conditionHtml = renderJsonTree ( error , node . condition , errorId , `${ path } .condition` , expandedPaths ) ;
71+ const thenBranchHtml = renderJsonTree ( error , node . thenBranch , errorId , `${ path } .thenBranch` , expandedPaths ) ;
72+ const elseBranchHtml = renderJsonTree ( error , node . elseBranch , errorId , `${ path } .elseBranch` , expandedPaths ) ;
73+ return `${ conditionHtml } ? ${ thenBranchHtml } : ${ elseBranchHtml } ` ;
74+ }
75+
6876 // fallback
6977 return `<span class="node-value">${ JSON . stringify ( node ) } </span>` ;
7078}
@@ -114,7 +122,7 @@ export function renderDerivationNode(error: RefinementError, node: ValDerivation
114122 return /*html*/ `
115123 <div class="container derivation-container" data-error-id="${ errorId } ">
116124 <div style="flex: 1;">
117- ${ renderJsonTree ( error , node . origin || node , errorId , "root" , expansions ) }
125+ ${ renderJsonTree ( error , node , errorId , "root" , expansions ) }
118126 ${ expansions . size === 0 ? '<span class="node-expand-indicator"> (click to expand)</span>' : '' }
119127 </div>
120128 <button class="reset-btn derivation-reset-btn" data-error-id="${ errorId } " ${ expansions . size === 0 ? "disabled" : "" } >
0 commit comments