Skip to content

Commit 9fb9a1b

Browse files
authored
fix(issues): Show 50+ Replays whenever the count is maxed out like that (#80809)
The replayCount is only accurate for a small number of replays. So the backend will max-out when it finds there are 51 replays in the list. The frontend is therefore responsible for rendering `"50+"` when it sees a count of `51`. This PR updates a few spots related to Issue Details so that we render `50+` instead of `51`. <img width="943" alt="SCR-20241115-msqp" src="https://github.com/user-attachments/assets/b6919cf4-8e92-4f25-931c-07a9d23873df"> <img width="297" alt="SCR-20241115-msrj" src="https://github.com/user-attachments/assets/4581ac6d-b0bf-4ed9-8766-9f09b2e3a056">
1 parent bcfbe8a commit 9fb9a1b

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

static/app/components/events/eventReplay/replayClipSection.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ export function ReplayClipSection({event, group, replayId}: Props) {
6565
replayCount && replayCount > 1 ? (
6666
<Fragment>
6767
<div>
68-
{t(
69-
'There are %s for this issue.',
70-
tn('%s replay', '%s replays', replayCount ?? 0)
71-
)}
68+
{replayCount > 50
69+
? t('There are 50+ replays fro this issue.')
70+
: tn(
71+
'There is %s replay for this issue.',
72+
'there are %s replays for this issue.',
73+
replayCount ?? 0
74+
)}
7275
</div>
7376
{allReplaysButton}
7477
</Fragment>

static/app/views/issueDetails/groupReplays/groupReplays.tsx

+11-5
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,17 @@ function GroupReplaysTable({
271271
<StyledLayoutPage withPadding hasStreamlinedUI={hasStreamlinedUI}>
272272
<ReplayCountHeader>
273273
<IconUser size="sm" />
274-
{t(
275-
'There %s for this issue across %s.',
276-
tn('is %s replay', 'are %s replays', replayCount ?? 0),
277-
tn('%s event', '%s events', group.count)
278-
)}
274+
{replayCount ?? 0 > 50
275+
? tn(
276+
'There are 50+ replays for this issue across %s event',
277+
'There are 50+ replays for this issue across %s events',
278+
group.count
279+
)
280+
: t(
281+
'There %s for this issue across %s.',
282+
tn('is %s replay', 'are %s replays', replayCount ?? 0),
283+
tn('%s event', '%s events', group.count)
284+
)}
279285
</ReplayCountHeader>
280286
{inner}
281287
</StyledLayoutPage>

static/app/views/issueDetails/streamline/eventNavigation.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ export function IssueEventNavigation({event, group, query}: IssueEventNavigation
220220
key: Tab.REPLAYS,
221221
label: (
222222
<DropdownCountWrapper isCurrentTab={currentTab === Tab.REPLAYS}>
223-
{TabName[Tab.REPLAYS]} <ItemCount value={replaysCount} />
223+
{TabName[Tab.REPLAYS]}{' '}
224+
{replaysCount > 50 ? (
225+
<CustomItemCount>50+</CustomItemCount>
226+
) : (
227+
<ItemCount value={replaysCount} />
228+
)}
224229
</DropdownCountWrapper>
225230
),
226231
textValue: TabName[Tab.REPLAYS],

static/app/views/issueDetails/streamline/replayBadge.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export function ReplayBadge({group, project}: {group: Group; project: Project})
4141
}}
4242
aria-label={t("View this issue's replays")}
4343
>
44-
{tn('%s Replay', '%s Replays', replaysCount)}
44+
{replaysCount > 50
45+
? t('50+ Replays')
46+
: tn('%s Replay', '%s Replays', replaysCount)}
4547
</ReplayButton>
4648
</Fragment>
4749
);

0 commit comments

Comments
 (0)