@@ -11,6 +11,7 @@ import {Alert} from 'sentry/components/core/alert';
1111import { Button } from 'sentry/components/core/button' ;
1212import { ButtonBar } from 'sentry/components/core/button/buttonBar' ;
1313import { Input } from 'sentry/components/core/input' ;
14+ import { Tooltip } from 'sentry/components/core/tooltip' ;
1415import { AutofixHighlightWrapper } from 'sentry/components/events/autofix/autofixHighlightWrapper' ;
1516import AutofixThumbsUpDownButtons from 'sentry/components/events/autofix/autofixThumbsUpDownButtons' ;
1617import {
@@ -301,25 +302,33 @@ function SolutionEventList({
301302 />
302303 ) }
303304 < SelectionButtonWrapper >
304- < SelectionButton
305- onClick = { e => {
306- e . stopPropagation ( ) ;
307- if ( isHumanAction ) {
308- onDeleteItem ( index ) ;
309- } else {
310- handleToggleActive ( index ) ;
311- }
312- } }
313- aria-label = { isSelected ? t ( 'Deselect item' ) : t ( 'Select item' ) }
305+ < Tooltip
306+ title = { isSelected ? t ( 'Remove from plan' ) : t ( 'Add to plan' ) }
307+ disabled = { isHumanAction }
314308 >
315- { isHumanAction ? (
316- < IconDelete size = "xs" color = "red400" />
317- ) : isSelected ? (
318- < IconClose size = "xs" color = "red400" />
319- ) : (
320- < IconAdd size = "xs" color = "green400" />
321- ) }
322- </ SelectionButton >
309+ < SelectionButton
310+ onClick = { e => {
311+ e . stopPropagation ( ) ;
312+ if ( isHumanAction ) {
313+ onDeleteItem ( index ) ;
314+ } else {
315+ handleToggleActive ( index ) ;
316+ }
317+ } }
318+ aria-label = { isSelected ? t ( 'Remove from plan' ) : t ( 'Add to plan' ) }
319+ actionType = {
320+ isHumanAction ? 'delete' : isSelected ? 'close' : 'add'
321+ }
322+ >
323+ { isHumanAction ? (
324+ < IconDelete size = "xs" />
325+ ) : isSelected ? (
326+ < IconClose size = "xs" />
327+ ) : (
328+ < IconAdd size = "xs" />
329+ ) }
330+ </ SelectionButton >
331+ </ Tooltip >
323332 </ SelectionButtonWrapper >
324333 </ IconWrapper >
325334 </ StyledTimelineHeader >
@@ -792,60 +801,51 @@ const StyledTimelineHeader = styled('div')<{isSelected: boolean; isActive?: bool
792801` ;
793802
794803const IconWrapper = styled ( 'div' ) `
795- position: relative;
796804 display: flex;
797805 align-items: center;
798806 justify-content: center;
799807 flex-shrink: 0;
808+ gap: ${ space ( 1 ) } ;
800809` ;
801810
802811const SelectionButtonWrapper = styled ( 'div' ) `
803- position: absolute;
804812 background: none;
805813 border: none;
806814 display: flex;
807815 align-items: center;
808- justify-content: flex-end ;
816+ justify-content: center ;
809817 height: 100%;
810- right: 0;
811818` ;
812819
813- const SelectionButton = styled ( 'button' ) `
820+ type SelectionButtonProps = React . ButtonHTMLAttributes < HTMLButtonElement > & {
821+ actionType : 'delete' | 'close' | 'add' ;
822+ } ;
823+
824+ const SelectionButton = styled ( 'button' ) < SelectionButtonProps > `
814825 background: none;
815826 border: none;
816827 display: flex;
817828 align-items: center;
818829 justify-content: center;
819830 cursor: pointer;
820831 color: ${ p => p . theme . subText } ;
821- opacity: 0;
822832 transition:
823- opacity 0.2s ease,
824833 color 0.2s ease,
825834 background-color 0.2s ease;
826835 border-radius: 5px;
827836 padding: 4px;
828837
829- ${ StyledTimelineHeader } :hover & {
830- opacity: 1;
831- }
832-
833838 &:hover {
834- color: ${ p => p . theme . gray500 } ;
835- background-color: ${ p => p . theme . background } ;
839+ color: ${ p =>
840+ p . actionType === 'delete' || p . actionType === 'close'
841+ ? p . theme . red400
842+ : p . theme . green400 } ;
836843 }
837844` ;
838845
839846const StyledIconChevron = styled ( IconChevron ) `
840847 color: ${ p => p . theme . subText } ;
841848 flex-shrink: 0;
842- opacity: 1;
843- transition: opacity 0.2s ease;
844- margin-right: ${ space ( 0.25 ) } ;
845-
846- ${ StyledTimelineHeader } :hover & {
847- opacity: 0;
848- }
849849` ;
850850
851851const InstructionsInputWrapper = styled ( 'form' ) `
0 commit comments