Skip to content

Commit e63b542

Browse files
authored
chore(issue-details): Update breadcrumb "view all button" (#86099)
updates button text to be aligned with activity expand button which mentions the # hidden. adds some logic so that if there are 6 or fewer breadcrumbs, we show them all, if more, we only show 5 and have the view more button
1 parent 1e4de79 commit e63b542

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

static/app/components/events/breadcrumbs/breadcrumbsDataSection.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export default function BreadcrumbsDataSection({
150150
);
151151

152152
const hasViewAll = summaryCrumbs.length !== enhancedCrumbs.length;
153+
const numHiddenCrumbs = enhancedCrumbs.length - summaryCrumbs.length;
153154

154155
return (
155156
<InterimSection
@@ -187,7 +188,7 @@ export default function BreadcrumbsDataSection({
187188
aria-label={t('View All Breadcrumbs')}
188189
ref={viewAllButtonRef}
189190
>
190-
{t('View All')}
191+
{t('View %s more', numHiddenCrumbs)}
191192
</ViewAllButton>
192193
</div>
193194
</ViewAllContainer>

static/app/components/events/breadcrumbs/utils.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ export function getSummaryBreadcrumbs(
6868
sort: BreadcrumbSort
6969
) {
7070
const sortedCrumbs = sort === BreadcrumbSort.OLDEST ? crumbs : crumbs.toReversed();
71-
return sortedCrumbs.slice(0, BREADCRUMB_SUMMARY_COUNT);
71+
return sortedCrumbs.slice(
72+
0,
73+
crumbs.length <= BREADCRUMB_SUMMARY_COUNT + 1
74+
? BREADCRUMB_SUMMARY_COUNT + 1
75+
: BREADCRUMB_SUMMARY_COUNT
76+
);
7277
}
7378

7479
export function getBreadcrumbTypeOptions(crumbs: EnhancedCrumb[]) {

0 commit comments

Comments
 (0)