@@ -17,8 +17,35 @@ interface MetricDisplayProps {
1717}
1818
1919const MetricDisplay : React . FC < MetricDisplayProps > = ( { metrics } ) => {
20+ const handleWheel = ( e : React . WheelEvent ) => {
21+ // Always prevent React Flow from handling wheel events in this area
22+ e . stopPropagation ( ) ;
23+
24+ // Let the browser handle the scrolling naturally
25+ // Don't prevent default - we want normal scroll behavior
26+ } ;
27+
28+ // Use compact styles when there are more than 7 metrics
29+ const isCompact = metrics . length > 7 ;
30+ const metricItemClass = isCompact ? styles . metricItemCompact : styles . metricItem ;
31+ const metricNameClass = isCompact ? styles . metricNameCompact : styles . metricName ;
32+ const metricValueClass = isCompact ? styles . metricValueCompact : styles . metricValue ;
33+
2034 return (
21- < Box className = { styles . nodeContent } >
35+ < Box
36+ className = { `${ styles . nodeContent } nopan nodrag` }
37+ onWheel = { handleWheel }
38+ sx = { {
39+ display : 'flex' ,
40+ flexDirection : 'column' ,
41+ flex : 1 ,
42+ minHeight : 0 , // Important for flex scrolling
43+ overflowY : 'auto !important' ,
44+ overflowX : 'hidden' ,
45+ height : '100%' ,
46+ maxHeight : '100%'
47+ } }
48+ >
2249 { metrics . map ( ( metric , index ) => (
2350 < ConditionalWrapper
2451 key = { `${ metric . name } -${ index } ` }
@@ -34,17 +61,17 @@ const MetricDisplay: React.FC<MetricDisplayProps> = ({ metrics }) => {
3461 }
3562 >
3663 < Box
37- className = { styles . metricItem }
64+ className = { metricItemClass }
3865 sx = {
3966 metric . showBlock
4067 ? { justifyContent : "center" , alignItems : "center" , flexDirection : "column" }
4168 : { display : "flex" , alignItems : "flex-start" , flexDirection : "row" }
4269 }
4370 >
44- < Typography className = { styles . metricName } variant = "body2" >
71+ < Typography className = { metricNameClass } variant = "body2" >
4572 { metric . name } :
4673 </ Typography >
47- < Typography className = { styles . metricValue } variant = "body2" >
74+ < Typography className = { metricValueClass } variant = "body2" >
4875 { metric . value }
4976 </ Typography >
5077 </ Box >
0 commit comments