Skip to content

Commit 613ab9b

Browse files
committed
Add fold lines to error table
1 parent 4bcdae5 commit 613ab9b

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/herbie/ExpressionTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ function ExpressionTable() {
440440

441441
const color = expressionStyles.find((style) => style.expressionId === expression.id)?.color
442442
const components = [
443-
{ value: 'newLocalError', label: 'Local Error', component: <NewLocalError expressionId={expression.id} /> },
443+
{ value: 'newLocalError', label: 'Local Error Table', component: <NewLocalError expressionId={expression.id} /> },
444444
{ value: 'derivationComponent', label: 'Derivation', component: <DerivationComponent expressionId={expression.id}/> },
445445
{ value: 'fpTaylorComponent', label: 'FPTaylor Analysis', component: <FPTaylorComponent expressionId={expression.id}/> },
446446
{ value: 'expressionExport', label: 'Expression Export', component: <ExpressionExport expressionId={expression.id}/> },

src/herbie/LocalError/newLocalError.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,18 @@ function TreeRow({
9999
<tr className={ rowClassName }>
100100
<td className="program-col">
101101
<span
102-
style={{ marginLeft: `${depth * 15}px`, cursor: "pointer" }}
102+
style={{ marginLeft: `0px`, cursor: "pointer" }}
103103
onClick={() => setIsExpanded(prev => !prev)}
104104
>
105-
{node.children.length > 0 && (
105+
{/* Show pipe lines for folding */}
106+
{depth > 0 && (
107+
<span className="pipe-lines" style={{ marginRight: '5px' }}>
108+
{Array(depth).fill(null).map((_, i) => (
109+
<span key={i} className="pipe-line" style={{ height: '20px', borderLeft: '1px solid gray', marginLeft: `${7.5 + (i > 0 ? 5 : 0) }px` }}></span>
110+
))}
111+
</span>
112+
)}
113+
{node.children.length > 0 ? (
106114
<span className="toggle-button">
107115
{isExpanded ? (
108116
<svg
@@ -124,8 +132,12 @@ function TreeRow({
124132
</svg>
125133
)}
126134
</span>
127-
)}
128-
{isExpanded ? mapOp(node.e) : collapsedExpression}
135+
) : (<span style={{ width: '3px' , display: 'inline-block'}}></span>)}
136+
<div style={{
137+
display: "inline-block",
138+
}}>
139+
{isExpanded ? mapOp(node.e) : collapsedExpression}
140+
</div>
129141
</span>
130142
</td>
131143
<td>{renderValue(node["actual-value"])}</td>

0 commit comments

Comments
 (0)