@@ -11,6 +11,7 @@ import {Alert} from 'sentry/components/core/alert';
11
11
import { Button } from 'sentry/components/core/button' ;
12
12
import { ButtonBar } from 'sentry/components/core/button/buttonBar' ;
13
13
import { Input } from 'sentry/components/core/input' ;
14
+ import { Tooltip } from 'sentry/components/core/tooltip' ;
14
15
import { AutofixHighlightWrapper } from 'sentry/components/events/autofix/autofixHighlightWrapper' ;
15
16
import AutofixThumbsUpDownButtons from 'sentry/components/events/autofix/autofixThumbsUpDownButtons' ;
16
17
import {
@@ -301,25 +302,33 @@ function SolutionEventList({
301
302
/>
302
303
) }
303
304
< 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 }
314
308
>
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 >
323
332
</ SelectionButtonWrapper >
324
333
</ IconWrapper >
325
334
</ StyledTimelineHeader >
@@ -792,60 +801,51 @@ const StyledTimelineHeader = styled('div')<{isSelected: boolean; isActive?: bool
792
801
` ;
793
802
794
803
const IconWrapper = styled ( 'div' ) `
795
- position: relative;
796
804
display: flex;
797
805
align-items: center;
798
806
justify-content: center;
799
807
flex-shrink: 0;
808
+ gap: ${ space ( 1 ) } ;
800
809
` ;
801
810
802
811
const SelectionButtonWrapper = styled ( 'div' ) `
803
- position: absolute;
804
812
background: none;
805
813
border: none;
806
814
display: flex;
807
815
align-items: center;
808
- justify-content: flex-end ;
816
+ justify-content: center ;
809
817
height: 100%;
810
- right: 0;
811
818
` ;
812
819
813
- const SelectionButton = styled ( 'button' ) `
820
+ type SelectionButtonProps = React . ButtonHTMLAttributes < HTMLButtonElement > & {
821
+ actionType : 'delete' | 'close' | 'add' ;
822
+ } ;
823
+
824
+ const SelectionButton = styled ( 'button' ) < SelectionButtonProps > `
814
825
background: none;
815
826
border: none;
816
827
display: flex;
817
828
align-items: center;
818
829
justify-content: center;
819
830
cursor: pointer;
820
831
color: ${ p => p . theme . subText } ;
821
- opacity: 0;
822
832
transition:
823
- opacity 0.2s ease,
824
833
color 0.2s ease,
825
834
background-color 0.2s ease;
826
835
border-radius: 5px;
827
836
padding: 4px;
828
837
829
- ${ StyledTimelineHeader } :hover & {
830
- opacity: 1;
831
- }
832
-
833
838
&: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 } ;
836
843
}
837
844
` ;
838
845
839
846
const StyledIconChevron = styled ( IconChevron ) `
840
847
color: ${ p => p . theme . subText } ;
841
848
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
- }
849
849
` ;
850
850
851
851
const InstructionsInputWrapper = styled ( 'form' ) `
0 commit comments