-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
ref(nav) use topbar slot for feedback button #112443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ef655ae
b6140f2
3446474
7d577ab
617ff8f
c53a5c8
d601b5a
fdf5f78
7d54af5
59185a6
8461e0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,8 @@ import {trackAnalytics} from 'sentry/utils/analytics'; | |
| import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls'; | ||
| import {useLocation} from 'sentry/utils/useLocation'; | ||
| import {useOrganization} from 'sentry/utils/useOrganization'; | ||
| import {TopBar} from 'sentry/views/navigation/topBar'; | ||
| import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature'; | ||
|
|
||
| interface ContinuousProfileHeader { | ||
| transaction: Event | null; | ||
|
|
@@ -21,6 +23,7 @@ interface ContinuousProfileHeader { | |
| export function ContinuousProfileHeader({transaction}: ContinuousProfileHeader) { | ||
| const location = useLocation(); | ||
| const organization = useOrganization(); | ||
| const hasPageFrameFeature = useHasPageFrameFeature(); | ||
|
|
||
| // @TODO add breadcrumbs when other views are implemented | ||
| const breadCrumbs = useMemo((): ProfilingBreadcrumbsProps['trails'] => { | ||
|
|
@@ -51,7 +54,13 @@ export function ContinuousProfileHeader({transaction}: ContinuousProfileHeader) | |
| </SmallerProfilingBreadcrumbsWrapper> | ||
| </SmallerHeaderContent> | ||
| <StyledHeaderActions> | ||
| <FeedbackButton /> | ||
| {hasPageFrameFeature ? ( | ||
| <TopBar.Slot name="feedback"> | ||
| <FeedbackButton>{null}</FeedbackButton> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we need it. If you check <FeedbackButton, it checks for props.children === undefined and initializes a default label otherwise 😢 |
||
| </TopBar.Slot> | ||
| ) : ( | ||
| <FeedbackButton /> | ||
| )} | ||
| {transactionTarget && ( | ||
| <LinkButton size="sm" onClick={handleGoToTransaction} to={transactionTarget}> | ||
| {t('Go to Trace')} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,8 @@ import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls'; | |
| import {isSchema, isSentrySampledProfile} from 'sentry/utils/profiling/guards/profile'; | ||
| import {useLocation} from 'sentry/utils/useLocation'; | ||
| import {useOrganization} from 'sentry/utils/useOrganization'; | ||
| import {TopBar} from 'sentry/views/navigation/topBar'; | ||
| import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature'; | ||
| import {useProfiles} from 'sentry/views/profiling/profilesProvider'; | ||
|
|
||
| function getTransactionName(input: Profiling.ProfileInput): string { | ||
|
|
@@ -36,6 +38,7 @@ function ProfileHeader({transaction, projectId, eventId}: ProfileHeaderProps) { | |
| const location = useLocation(); | ||
| const organization = useOrganization(); | ||
| const profiles = useProfiles(); | ||
| const hasPageFrameFeature = useHasPageFrameFeature(); | ||
|
|
||
| const transactionName = | ||
| profiles.type === 'resolved' ? getTransactionName(profiles.data) : ''; | ||
|
|
@@ -89,7 +92,13 @@ function ProfileHeader({transaction, projectId, eventId}: ProfileHeaderProps) { | |
| </SmallerProfilingBreadcrumbsWrapper> | ||
| </SmallerHeaderContent> | ||
| <StyledHeaderActions> | ||
| <FeedbackButton /> | ||
| {hasPageFrameFeature ? ( | ||
| <TopBar.Slot name="feedback"> | ||
| <FeedbackButton>{null}</FeedbackButton> | ||
| </TopBar.Slot> | ||
| ) : ( | ||
| <FeedbackButton /> | ||
|
Comment on lines
+95
to
+100
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The Suggested FixAdd Prompt for AI Agent |
||
| )} | ||
| {transactionTarget && ( | ||
| <LinkButton size="sm" onClick={handleGoToTransaction} to={transactionTarget}> | ||
| {t('Go to Trace')} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: When
hasPageFrameFeatureis true, theFeedbackButtonis rendered as an icon-only button without anaria-label, making it inaccessible to screen reader users.Severity: MEDIUM
Suggested Fix
In all 10 modified files, add an
aria-labelto theFeedbackButtoncomponent when it is rendered as an icon-only button. For example:<FeedbackButton aria-label={t('Give Feedback')}>.... This will provide an accessible name for screen readers, matching the pattern already used for the fallback button intopBar.tsx.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.