-
Notifications
You must be signed in to change notification settings - Fork 229
Add lazy participant auto-timeouts #1443
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
Open
ZachCutler04
wants to merge
1
commit into
zc/timedOut
Choose a base branch
from
zc/autoTimeout
base: zc/timedOut
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
366 changes: 256 additions & 110 deletions
366
src/analysis/individualStudy/LiveMonitor/LiveMonitorView.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ type StageParticipantStatusCounts = Record<string, { completed: number; inProgre | |
|
|
||
| export function getStageParticipantStatusCounts(participants: ParticipantDataWithStatus[]) { | ||
| return participants.reduce<StageParticipantStatusCounts>((counts, participant) => { | ||
| if (participant.rejected) { | ||
| if (participant.rejected || participant.timedOut) { | ||
| return counts; | ||
| } | ||
|
|
||
|
|
@@ -130,12 +130,14 @@ function getBetweenSubjectsCombinationStatusCounts( | |
| betweenSubjectsFactors: BetweenSubjectsFactor[], | ||
| ) { | ||
| return participants.reduce((counts, participant) => { | ||
| const matchesCombination = !participant.rejected && participantMatchesBetweenSubjectsCombination( | ||
| participant, | ||
| stageName, | ||
| combination, | ||
| betweenSubjectsFactors, | ||
| ); | ||
| const matchesCombination = !participant.rejected | ||
| && !participant.timedOut | ||
| && participantMatchesBetweenSubjectsCombination( | ||
| participant, | ||
| stageName, | ||
| combination, | ||
| betweenSubjectsFactors, | ||
| ); | ||
| if (!matchesCombination) { | ||
| return counts; | ||
| } | ||
|
|
@@ -411,6 +413,7 @@ function BetweenSubjectsCombinationTable({ | |
| participants.filter((participant) => ( | ||
| !participant.completed | ||
| && !participant.rejected | ||
| && !participant.timedOut | ||
| && participantMatchesBetweenSubjectsCombination( | ||
| participant, | ||
| stage.stageName, | ||
|
|
@@ -442,6 +445,7 @@ function BetweenSubjectsCombinationTable({ | |
| ...(showParticipantLimits ? [{ | ||
| accessorKey: 'desiredParticipants', | ||
| header: 'Total / Maximum', | ||
| size: 240, | ||
|
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. [P3] These table sizing and padding changes are unrelated to auto-timeout behavior. Please remove this styling churn or move it to a separate change so the feature diff stays focused and easier to validate. |
||
| Cell: ({ row }: { row: { original: BetweenSubjectsCombinationRow } }) => renderDesiredParticipantsCell( | ||
| row.original, | ||
| stage, | ||
|
|
@@ -490,10 +494,12 @@ function BetweenSubjectsCombinationTable({ | |
| }, | ||
| mantineTableContainerProps: { style: { maxWidth: '100%', overflowX: 'auto' } }, | ||
| mantineTableProps: { style: { minWidth: 'max-content', width: '100%' } }, | ||
| mantineTableBodyRowProps: { style: { height: 44 } }, | ||
| mantineTableBodyCellProps: ({ column, row }) => { | ||
| const compactCellStyle = { paddingBlock: 4 }; | ||
| const factorIndex = betweenSubjectsFactors.findIndex((factor) => factor.factorName === column.id); | ||
| if (factorIndex === -1) { | ||
| return {}; | ||
| return { style: compactCellStyle }; | ||
| } | ||
|
|
||
| const factor = betweenSubjectsFactors[factorIndex]; | ||
|
|
@@ -503,6 +509,7 @@ function BetweenSubjectsCombinationTable({ | |
|
|
||
| return { | ||
| style: { | ||
| ...compactCellStyle, | ||
| backgroundColor: getDistinctColorShade(factorIndex, levelIndex, factor.levels.length), | ||
| }, | ||
| }; | ||
|
|
@@ -1030,7 +1037,10 @@ export function StageManagementItem({ studyId, studyConfig }: { studyId: string; | |
| aria-label={`Review ${participantCounts.inProgress} in-progress participant${participantCounts.inProgress === 1 ? '' : 's'}`} | ||
| color="dark" | ||
| onClick={() => handleReviewInProgress(participants.filter((participant) => ( | ||
| participant.stage === stage.stageName && !participant.completed && !participant.rejected | ||
| participant.stage === stage.stageName | ||
| && !participant.completed | ||
| && !participant.rejected | ||
| && !participant.timedOut | ||
| )), `Showing only in-progress participants in the ${stage.stageName} stage — not all in-progress participants in the study.`)} | ||
| p={0} | ||
| size="compact-xs" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[P2] This groups late completions with incomplete timeouts because both have
timedOut === true. The newcompletedLatefield is therefore lost in the main analysis filter, and older consumers such as tidy downloads, snapshot counts, and participant badges still use only the old three statuses. Please define one canonical status mapping and use it everywhere, keeping rejected, timed out, and completed-late distinct.