@@ -451,9 +451,11 @@ const SignalPopover: React.FunctionComponent<SignalPopoverProps> = ({
451451 const [ hoverProps , isHovered , setHovered ] = useHoverState ( ) ;
452452 const [ currentSignalIndex , setCurrentSignalIndex ] = useState ( 0 ) ;
453453 const signals = Array . isArray ( _signals ) ? _signals : [ _signals ] ;
454+
454455 const currentSignal = signals [ currentSignalIndex ] ;
455456 const multiSignals = signals . length > 1 ;
456457 const isActive = isHovered || popoverOpen ;
458+ const shouldShowFullBadge = isActive || shouldExpandBadge ;
457459
458460 const triggerRef = useRef < HTMLButtonElement > ( null ) ;
459461
@@ -590,8 +592,7 @@ const SignalPopover: React.FunctionComponent<SignalPopoverProps> = ({
590592 className
591593 ) ,
592594 style : {
593- width :
594- isActive || shouldExpandBadge ? activeBadgeWidth : 18 ,
595+ width : shouldShowFullBadge ? activeBadgeWidth : 18 ,
595596 } ,
596597 ref : triggerRef ,
597598 } ,
@@ -609,7 +610,8 @@ const SignalPopover: React.FunctionComponent<SignalPopoverProps> = ({
609610 glyph = "Bulb"
610611 size = "small"
611612 className = { cx ( badgeIconStyles , badgeIconCollapsedStyles ) }
612- style = { { opacity : isActive ? 0 : 1 } }
613+ data-testid = "insight-badge-icon"
614+ style = { { opacity : shouldShowFullBadge ? 0 : 1 } }
613615 > </ Icon >
614616 < strong
615617 className = { cx (
@@ -619,7 +621,7 @@ const SignalPopover: React.FunctionComponent<SignalPopoverProps> = ({
619621 data-testid = "insight-badge-text"
620622 style = { {
621623 width : activeBadgeWidth ,
622- opacity : isActive || shouldExpandBadge ? 1 : 0 ,
624+ opacity : shouldShowFullBadge ? 1 : 0 ,
623625 } }
624626 >
625627 { badgeLabel }
0 commit comments