Skip to content

Commit 91cf1df

Browse files
authored
Merge pull request #1042 from rasmi/auto-filter
Only apply 'in progress' filter by default if there are participants in progress.
2 parents 08d138d + e265760 commit 91cf1df

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

frontend/src/services/experiment.manager.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import {
7676
} from '../shared/file.utils';
7777
import {
7878
isObsoleteParticipant,
79+
matchesStatusFilter,
7980
ParticipantSortOption,
8081
ParticipantStatusFilter,
8182
requiresAnonymousProfiles,
@@ -601,12 +602,16 @@ export class ExperimentManager extends Service {
601602
});
602603

603604
// On initial load, default to "in progress" filter if there are
604-
// many participants to avoid slow rendering.
605+
// many participants to avoid slow rendering, but only if some
606+
// participants are actually in progress (skip for finished experiments).
605607
if (
606608
this.isParticipantsLoading &&
607609
Object.keys(this.participantMap).length >
608610
ExperimentManager.AUTO_FILTER_PARTICIPANT_THRESHOLD &&
609-
this.participantStatusFilters.size === 0
611+
this.participantStatusFilters.size === 0 &&
612+
Object.values(this.participantMap).some((p) =>
613+
matchesStatusFilter(p, 'inProgress'),
614+
)
610615
) {
611616
this.participantStatusFilters = new Set<ParticipantStatusFilter>([
612617
'inProgress',

0 commit comments

Comments
 (0)