From c8818e62fe80b3d1f3e1bb2a7acab4b083afcf64 Mon Sep 17 00:00:00 2001 From: Rohan Agarwal Date: Fri, 16 May 2025 14:53:47 -0700 Subject: [PATCH 1/3] More obvious re-summarize button on summary in drawer --- static/app/components/group/groupSummary.tsx | 104 ++++--------------- 1 file changed, 19 insertions(+), 85 deletions(-) diff --git a/static/app/components/group/groupSummary.tsx b/static/app/components/group/groupSummary.tsx index 65f4274d5d14a0..30f5a8d308f0cc 100644 --- a/static/app/components/group/groupSummary.tsx +++ b/static/app/components/group/groupSummary.tsx @@ -1,10 +1,10 @@ import {isValidElement, useEffect, useState} from 'react'; import styled from '@emotion/styled'; -import {DropdownMenu} from 'sentry/components/dropdownMenu'; +import {Button} from 'sentry/components/core/button'; import {makeAutofixQueryKey} from 'sentry/components/events/autofix/useAutofix'; import Placeholder from 'sentry/components/placeholder'; -import {IconDocs, IconEllipsis, IconFatal, IconFocus, IconSpan} from 'sentry/icons'; +import {IconDocs, IconFatal, IconFocus, IconRefresh, IconSpan} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Event} from 'sentry/types/event'; @@ -13,8 +13,6 @@ import type {Project} from 'sentry/types/project'; import {getConfigForIssueType} from 'sentry/utils/issueTypeConfig'; import {MarkedText} from 'sentry/utils/marked/markedText'; import {type ApiQueryKey, useApiQuery, useQueryClient} from 'sentry/utils/queryClient'; -import normalizeUrl from 'sentry/utils/url/normalizeUrl'; -import {useFeedbackForm} from 'sentry/utils/useFeedbackForm'; import useOrganization from 'sentry/utils/useOrganization'; import {useAiConfig} from 'sentry/views/issueDetails/streamline/hooks/useAiConfig'; @@ -119,7 +117,6 @@ export function GroupSummary({ const queryClient = useQueryClient(); const organization = useOrganization(); const [forceEvent, setForceEvent] = useState(false); - const openFeedbackForm = useFeedbackForm(); const aiConfig = useAiConfig(group, project); const {data, isPending, isError, refresh} = useGroupSummary( group, @@ -153,53 +150,6 @@ export function GroupSummary({ organization.slug, ]); - const eventDetailsItems = [ - { - key: 'event-info', - label: - event?.id === data?.eventId ? ( - t('Based on this event') - ) : ( - {t('See original event (%s)', data?.eventId?.substring(0, 8))} - ), - to: - event?.id === data?.eventId - ? undefined - : window.location.origin + - normalizeUrl( - `/organizations/${organization.slug}/issues/${data?.groupId}/events/${data?.eventId}/` - ), - disabled: event?.id === data?.eventId, - }, - ...(event?.id === data?.eventId - ? [] - : [ - { - key: 'refresh', - label: t('Summarize this event instead'), - onAction: () => setForceEvent(true), - disabled: isPending, - }, - ]), - ...(openFeedbackForm - ? [ - { - key: 'feedback', - label: t('Give feedback'), - onAction: () => { - openFeedbackForm({ - messagePlaceholder: t('How can we make Issue Summary better for you?'), - tags: { - ['feedback.source']: 'issue_details_ai_autofix', - ['feedback.owner']: 'ml-ai', - }, - }); - }, - }, - ] - : []), - ]; - const shouldShowPossibleCause = !data?.scores || (data.scores.possibleCauseConfidence && @@ -254,26 +204,6 @@ export function GroupSummary({
{isError ?
{t('Error loading summary')}
: null} - {data?.eventId && !isPending && !preview && ( - - , - 'aria-label': t('Event details'), - size: 'xs', - borderless: true, - showChevron: false, - style: { - zIndex: 0, - }, - }} - isDisabled={isPending} - position="bottom-end" - offset={4} - /> - - )} {insightCards.map(card => { if ((!isPending && !card.insight) || (isPending && !card.showWhenLoading)) { @@ -309,6 +239,18 @@ export function GroupSummary({ ); })} + {data?.eventId && !isPending && !preview && event?.id !== data?.eventId && ( + + + + )}
); @@ -395,17 +337,9 @@ const CardContent = styled('div')` flex: 1; `; -const TooltipWrapper = styled('div')` - position: absolute; - top: -${space(1)}; - right: 0; - - ul { - max-height: none !important; - overflow: visible !important; - } -`; - -const StyledIconEllipsis = styled(IconEllipsis)` - color: ${p => p.theme.subText}; +const ResummarizeWrapper = styled('div')` + display: flex; + align-items: center; + margin-top: ${space(1)}; + flex-shrink: 0; `; From ca8bcf50e8d1cd7619e4b4f3de44aba0a6dcb36e Mon Sep 17 00:00:00 2001 From: Rohan Agarwal Date: Fri, 16 May 2025 15:06:21 -0700 Subject: [PATCH 2/3] pr feedback --- static/app/components/group/groupSummary.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/static/app/components/group/groupSummary.tsx b/static/app/components/group/groupSummary.tsx index 30f5a8d308f0cc..0a1ce4411c3a56 100644 --- a/static/app/components/group/groupSummary.tsx +++ b/static/app/components/group/groupSummary.tsx @@ -2,6 +2,7 @@ import {isValidElement, useEffect, useState} from 'react'; import styled from '@emotion/styled'; import {Button} from 'sentry/components/core/button'; +import {LinkButton} from 'sentry/components/core/button/linkButton'; import {makeAutofixQueryKey} from 'sentry/components/events/autofix/useAutofix'; import Placeholder from 'sentry/components/placeholder'; import {IconDocs, IconFatal, IconFocus, IconRefresh, IconSpan} from 'sentry/icons'; @@ -247,8 +248,15 @@ export function GroupSummary({ size="xs" icon={} > - {t('Re-summarize this event')} + {t('Summarize current event')} + + {t('View original event')} + )} @@ -343,3 +351,7 @@ const ResummarizeWrapper = styled('div')` margin-top: ${space(1)}; flex-shrink: 0; `; + +const OriginalEventLink = styled(LinkButton)` + margin-left: ${space(1)}; +`; From 8dc70693f679bd74c6609038d1d3427d2aacb22f Mon Sep 17 00:00:00 2001 From: Rohan Agarwal Date: Fri, 16 May 2025 15:39:24 -0700 Subject: [PATCH 3/3] Remove original event link --- static/app/components/group/groupSummary.tsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/static/app/components/group/groupSummary.tsx b/static/app/components/group/groupSummary.tsx index 0a1ce4411c3a56..612b5ccfb88459 100644 --- a/static/app/components/group/groupSummary.tsx +++ b/static/app/components/group/groupSummary.tsx @@ -2,7 +2,6 @@ import {isValidElement, useEffect, useState} from 'react'; import styled from '@emotion/styled'; import {Button} from 'sentry/components/core/button'; -import {LinkButton} from 'sentry/components/core/button/linkButton'; import {makeAutofixQueryKey} from 'sentry/components/events/autofix/useAutofix'; import Placeholder from 'sentry/components/placeholder'; import {IconDocs, IconFatal, IconFocus, IconRefresh, IconSpan} from 'sentry/icons'; @@ -250,13 +249,6 @@ export function GroupSummary({ > {t('Summarize current event')} - - {t('View original event')} - )} @@ -351,7 +343,3 @@ const ResummarizeWrapper = styled('div')` margin-top: ${space(1)}; flex-shrink: 0; `; - -const OriginalEventLink = styled(LinkButton)` - margin-left: ${space(1)}; -`;