Skip to content

Add snapshot participant counts#1267

Merged
JackWilb merged 3 commits into
devfrom
codex/1184-snapshot-counts-clean
Jun 11, 2026
Merged

Add snapshot participant counts#1267
JackWilb merged 3 commits into
devfrom
codex/1184-snapshot-counts-clean

Conversation

@JackWilb

Copy link
Copy Markdown
Contributor

Summary

  • add Completed, In Progress, and Rejected columns to the Manage Data snapshots table
  • store participant status counts on new snapshot metadata and preserve them on rename
  • lazily backfill counts for existing snapshots and keep actions usable if backfill fails

Tests

  • yarn unittest src/analysis/individualStudy/management/tests/ManageView.spec.tsx --run
  • yarn unittest src/storage/tests/primitives.spec.ts --run
  • yarn typecheck
  • yarn lint

Closes #1184

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

🪓 PR closed, deleted preview.

@jaykim1213

jaykim1213 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Resolved
In DataManagementItem.tsx, const strippedFilename is used in fetchParticipants and backfill useEffect. Can we make this into a helpfer function like:

function getSnapshotStudyId(snapshotKey: string) {
  return snapshotKey.slice(snapshotKey.indexOf('-') + 1);
}

Comment thread src/storage/engines/types.ts Outdated
Comment thread src/analysis/individualStudy/management/DataManagementItem.tsx
@jaykim1213

jaykim1213 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Resolved
This might be a separate issue, but the snapshot list is not sorted by creation date. Can we sort snapshots by date?

Screenshot 2026-06-10 at 3 17 21 PM

@JackWilb JackWilb linked an issue Jun 11, 2026 that may be closed by this pull request
9 tasks
@JackWilb JackWilb requested a review from jaykim1213 June 11, 2026 05:32
@JackWilb

JackWilb commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all review feedback in commit 5cf28547:

  • Added shared helper getSnapshotStudyId(snapshotKey) and reused it in both the lazy backfill path and snapshot download participant fetch path.
  • Sorted snapshot rows by creation timestamp, newest first, using the timestamp embedded in the snapshot key. Added a unit test for the ordering.
  • Updated failed backfills to remove the snapshot key from snapshotCountBackfills.current, so a later render or refresh can retry instead of leaving it permanently marked in-flight.
  • Changed getAllParticipantIds to prefer an explicit studyId argument with studyId ?? this.studyId, which is important when fetching participants for snapshot study IDs instead of the currently initialized live study.

Checks run:

  • yarn unittest src/analysis/individualStudy/management/tests/ManageView.spec.tsx --run
  • yarn unittest src/storage/tests/primitives.spec.ts --run
  • yarn typecheck
  • yarn lint

@jaykim1213

Copy link
Copy Markdown
Contributor

Looks great thank you!

@JackWilb JackWilb merged commit 1fc349f into dev Jun 11, 2026
5 of 7 checks passed
@JackWilb JackWilb deleted the codex/1184-snapshot-counts-clean branch June 11, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide info on how many participants are in a snapshot

2 participants