@@ -7,16 +7,17 @@ type Props = {
77 setupNames : string [ ] ;
88 onRemoveSetup : ( index : number ) => void ;
99 onReorderSetup : ( from : number , to : number ) => void ;
10+ diffsOnly : boolean ;
1011} ;
1112
1213export function ComparisonTable ( {
1314 result,
1415 setupNames,
1516 onRemoveSetup,
1617 onReorderSetup,
18+ diffsOnly,
1719} : Props ) {
1820 const [ collapsed , setCollapsed ] = useState < Record < string , boolean > > ( { } ) ;
19- const [ diffsOnly , setDiffsOnly ] = useState ( true ) ;
2021 const [ dragIndex , setDragIndex ] = useState < number | null > ( null ) ;
2122 const dragIndexRef = useRef < number | null > ( null ) ;
2223 const containerRef = useRef < HTMLDivElement > ( null ) ;
@@ -58,28 +59,20 @@ export function ComparisonTable({
5859 const colCount = setupNames . length + 1 ;
5960
6061 return (
61- < div ref = { containerRef } className = "overflow -auto max-h-[calc(100vh-8rem)] " >
62+ < div ref = { containerRef } className = "mx -auto w-fit " >
6263 < div
63- className = "grid text-sm font-mono w-fit "
64+ className = "grid text-sm"
6465 style = { {
6566 gridTemplateColumns : `auto repeat(${ setupNames . length } , auto)` ,
6667 } }
6768 >
6869 { /* Header */ }
6970 < div
70- className = "sticky top-0 z-10 grid grid-cols-subgrid bg-gray-800 text-gray-200 "
71+ className = "sticky top-0 z-10 grid grid-cols-subgrid bg-elevated text-text-secondary "
7172 style = { { gridColumn : `span ${ colCount } ` } }
7273 >
73- < div className = "p-2 border border-gray-700" >
74- < label className = "flex items-center gap-2 cursor-pointer font-normal" >
75- < input
76- type = "checkbox"
77- checked = { diffsOnly }
78- onChange = { ( e ) => setDiffsOnly ( e . target . checked ) }
79- className = "cursor-pointer"
80- />
81- < span className = "text-xs text-gray-400" > Diffs only</ span >
82- </ label >
74+ < div className = "p-2 border border-border text-[10px] uppercase tracking-widest text-text-muted font-medium" >
75+ Parameter
8376 </ div >
8477 { setupNames . map ( ( name , i ) => (
8578 < div
@@ -93,7 +86,7 @@ export function ComparisonTable({
9386 const container = containerRef . current ;
9487 if ( container ) {
9588 const ghost = document . createElement ( "div" ) ;
96- ghost . className = "text-sm font-mono " ;
89+ ghost . className = "text-sm" ;
9790 for ( const cell of container . querySelectorAll (
9891 `[data-col="${ i } "]` ,
9992 ) ) {
@@ -117,17 +110,17 @@ export function ComparisonTable({
117110 onDrop = { handleDrop }
118111 onDragEnd = { clearDragState }
119112 className = { clsx (
120- "p-2 border border-gray-700 whitespace-nowrap cursor-grab" ,
113+ "p-2 border border-border whitespace-nowrap cursor-grab" ,
121114 dragIndex !== null && dragIndex !== i && "opacity-50" ,
122115 ) }
123116 >
124117 < div className = "flex items-center justify-between gap-2" >
125- < span className = "truncate" title = { name } >
118+ < span className = "truncate text-text-primary " title = { name } >
126119 { name . replace ( / \. l s p $ / , "" ) }
127120 </ span >
128121 < button
129122 onClick = { ( ) => onRemoveSetup ( i ) }
130- className = "text-xs text-gray-500 hover:text-red-400 shrink-0 cursor-pointer"
123+ className = "text-xs text-text-muted hover:text-diff-negative shrink-0 cursor-pointer"
131124 >
132125 remove
133126 </ button >
@@ -183,20 +176,20 @@ function Section({
183176 >
184177 { /* Section header */ }
185178 < div
186- className = "sticky top-[37px] z-[5] bg-gray-700 cursor-pointer hover:bg-gray-600 select-none p-2 border border-gray-600 font-semibold text-gray-100 "
179+ className = "sticky top-[37px] z-[5] bg-elevated cursor-pointer hover:bg-[#2e2e28] select-none p-2 border border-border border-l-2 border-l-accent uppercase tracking-wider text-xs font-medium text-text-primary "
187180 style = { { gridColumn : `span ${ colCount } ` } }
188181 onClick = { onToggle }
189182 >
190183 < span className = "flex justify-between" >
191184 < span >
192- < span className = "mr-2 inline-block w-4 text-center" >
193- { isCollapsed ? "+" : "- " }
185+ < span className = "mr-2 inline-block w-4 text-center text-accent " >
186+ { isCollapsed ? "+" : "\u2212 " }
194187 </ span >
195188 { section . sectionName }
196189 </ span >
197190 { diffCount > 0 && (
198- < span className = "text-xs text-yellow-400 " >
199- ( { diffCount } diff{ diffCount > 1 ? "s" : "" } )
191+ < span className = "text-accent-dim " >
192+ { diffCount } diff{ diffCount > 1 ? "s" : "" }
200193 </ span >
201194 ) }
202195 </ span >
@@ -209,12 +202,12 @@ function Section({
209202 key = { `${ section . sectionName } -${ row . key } ` }
210203 className = { clsx (
211204 "grid grid-cols-subgrid" ,
212- "hover:bg-gray-800 /50" ,
213- row . isDifferent ? "bg-gray-800/30" : " ",
205+ "hover:bg-elevated /50" ,
206+ row . isDifferent && "bg-diff-bg " ,
214207 ) }
215208 style = { { gridColumn : `span ${ colCount } ` } }
216209 >
217- < div className = "p-2 border border-gray-700 text-gray-300 whitespace-nowrap" >
210+ < div className = "p-2 border border-border text-text-secondary whitespace-nowrap" >
218211 { row . key }
219212 </ div >
220213 { ( ( ) => {
@@ -250,28 +243,28 @@ function Section({
250243 } )
251244 . replace ( "," , "." ) ;
252245
253- let cellColor = "text-gray-200 " ;
246+ let cellColor = "text-text-primary " ;
254247 let diffSpan : React . ReactNode = null ;
255248 const displayVal = ! isNaN ( numVal ) ? fmtVal ( numVal ) : val ;
256249
257250 if ( val === null ) {
258- cellColor = "text-gray-600 italic" ;
251+ cellColor = "text-text-muted italic" ;
259252 } else if ( i > 0 && row . isDifferent ) {
260253 if ( bothNumeric ) {
261254 if ( diff > 0 ) {
262255 diffSpan = (
263- < span className = "text-green-400 " >
256+ < span className = "text-diff-positive " >
264257 { " " }
265258 (+{ fmtDiff ( diff ) } { unit } )
266259 </ span >
267260 ) ;
268261 } else if ( diff < 0 ) {
269262 diffSpan = (
270- < span className = "text-red-400 " > ({ fmtDiff ( diff ) } { unit } )</ span >
263+ < span className = "text-diff-negative " > ({ fmtDiff ( diff ) } { unit } )</ span >
271264 ) ;
272265 }
273266 } else if ( String ( val ) !== String ( ref ) ) {
274- cellColor = "text-yellow-300 " ;
267+ cellColor = "text-accent " ;
275268 }
276269 }
277270
@@ -280,13 +273,13 @@ function Section({
280273 key = { i }
281274 data-col = { i }
282275 className = { clsx (
283- "p-2 border border-gray-700 whitespace-nowrap" ,
276+ "p-2 border border-border whitespace-nowrap" ,
284277 cellColor ,
285278 dragIndex !== null && dragIndex !== i && "opacity-50" ,
286279 ) }
287280 >
288281 { val === null ? (
289- "- "
282+ "\u2014 "
290283 ) : diffSpan ? (
291284 < span className = "flex justify-between gap-2" >
292285 < span > { displayVal } { unit } </ span >
0 commit comments