Skip to content

Study View: the selection line as the portal writes it (STV-AB-1) - #452

Merged
alisman merged 2 commits into
masterfrom
studyview-selected-info
Nov 19, 2026
Merged

alisman merged 2 commits into
masterfrom
studyview-selected-info

Conversation

@alisman

@alisman alisman commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Explore header writes the selection as the portal's StudyResultsSummary does (STV-AB-1):

  • Unfiltered, "594 patients | 594 samples".
  • While the charts are filtered, "Selected: 41 patients | 41 samples".
  • It was "594 patients · 594 samples".

The format is portalSelectedInfo in lib/chart/format.ts. The "(overlap not deduplicated)" note on several studies stays (invariant 3).

Spec IDs

  • Covered: STV-AB-1 (the prefix only while filtered, "|" between the counts, toLocaleString).

Verification

  • Browser, dev server, coadread: unfiltered "1 study · 594 patients | 594 samples". After a click on an AGE bar, "1 study · Selected: 41 patients | 41 samples", matching the filter bar's "41 patients match". No page errors.
  • Unit tests: test/study-view-selected-info.test.ts, the spec's seen cases (coadread 594 / 594, lgg 23 / 61, an emptied selection "Selected: 0 patients | 0 samples") and a thousands separator. npm test 6,818 pass, 0 fail (with master merged in).
  • Coverage: passes.
  • Planted bug: 1 in scripts/mutants/study-view/selected-info.ts (guard unit).

Tracker

Under "Study View → filters, actions and tabs" → "Found by the re-measurement of 2026-11-18", this line (docs/PORTAL-PARITY.md:476) is ticked:

Scorecard 31-study-view-shell.md, row STV-AB-1 (was | STV-AB-1 | 🟡 | B | ↓ Header "1 study · 594 patients · 594 samples" from the filtered totals, skeleton while counting; not the portal's "Selected: 594 patients | 594 samples" (no "Selected:", "·" for "|"), and "(overlap not deduplicated)" on several studies (\explore-sections.tsx:129-139`) |`):

| STV-AB-1 | ✅ | B | Header "594 patients | 594 samples", "Selected: 41 patients | 41 samples" while filtered (portalSelectedInfo), from the filtered totals, skeleton while counting; "(overlap not deduplicated)" kept on several studies (invariant 3) |

Preview

/lab?tab=explore&study=coadread_tcga_pan_can_atlas_2018: the header, before and after clicking a bar.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

alisman and others added 2 commits November 19, 2026 11:55
The header reads "594 patients | 594 samples", and "Selected: 41 patients |
41 samples" while the charts are filtered, as the portal's
StudyResultsSummary (portalSelectedInfo); was "594 patients · 594 samples".
The multi-study "(overlap not deduplicated)" note stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Nov 19, 2026 12:40pm UTC
cbiolab-new Ready Ready Preview Nov 19, 2026 12:40pm UTC
cohort-lab Ready Ready Preview Nov 19, 2026 12:40pm UTC

Request Review

@alisman

alisman commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Review: pass. Display only. portalSelectedInfo writes "N patients | M samples", with "Selected: " only while the charts are filtered (STV-AB-1, the portal's StudyResultsSummary). "Filtered" is explore.draftCount != null, the same signal the "N patients match" line already uses. The unit cases cover both states, 0 and the thousands separator, and the planted bug selected-prefix-always is caught. The several-studies overlap note is kept.

@alisman
alisman added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit 7e9aafa Nov 19, 2026
19 of 20 checks passed
@alisman
alisman deleted the studyview-selected-info branch November 19, 2026 13:41

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 688f955d Deployed Nov 19, 2026 by vercel[bot]
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.

1 participant