Skip to content

Commit 0c7970e

Browse files
authored
chore(autofix): Swap send icon from chevron to return symbol (#92240)
We were using `IconChevron` for both expandable sections and send buttons on text inputs, and we got feedback that it was confusing. Swapping the text inputs to use a return key Unicode icon since we don't have anything else appropriate within Sentry's icons. <img width="311" alt="Screenshot 2025-05-25 at 6 42 22 AM" src="https://github.com/user-attachments/assets/bdf440ad-7ac0-4011-87ea-1fa1e1413edc" /> Edit: tacking on some fixes to make the auto-scrolling and loading state less janky as well
1 parent 0812da1 commit 0c7970e

File tree

6 files changed

+57
-14
lines changed

6 files changed

+57
-14
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
useAutofixData,
2323
} from 'sentry/components/events/autofix/useAutofix';
2424
import LoadingIndicator from 'sentry/components/loadingIndicator';
25-
import {IconChevron, IconClose} from 'sentry/icons';
25+
import {IconClose} from 'sentry/icons';
2626
import {t} from 'sentry/locale';
2727
import {space} from 'sentry/styles/space';
2828
import testableTransition from 'sentry/utils/testableTransition';
@@ -355,7 +355,7 @@ function AutofixHighlightPopupContent({
355355
borderless
356356
aria-label={t('Submit Comment')}
357357
>
358-
<IconChevron direction="right" />
358+
{'\u23CE'}
359359
</StyledButton>
360360
</InputWrapper>
361361
)}
@@ -592,7 +592,7 @@ const StyledButton = styled(Button)`
592592
height: 24px;
593593
width: 24px;
594594
margin-right: 0;
595-
595+
color: ${p => p.theme.subText};
596596
z-index: 2;
597597
`;
598598

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@ function AutofixInsightCards({
403403
const [expandedCardIndex, setExpandedCardIndex] = useState<number | null>(null);
404404
const previousInsightsRef = useRef<AutofixInsight[]>([]);
405405
const [newInsightIndices, setNewInsightIndices] = useState<number[]>([]);
406+
const hasMounted = useRef(false);
407+
408+
useEffect(() => {
409+
hasMounted.current = true;
410+
}, []);
406411

407412
// Compare current insights with previous insights to determine which ones are new
408413
useEffect(() => {
@@ -447,7 +452,7 @@ function AutofixInsightCards({
447452
runId={runId}
448453
/>
449454
)}
450-
<AnimatePresence>
455+
<AnimatePresence initial={hasMounted.current}>
451456
{!isCollapsed && (
452457
<motion.div
453458
initial={{height: 0, opacity: 0}}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {FlyingLinesEffect} from 'sentry/components/events/autofix/FlyingLinesEff
1313
import type {AutofixData} 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} from 'sentry/icons';
1716
import {t} from 'sentry/locale';
1817
import {space} from 'sentry/styles/space';
1918
import {singleLineRenderer} from 'sentry/utils/marked/marked';
@@ -244,7 +243,7 @@ export function AutofixOutputStream({
244243
aria-label={t('Submit Comment')}
245244
size="zero"
246245
>
247-
<IconChevron direction="right" />
246+
{'\u23CE'}
248247
</StyledButton>
249248
</InputWrapper>
250249
</Container>
@@ -365,6 +364,7 @@ const StyledButton = styled(Button)`
365364
height: 24px;
366365
width: 24px;
367366
margin-right: 0;
367+
color: ${p => p.theme.subText};
368368
`;
369369

370370
const SeerIconContainer = styled('div')`

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export const useAiAutofix = (
185185
const [currentRunId, setCurrentRunId] = useState<string | null>(null);
186186
const [waitingForNextRun, setWaitingForNextRun] = useState<boolean>(false);
187187

188-
const {data: apiData} = useApiQuery<AutofixResponse>(
188+
const {data: apiData, isPending} = useApiQuery<AutofixResponse>(
189189
makeAutofixQueryKey(orgSlug, group.id),
190190
{
191191
staleTime: 0,
@@ -267,6 +267,7 @@ export const useAiAutofix = (
267267
return {
268268
autofixData,
269269
isPolling: isPolling(autofixData, !!currentRunId || waitingForNextRun),
270+
isPending,
270271
triggerAutofix,
271272
reset,
272273
};

static/app/components/group/groupSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function GroupSummaryFull({
305305
</CardLineDecorationWrapper>
306306
{isPending ? (
307307
<CardContent>
308-
<Placeholder height="1.5rem" />
308+
<Placeholder height="3rem" />
309309
</CardContent>
310310
) : (
311311
<CardContent>

static/app/views/issueDetails/streamline/sidebar/seerDrawer.tsx

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {GroupSummary} from 'sentry/components/group/groupSummary';
2222
import HookOrDefault from 'sentry/components/hookOrDefault';
2323
import ExternalLink from 'sentry/components/links/externalLink';
2424
import Link from 'sentry/components/links/link';
25-
import LoadingIndicator from 'sentry/components/loadingIndicator';
25+
import Placeholder from 'sentry/components/placeholder';
2626
import QuestionTooltip from 'sentry/components/questionTooltip';
2727
import {IconSettings} from 'sentry/icons';
2828
import {t, tct} from 'sentry/locale';
@@ -52,15 +52,20 @@ const AiSetupDataConsent = HookOrDefault({
5252

5353
export function SeerDrawer({group, project, event}: SeerDrawerProps) {
5454
const organization = useOrganization();
55-
const {autofixData, triggerAutofix, reset} = useAiAutofix(group, event);
55+
const {
56+
autofixData,
57+
triggerAutofix,
58+
reset,
59+
isPending: autofixDataPending,
60+
} = useAiAutofix(group, event);
5661
const aiConfig = useAiConfig(group, project);
5762
const location = useLocation();
5863
const navigate = useNavigate();
5964

6065
useRouteAnalyticsParams({autofix_status: autofixData?.status ?? 'none'});
6166

6267
const scrollContainerRef = useRef<HTMLDivElement>(null);
63-
const userScrolledRef = useRef(false);
68+
const userScrolledRef = useRef(true);
6469
const lastScrollTopRef = useRef(0);
6570
const autofixDataRef = useRef(autofixData);
6671

@@ -137,6 +142,24 @@ export function SeerDrawer({group, project, event}: SeerDrawerProps) {
137142
);
138143
}, 200);
139144
}
145+
} else {
146+
// No matching step found, scroll to bottom
147+
scrollContainerRef.current.scrollTop = scrollContainerRef.current.scrollHeight;
148+
userScrolledRef.current = true;
149+
150+
// Clear the scrollTo parameter from the URL after scrolling
151+
setTimeout(() => {
152+
navigate(
153+
{
154+
pathname: location.pathname,
155+
query: {
156+
...location.query,
157+
scrollTo: undefined,
158+
},
159+
},
160+
{replace: true}
161+
);
162+
}, 200);
140163
}
141164
}
142165
},
@@ -264,9 +287,11 @@ export function SeerDrawer({group, project, event}: SeerDrawerProps) {
264287

265288
<SeerDrawerBody ref={scrollContainerRef} onScroll={handleScroll}>
266289
{aiConfig.isAutofixSetupLoading ? (
267-
<div data-test-id="ai-setup-loading-indicator">
268-
<LoadingIndicator />
269-
</div>
290+
<PlaceholderStack data-test-id="ai-setup-loading-indicator">
291+
<Placeholder height="10rem" />
292+
<Placeholder height="15rem" />
293+
<Placeholder height="15rem" />
294+
</PlaceholderStack>
270295
) : aiConfig.needsGenAiAcknowledgement ? (
271296
<AiSetupDataConsent groupId={group.id} />
272297
) : (
@@ -289,6 +314,11 @@ export function SeerDrawer({group, project, event}: SeerDrawerProps) {
289314
groupId={group.id}
290315
runId={autofixData.run_id}
291316
/>
317+
) : autofixDataPending ? (
318+
<PlaceholderStack>
319+
<Placeholder height="15rem" />
320+
<Placeholder height="15rem" />
321+
</PlaceholderStack>
292322
) : (
293323
<AutofixStartBox onSend={triggerAutofix} groupId={group.id} />
294324
)}
@@ -350,6 +380,13 @@ export const useOpenSeerDrawer = ({
350380
return {openSeerDrawer};
351381
};
352382

383+
const PlaceholderStack = styled('div')`
384+
display: flex;
385+
flex-direction: column;
386+
gap: ${space(2)};
387+
margin-top: ${space(2)};
388+
`;
389+
353390
const StyledCard = styled('div')`
354391
background: ${p => p.theme.backgroundElevated};
355392
overflow: visible;

0 commit comments

Comments
 (0)