Skip to content

Commit da614ab

Browse files
committed
Make feedback mechanisms clearer
1 parent 5e5538b commit da614ab

File tree

2 files changed

+39
-15
lines changed

2 files changed

+39
-15
lines changed

static/app/components/events/autofix/autofixHighlightWrapper.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ export function AutofixHighlightWrapper({
4747

4848
return (
4949
<React.Fragment>
50-
<Wrapper ref={containerRef} className={className} isSelected={!!selection}>
50+
<Wrapper
51+
ref={containerRef}
52+
className={className}
53+
isSelected={!!selection}
54+
title={selection ? undefined : 'Click to chat about this with Seer'}
55+
>
5156
{children}
5257
</Wrapper>
5358

@@ -76,10 +81,6 @@ const Wrapper = styled('div')<{isSelected: boolean}>`
7681
!p.isSelected &&
7782
css`
7883
cursor: pointer;
79-
80-
* {
81-
${p.theme.tooltipUnderline('gray200')};
82-
}
8384
`};
8485
}
8586
`;

static/app/components/events/autofix/autofixInsightCards.tsx

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {replaceHeadersWithBold} from 'sentry/components/events/autofix/autofixRo
1313
import type {AutofixInsight} from 'sentry/components/events/autofix/types';
1414
import {makeAutofixQueryKey} from 'sentry/components/events/autofix/useAutofix';
1515
import {useTypingAnimation} from 'sentry/components/events/autofix/useTypingAnimation';
16-
import {IconChevron, IconClose, IconRefresh} from 'sentry/icons';
16+
import {IconChevron, IconClose} from 'sentry/icons';
1717
import {t, tn} from 'sentry/locale';
1818
import {space} from 'sentry/styles/space';
1919
import {singleLineRenderer} from 'sentry/utils/marked/marked';
@@ -145,6 +145,8 @@ function AutofixInsightCard({
145145
if (e.key === 'Enter' && !e.shiftKey) {
146146
e.preventDefault();
147147
handleSubmit(e);
148+
} else if (e.key === 'Escape') {
149+
handleCancel();
148150
}
149151
}}
150152
/>
@@ -162,10 +164,10 @@ function AutofixInsightCard({
162164
type="submit"
163165
priority="primary"
164166
size="sm"
165-
title={t('Rethink the answer')}
166-
aria-label={t('Rethink the answer')}
167+
title={t('Restart work from here')}
168+
aria-label={t('Restart work from here')}
167169
>
168-
<IconRefresh size="sm" />
170+
{'\u23CE'}
169171
</Button>
170172
</ButtonBar>
171173
</EditFormRow>
@@ -208,7 +210,7 @@ function AutofixInsightCard({
208210
size="zero"
209211
borderless
210212
onClick={handleEdit}
211-
icon={<IconRefresh size="xs" />}
213+
icon={<FlippedReturnIcon />}
212214
aria-label={t('Edit insight')}
213215
title={t('Rethink the answer from here')}
214216
/>
@@ -372,6 +374,8 @@ function CollapsibleChainLink({
372374
if (e.key === 'Enter' && !e.shiftKey) {
373375
e.preventDefault();
374376
handleSubmit(e);
377+
} else if (e.key === 'Escape') {
378+
handleCancel();
375379
}
376380
}}
377381
/>
@@ -388,10 +392,10 @@ function CollapsibleChainLink({
388392
type="submit"
389393
priority="primary"
390394
size="sm"
391-
title={t('Rethink the answer')}
392-
aria-label={t('Rethink the answer')}
395+
title={t('Restart work from here')}
396+
aria-label={t('Restart work from here')}
393397
>
394-
<IconRefresh size="sm" />
398+
{'\u23CE'}
395399
</Button>
396400
</ButtonBar>
397401
</EditFormRow>
@@ -402,10 +406,12 @@ function CollapsibleChainLink({
402406
size="zero"
403407
borderless
404408
onClick={() => setIsAdding(true)}
405-
icon={<IconRefresh size="sm" />}
406409
title={t('Give feedback and rethink the answer')}
407410
aria-label={t('Give feedback and rethink the answer')}
408-
/>
411+
>
412+
<RethinkLabel>{t('Rethink this answer')}</RethinkLabel>
413+
<FlippedReturnIcon />
414+
</AddButton>
409415
))}
410416
</RethinkButtonContainer>
411417
</VerticalLineContainer>
@@ -819,4 +825,21 @@ const AddButton = styled(Button)`
819825
}
820826
`;
821827

828+
function FlippedReturnIcon(props: React.HTMLAttributes<HTMLSpanElement>) {
829+
return <CheckpointIcon {...props}>{'\u21A9'}</CheckpointIcon>;
830+
}
831+
822832
export default AutofixInsightCards;
833+
834+
const CheckpointIcon = styled('span')`
835+
transform: scaleY(-1);
836+
margin-bottom: ${space(0.5)};
837+
`;
838+
839+
const RethinkLabel = styled('span')`
840+
display: flex;
841+
align-items: center;
842+
font-size: ${p => p.theme.fontSizeSmall};
843+
color: ${p => p.theme.subText};
844+
margin-right: ${space(0.5)};
845+
`;

0 commit comments

Comments
 (0)