From 6c50a920ba4dbb90cc7c865f45bb00edf21bbda6 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Mon, 17 Nov 2025 11:53:14 -0500 Subject: [PATCH] ref(issues): Clarify markdown copy button label and show line count Changes the button text from "Copy to Clipboard" to "Copy as Markdown" to make it clearer what format is being copied. Adds a tooltip showing the number of lines that will be copied, helping users understand the amount of content being copied. --- .../issueDetails/streamline/eventTitle.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/static/app/views/issueDetails/streamline/eventTitle.tsx b/static/app/views/issueDetails/streamline/eventTitle.tsx index 7185748a622328..e35ce434a4095e 100644 --- a/static/app/views/issueDetails/streamline/eventTitle.tsx +++ b/static/app/views/issueDetails/streamline/eventTitle.tsx @@ -10,7 +10,7 @@ import {useActionableItemsWithProguardErrors} from 'sentry/components/events/int import {useGroupSummaryData} from 'sentry/components/group/groupSummary'; import TimeSince from 'sentry/components/timeSince'; import {IconCopy, IconWarning} from 'sentry/icons'; -import {t} from 'sentry/locale'; +import {t, tct} from 'sentry/locale'; import type {Event} from 'sentry/types/event'; import type {Group} from 'sentry/types/group'; import {trackAnalytics} from 'sentry/utils/analytics'; @@ -53,6 +53,7 @@ function GroupMarkdownButton({group, event}: {event: Event; group: Group}) { const markdownText = useMemo(() => { return issueAndEventToMarkdown(group, event, groupSummaryData, autofixData); }, [group, event, groupSummaryData, autofixData]); + const markdownLines = markdownText.trim().split('\n').length.toLocaleString(); const {copy} = useCopyToClipboard(); @@ -79,7 +80,15 @@ function GroupMarkdownButton({group, event}: {event: Event; group: Group}) { ]); return ( - {t('Copy to Clipboard')} + {markdownLines}, + })} + priority="link" + onClick={handleCopyMarkdown} + > + {t('Copy as Markdown')} + ); } @@ -250,14 +259,12 @@ const JsonLink = styled(ExternalLink)` } `; -const MarkdownButton = styled('button')` - background: none; - border: none; - padding: 0; +const MarkdownButton = styled(Button)` color: ${p => p.theme.subText}; text-decoration: underline; text-decoration-color: ${p => Color(p.theme.gray300).alpha(0.5).string()}; font-size: inherit; + font-weight: normal; cursor: pointer; white-space: nowrap;