Skip to content

Study View filter bar: the portal's words between groups (STV-FB-2) - #453

Merged
alisman merged 2 commits into
masterfrom
studyview-pill-words
Nov 19, 2026
Merged

alisman merged 2 commits into
masterfrom
studyview-pill-words

Conversation

@alisman

@alisman alisman commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Explore filter bar's generic pills now use the words the portal's GroupLogic writes (STV-FB-2):

  • An OR group reads "( a or b )": lower-case "or", in parentheses. It was "a OR b".
  • Two groups in a row from the same chart are joined by "and", as the portal writes "( APC or TP53 ) and ( KRAS )". joinedByAnd in lib/study-view-pills.ts decides. A clinical chart's pill, or a group from another chart, gets no word, as before.
  • The Cohorts tab's pills keep their own AND / OR (ClausePill takes the portal words only when asked, through portal).

What counts as one chart: a clause's leaf kind, plus the gene and profile of a genomic clause, the entity of an assay clause, and patient or sample for a treatment clause.

Spec IDs

Verification

  • Browser, dev server, coadread: APC + TP53 from the Mutated Genes table, then KRAS, reads "OQL APC: MUT; TP53: MUT × and OQL KRAS: MUT ×". 201 patients match, the count unchanged by the words. No page errors.
  • Unit tests: a case table in test/study-view-pills.test.ts: two gene-table groups ("and"), a clinical pill between (none), a case list after a gene (none), two case lists ("and"), patient-level and sample-level treatment clauses (none, two tables). npm test 6,818 pass, 0 fail (with master merged in).
  • Coverage: passes.
  • Planted bug: 1 in scripts/mutants/study-view/pill-words.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:477):

  • Gene, case-list and other generic pills with the portal's lower-case "or", parentheses and outer "and" (STV-FB-2); a density drag shown on its chart only, not as two range pills (STV-FB-3b)

becomes what is left:

Scorecard 31-study-view-shell.md, row STV-FB-2 (was | STV-FB-2 | 🟡 | B | ↓ Clinical pills "<chart> : a or b", no word between charts ✅ (\study-view-pills.tsx:115-120`); gene, case-list and other generic pills join with "OR" in capitals and have no parentheses or outer "and" (`pills.tsx:154`) |`):

| STV-FB-2 | ✅ | B | Clinical pills " : a or b", no word between charts; generic OR groups "( a or b )" and two groups of one chart joined by "and" (joinedByAnd, lib/study-view-pills.ts); a gene-table Union is one OQL clause, its pill text under STV-FB-3 |

Preview

/lab?tab=explore&study=coadread_tcga_pan_can_atlas_2018: apply APC + TP53 from Mutated Genes, then KRAS.

🤖 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 12:06
Generic pills read as the portal's GroupLogic writes them: an OR group
"( a or b )", lower-case and in parentheses, and two groups in a row
from the same chart joined by "and" (joinedByAnd); a clinical chart's
pill, or another chart's group, gets no word. The Cohorts tab's pills
keep their own AND / OR.

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:43pm UTC
cbiolab-new Ready Ready Preview Nov 19, 2026 12:43pm UTC
cohort-lab Ready Ready Preview Nov 19, 2026 12:43pm UTC

Request Review

@alisman

alisman commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Review: pass. Display only. Study View filter-bar OR groups are written "( a or b )", and joinedByAnd puts "and" only between consecutive generic groups from the same chart (same kind, and the same gene/profile or entity for genomic and assay clauses), as the portal's GroupLogic writes "( APC or TP53 ) and ( KRAS )" (STV-FB-2). Clinical pills and groups from different charts get no word. The unit table covers both cases, and the planted bug pill-and-across-charts is caught. The lab's other ClausePill uses keep "OR" (portal is opt-in).

@alisman
alisman added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit d534ffb Nov 19, 2026
19 of 20 checks passed
@alisman
alisman deleted the studyview-pill-words branch November 19, 2026 13:30
alisman added a commit that referenced this pull request Nov 19, 2026
The fallback pill for clauses that are not a gene table's selection passes `portal` again, as
master does, so gene-chart and typed-OQL OR groups keep #453's parentheses and lower-case "or".

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

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 1a2b0ba8 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