Skip to content

Refactor pathology timeline and native WSI slide integration - #2

Closed
raylim wants to merge 298 commits into
masterfrom
feature/native-wsi-viewer
Closed

raylim wants to merge 298 commits into
masterfrom
feature/native-wsi-viewer

Conversation

@raylim

@raylim raylim commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

This PR publishes the current native WSI/pathology stack on the raylim/cbioportal-frontend fork.

It is the cleaned WSI-only branch after separating unrelated timeline, oncoprint, patient-view mutation/CNA, shared utility, and Playwright harness work into dedicated follow-up branches.

What Changed

  • refactored pathology timeline assembly to derive pathology slide events from slide associations rather than legacy sample-level WSI attributes
  • unified pathology augmentation across summary timeline, clinical data event tables, and WSI navigation behavior
  • fixed summary timeline pathology event collapsing, tooltip navigation behavior, and WSI linkout filtering so linked slide views do not incorrectly hide other slide types
  • strengthened WSI viewer data/bootstrap utilities, caching, warmup behavior, and patient-view integration points
  • added focused regression coverage for pathology timeline grouping, summary timeline behavior, WSI viewer linkouts, patient-view wiring, and API helper guards

Why

The native WSI viewer and pathology timeline work had grown together with adjacent unrelated changes in the worktree. This branch was cleaned so the core WSI/pathology feature can be reviewed independently and nothing relevant is left uncommitted on feature/native-wsi-viewer.

Impact

  • pathology slide events in patient view are sourced and grouped consistently from the pathology association model
  • summary and clinical data surfaces share the same core pathology grouping behavior
  • WSI linkouts preserve the broader slide context instead of trapping the user in a URL-only specimen filter state
  • this branch is now the authoritative WSI/pathology stack; unrelated follow-up work lives in separate fork-only PRs

Validation

Ran focused Jest coverage before publishing this branch:

  • pnpm --filter cbioportal-clinical-timeline exec jest --env=jsdom --runInBand src/TimelineStore.spec.tsx
  • pnpm exec jest --env=jsdom --runInBand src/pages/patientView/timeline/pathologyTimelineUtils.spec.ts src/pages/patientView/timeline/TimelineWrapper.spec.ts src/pages/patientView/timeline/ClinicalEventsTables.spec.ts src/pages/patientView/timeline/timeline_helpers.spec.tsx src/pages/patientView/timeline/usePathologyAugmentedClinicalEvents.spec.tsx src/pages/studyView/tabs/ClinicalDataTab.spec.ts
  • pnpm exec jest --env=jsdom --runInBand src/shared/components/wsiViewer/WSIViewer.spec.tsx src/shared/components/wsiViewer/wsiCbioportalDataUtils.spec.ts src/shared/components/wsiViewer/wsiNavPanel.spec.tsx src/shared/components/wsiViewer/wsiSlideUtils.spec.ts src/shared/components/wsiViewer/wsiViewerWarmup.spec.ts src/shared/components/wsiViewer/wsiBootstrapFetch.spec.ts
  • pnpm exec jest --env=jsdom --runInBand src/shared/api/cbioportalClientInstance.spec.ts src/shared/api/urls.spec.ts src/pages/patientView/PatientViewPage.spec.tsx src/pages/patientView/PatientViewUrlWrapper.spec.ts src/pages/patientView/PatientViewPageTabs.spec.tsx src/shared/lib/assertWsiOsdBundle.spec.ts

@raylim
raylim force-pushed the feature/native-wsi-viewer branch from fd07208 to be03815 Compare July 22, 2026 20:01
@raylim
raylim force-pushed the feature/native-wsi-viewer branch from fe0c1dd to fad0b42 Compare July 30, 2026 20:47
inodb and others added 13 commits July 31, 2026 14:09
* Add "Drivers Only" oncoprint sort option

Sorts oncoprint columns as if variants of unknown significance were
absent, while keeping them visible. Previously the only way to get a
driver-determined column order was to hide VUS entirely, which discards
the VUS from the display.

The existing "Driver/Passenger" option only ranks drivers above VUS
within a single gene track, so a case whose only alteration is a VUS in
the first gene still outranks a case with a driver further down. This
option instead ranks a VUS equal to no alteration, so the column order
falls through to the genes where drivers actually are.

Germline status is derived from the displayed mutation, so it is
likewise ignored when the displayed mutation is not a driver.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122KUS28Q6vXwsgrXbHx9mt

* Nest the option under Driver/Passenger as "Ignore passengers"

"Drivers Only" read like a filter that hides passengers, and it greyed
out Driver/Passenger even though it refines rather than replaces it.

Indent it under Driver/Passenger, label it "Ignore passengers", and run
the dependency parent to child: the option is enabled only while
Driver/Passenger is on, and no longer disables its parent. The derived
flag requires sortByDrivers too, so a hand-edited URL cannot reach a
state the checkbox forbids.

Renames the setting to sortIgnorePassengers and the URL parameter to
oncoprint_sort_ignore_passengers to match the label.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122KUS28Q6vXwsgrXbHx9mt

* Use the portal's driver/VUS vocabulary for the sort labels

"Passenger" appeared nowhere else in the oncoprint UI: every legend
entry reads "(putative driver)" or "(unknown significance)", and the
alteration filter is "Hide VUS". The sort menu was the only place using
the term.

Rename the labels to "Driver" and "Ignore VUS", which also pairs the new
option with the filter it contrasts with — Hide VUS removes them, Ignore
VUS only drops them from the ordering.

Renames the setting to sortIgnoreVUS and the URL parameter to
oncoprint_sort_ignore_vus to match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122KUS28Q6vXwsgrXbHx9mt

* Name the URL parameter after the setting it refines

Every other oncoprint sort sub-setting is oncoprint_sort_by_*, so
oncoprint_sort_ignore_vus was the odd one out and gave no hint that it
only applies alongside oncoprint_sort_by_drivers.

Rename it to oncoprint_sort_by_drivers_ignore_vus, which makes the
parent parameter an exact prefix of the child: the two sort adjacently
in a URL and one grep finds both.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122KUS28Q6vXwsgrXbHx9mt

* Remove the extra gap above the Ignore VUS row

Bootstrap collapses the space between adjacent checkboxes with
`.checkbox + .checkbox { margin-top: -5px }`. Wrapping the row in a
`div` to indent it broke that adjacency, so it sat 5px lower than the
rows above it.

Put the indent on the `.checkbox` element itself, which keeps it an
adjacent sibling: rows within the group are now evenly spaced.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122KUS28Q6vXwsgrXbHx9mt

* Address review: drop the dead getter, harden the test helper

The `sortIgnoreVUS` computed getter on Oncoprint was never read —
DeltaUtils derives the flag itself for both the comparator and its
change detection — so remove it rather than leave a value that looks
like it drives behaviour.

`compareVectors` walked to the longer vector's length, so a ragged pair
would compare equal on the undefined slots and quietly pass. Assert the
lengths match instead, since the genetic track sort vector is fixed
width and a change in its shape should fail the test loudly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122KUS28Q6vXwsgrXbHx9mt

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Update GN api client

* Update mock model in hotspots tests
 - cbioportal-clinical-timeline@0.4.7
 - cbioportal-frontend-commons@0.6.7
 - cbioportal-utils@0.4.6
 - genome-nexus-ts-api-client@1.1.40
 - oncokb-frontend-commons@0.1.8
 - react-mutation-mapper@0.9.10
 - react-variant-view@0.4.10
…_modules directory in README.md (cBioPortal#5656)

* docs: fix punctuation, plural agreement, and spacing in README.md

* Clarify instruction to remove node_modules directory

---------

Co-authored-by: ferkans-amir <amir.rezaei@tu-berlin.de>
Co-authored-by: Gaofei Zhao <15748980+dippindots@users.noreply.github.com>
…igation (cBioPortal#5664)

Problem:
- Switching to a different study while already on a StudyView page
  (via client-side navigation, no full page reload) left the page
  showing the previous study's data.

Cause:
- The route (/study/:tab?) only matches on path, not query string, so
  React Router reuses the same mounted StudyViewPage instance when
  only the id/studyId/cancer_study_id query param changes.
- The URL was only ever read once, in the constructor, so the new
  studyId was never picked up.

Fix:
- Extract the constructor's query-parsing logic into
  computeStudyViewFilterFromRouting().
- Call it again from a new componentDidUpdate(), reusing the existing
  updateStoreFromURL() entry point — already designed to be callable
  repeatedly, since it just updates the observable studyIds that the
  rest of the store reactively derives from.

Note:
- Deliberately skip initializeReaction() in the update path — it
  registers new reaction disposers on every call and is only meant to
  run once at mount; calling it again would leak duplicate reactions.
* fix(ui): keep study view columns menu above tables

* Keep reset charts above columns popup

* Refresh columns popup Playwright screenshot

* Place reset charts modal above columns popup

* Refresh deploy preview validation capture

* Add authenticated reset charts evidence

* docs: use public db endpoint for columns dropdown validation

* fix: close columns popup before reset charts modal

* test: stabilize struct var namespace columns selection

* test: refresh oncoprint screenshot reference
…oPortal#5669)

* Fix Download tab crash for studies with no mutation/CNA profiles

CaseAlterationTable iterates all queried genes and unconditionally
indexes geneAlterationTypesMap[gene].forEach(...). For studies that
only have an mRNA expression profile (e.g. ovary_geomx_gray_foundation_2024),
plain gene queries with no explicit OQL alteration syntax end up with
no alterations on the parsed OQL line, since there is no mutation/CNA/etc.
profile type to build a default OQL against. That leaves those genes
without an entry in geneAlterationTypesMap, so the forEach call throws
TypeError: Cannot read properties of undefined (reading 'forEach') and
crashes the Download tab's 'Type of Genetic Alterations Across All
Samples' table.

Guard the lookup with a default empty array, since genes with no
queryable alteration types legitimately have no pseudo-OQL columns
to add.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix second Download tab crash for mRNA-only studies (track columns)

After the first fix, the Download tab's per-track (single-gene and
merged-track) alteration columns still crashed for studies with no
mutation/CNA/other alteration profile: getPseudoOqlSummaryByAlterationTypes
was called with this.props.trackAlterationTypesMap[trackLabel], which is
undefined for tracks with no alteration types (same root cause as the
geneAlterationTypesMap issue - trackAlterationTypesMap only gets an
entry when the OQL line has a non-empty alterations array).

_.map(undefined, ...) returns [] via lodash, so the crash didn't come
from the .map call itself, but later from 'alterationTypes.length'
once alterationTypes was undefined, throwing:
TypeError: Cannot read properties of undefined (reading 'length')

Default alterationTypes to [] inside getPseudoOqlSummaryByAlterationTypes
itself (rather than patching each of the 4 call sites), so any caller
passing an undefined alteration-types list is handled safely.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: dippindots <dippindots@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Show Chat Beta link by default on public portal

The chat nav item no longer requires the CHAT feature flag on
public-portal. It is shown on the MSK and public portals, which both
have a chat deployment, and hidden everywhere else.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xHbfaApxSTde7ykFDkdeD

* Remove unused CHAT feature flag

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xHbfaApxSTde7ykFDkdeD

---------

Co-authored-by: Ino de Bruijn <ino4president@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…cBioPortal#5668)

* Add Cancer Hotspots v3 citations and v3 badge to all hotspot tooltips

Cancer Hotspots now serves v3 data alongside v2, adding new recurrent
hotspots not present before. Update the three user-facing tooltips
(mutation table Annotation column header, lollipop/per-row hotspot
icons, and the GlobalSettingsButton Hotspots row) plus the Variant
Viewer's hotspot tooltip to cite Chang et al. 2016 and Bandlamudi et
al. 2026 alongside the existing Chang et al. 2018 and Gao et al. 2017,
and consolidate the previously hand-duplicated GlobalSettingsButton
text to reuse the shared citation content so it can't drift again.

Thread the real per-hotspot `version` field (now returned by
genome-nexus) through to a small `v3` badge shown only when a specific
hotspot record is newly added in v3, defensively treating any
missing/legacy version value as not-v3 so older data keeps rendering
unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Refine v3 hotspot badge and citation ordering per feedback

Reorder citations by publication year (Chang 2016, Chang 2018,
Bandlamudi 2026, Gao 2017) everywhere, matching the punctuation the
combined recurrent+3D case needs (no Oxford comma before the 3D
citation) versus the recurrent-only case (Oxford comma). Drop the
"Now includes v3 data." header note per feedback that it wasn't
wanted, and replace the small superscript v3 badge with a plainer
"(new in V3)" suffix on the bold hotspot-type label, removing the
now-unused badge CSS class.

The GlobalSettingsButton/driver-annotation-controls tooltip already
reuses HotspotInfo's shared publication() text, so it picks up the
new ordering with no changes of its own.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add rel='noopener noreferrer' to linkout

* Drop is3dHotspotV3, revert unrelated e2e count, remove stale comment

Cancer Hotspots v3 only covers the recurrent (2D) dataset, not 3D
clustering, so is3dHotspotV3 never had a real signal behind it. Remove
it end-to-end (HotspotInfo, Annotation, HotspotTrack,
HotspotAnnotation, GeneralPopulationPrevalence, the CNA/SV annotation
formatters, and the CancerHotspotsUtils helper) rather than leave dead
plumbing in place.

Revert the mutations-tab.spec.ts driver-badge count change - that
data shift will be addressed together with the rest of the v3 rollout
in a separate PR, not bundled here.

Drop the citations() ordering comment in HotspotInfo.tsx per review.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add rel=noopener noreferrer for linkout

* Revert changes in test as the test has been fixed in a separate PR

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
 - cbioportal-clinical-timeline@0.4.8
 - cbioportal-frontend-commons@0.6.8
 - cbioportal-utils@0.4.7
 - oncokb-frontend-commons@0.1.9
 - react-mutation-mapper@0.9.11
 - react-variant-view@0.4.11
* fix(query): default-select sole molecular profile (fixes cBioPortal/cbioportal#11569)

Auto-select the molecular profile when exactly one selectable profile suffix exists (e.g. RNA-only studies).

* fix(query): cast alteration types for getFilteredProfiles (TS2345)

Fixes CircleCI build_frontend rspack type errors at QueryStore.ts:1852 and :1855.

* fix(query): default mRNA profile when no mutation data (#11569)

* fix(query): use first selectable profile when Mut/SV/CNA missing

Address review feedback: avoid mRNA-specific fallback. When default
alteration profiles (Mutations, Structural Variant, Copy Number) are
absent, select the first available selectable profile instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(query): remove unused getSingleSelectableProfileSuffixIfUnique

Per review feedback on cBioPortal#5636: this helper was superseded by
getFallbackSelectableProfileSuffix and was never called from any
production code path, only exercised by its own spec. Removing it
and its dedicated tests.

* refactor(query): remove duplicate fallback-profile selection logic

QueryStore.shouldSelectDefaultProfile / defaultProfileToSelect
reimplemented the same 'no Mutations/SV/CNA -> select first
selectable profile' decision already handled reactively by
selectedProfileIdSet (via the shared getFallbackSelectableProfileSuffix
util). The onResult side effect that called
selectMolecularProfile(defaultProfile, true) on profile load was
therefore redundant with, and could diverge from, the computed
fallback already surfaced through isProfileTypeSelected/
selectedProfileIdSet.

Removing the duplicate getters and the imperative selection call
consolidates fallback-profile selection into a single source of
truth. Verified via QueryStore.spec.ts and
molecularProfileUtils.spec.ts (all passing) that default selection
behavior for #11569 is unchanged.

* docs(query): address review comments on cBioPortal#5636

- Restore/move the 'get rid of any undefined items' comment back
  above the compact() call it documents in
  getDefaultMolecularProfiles.ts.
- Add an explanatory comment to the new fallback-profile block in
  StudyViewPageStore.onSubmitQuery, which was flagged as getting
  hard to follow.

* docs(query): drop issue number references from code comments

* test(e2e): add coverage for #11569 fallback profile selection

- studyview.spec.ts: plain-gene query on ovary_geomx_gray_foundation_2024
  (no Mutations/CNA/SV profiles) now asserts the resulting profileFilter
  picks the mRNA-Seq Expression GeoMx profile and that the OncoPrint
  renders real mRNA High/Low data instead of everything unprofiled.
- home.spec.ts: query page for the same study now asserts the
  MRNA_EXPRESSION checkbox is auto-checked by default in Select Genomic
  Profiles.

Both tests were verified to fail against the current production build
(reproducing the reported bug) before the fix in this branch is applied.

* docs(e2e): rephrase test comments to describe expected behavior only

Drop 'before the fix'/'previously' framing; comments now state what the
system should do rather than referencing the historical bug.

* docs(e2e): drop issue number reference from file header comments

* refactor(query): rename defaultSuffix to fallbackProfileSuffix

Consistent with the fallback-terminology naming used throughout
getFallbackSelectableProfileSuffix and related utilities.

* refactor(query): rename fallback to firstSelectableFallbackProfile

More descriptive name for the variable holding the result of
getFirstSelectableProfile, consistent with fallback-related naming
elsewhere in this fix.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Pragati <Pragati5-DEBUG@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@raylim
raylim force-pushed the feature/native-wsi-viewer branch from ab13dbe to 72a9744 Compare August 13, 2026 16:31
@raylim
raylim force-pushed the feature/native-wsi-viewer branch 3 times, most recently from f0d56f0 to f0ace25 Compare August 19, 2026 05:30
calvinlu3 and others added 2 commits August 19, 2026 16:51
* Update oncokb card, oncokb track and oncoprint to support new oncokb germline api endpoints

* Fix merge conflicts with master

* Reduce OncoKB occurrence list default visible count from 5 to 2

* Fix failing tests in StoreUtils and add new ones for germline

* Fix failing tests in OncoKBUtils and add new ones for germline

* Fix failing oncoprint test due to some germline variants no longer being annotated on somatic endpoint, thus having no annotations anymore

* Update oncoprint screenshot

* Update capitalization

* Fix referenceGenome param passing to oncokb germline api and remove eslint comments

* Address rest of feedback

* Address comments related to consolidating duplicated types/functions and moving OncoKbAlterationHelper to util folder
 - cbioportal-clinical-timeline@0.4.9
 - cbioportal-frontend-commons@0.6.9
 - cbioportal-utils@0.4.8
 - oncokb-frontend-commons@0.1.10
 - oncokb-ts-api-client@1.3.13
 - react-mutation-mapper@0.9.12
 - react-variant-view@0.4.12
@raylim
raylim force-pushed the feature/native-wsi-viewer branch from ceaf8fe to a4d99e3 Compare August 19, 2026 23:00
…8 regression) (cBioPortal#5681)

* Fix group color picker not opening in study view groups menu (React 18 regression)

React 18 delegates events at the root container instead of document, so
react-bootstrap's RootCloseWrapper attaches its document click listener
during the opening click's dispatch and immediately closes the popover.
Stop the native click on the trigger span, matching the fix in cBioPortal#5663.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdSd3qz8Z7TSqXjRvrKazm

* Keep popover click guards so swatch clicks don't close the Groups menu

The color popover is portaled to document.body, outside the Groups menu
(an rc-tooltip). Without stopping native mousedown/click in the popover,
rc-trigger's document listener treats a swatch click as an outside click
and closes the whole menu before a color is applied.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdSd3qz8Z7TSqXjRvrKazm

* Remove test-side workaround that masked the group color picker bug

The Playwright spec injected a document click listener calling
stopImmediatePropagation before opening the picker, which hid the
React 18 RootCloseWrapper close-on-open regression from CI. Now that
GroupCheckbox handles it, the test clicks the icon plainly so it
actually guards the behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdSd3qz8Z7TSqXjRvrKazm

---------

Co-authored-by: Ubuntu <ubuntu@vps-870e202d.vps.ovh.us>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@raylim
raylim force-pushed the feature/native-wsi-viewer branch 2 times, most recently from 2f9ac1a to 7506c6e Compare August 25, 2026 20:20
…load (cBioPortal#5684)

* Fix flaky 'igv tab' e2e test by using waitForIgvRendered helper

The test asserted .igv-column-container visibility with the default
5s timeout, which is too short for the IGV browser to mount and
render under CI load, causing frequent failures across all three
results-screenshots suites (see cBioPortal/cbioportal#12314).
waitForIgvRendered already exists in common.ts and is used
successfully in results-view-screenshot.spec.ts's cnSegments test —
it waits for the LoadingIndicator to clear and the container height
to stabilize, which is exactly what's needed here.

* Stub UCSC cytoband fetch in igv tab test to fix hangs

waitForIgvRendered still timed out at 60s after the previous fix.
The CircleCI trace showed why: igv.js resolves the bare hg19 genome
id against its own registry, which points cytoband data at
https://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/cytoBand.txt.gz.
That request never completes from CI's network path (status -1 in
the trace, i.e. still pending when the test gave up) - it hangs
rather than erroring, so IGV's init promise never settles and
waitForIgvRendered spins until its own timeout.

Stub the request with the real (static, effectively immutable)
cytoband file so CI doesn't depend on a third-party host's
reachability. Scoped to the igv tab test since it's the only one in
the suite that renders IGV.

* Stub UCSC cytoband fetch in local cnsegments test too

Same root cause as the remote igv tab tests (cBioPortal/cbioportal#12314):
igv.js resolves the bare hg19 genome id against its own registry, which
points cytoband data at UCSC's hgdownload server. That fetch hangs
indefinitely from CI's network path, stalling waitForIgvRendered until
its 60s timeout - confirmed via the trace network log on a fresh CI
failure of local/results-view-screenshot.spec.ts > cnsegments tab >
renders cnsegments tab (status -1 for the cytoBand.txt.gz request).

Reuses the same fixture and stubbing approach already applied to the
shared results-screenshots.ts igv tab test.

* Extract stubUcscCytobandFetch helper to dedupe cytoband stub

The route stub for the flaky UCSC cytoband fetch (cBioPortal/cbioportal#12314)
was duplicated between results-screenshots.ts and results-view-screenshot.spec.ts.
Move it into common.ts as stubUcscCytobandFetch, next to the related
waitForIgvRendered helper it's typically paired with.

* Also stub the UCSC ncbiRefSeq fetch that igv.js needs for hg19

The cytoband stub alone wasn't enough: with it in place, the local
cnsegments test got past IGV init but then failed on a screenshot
diff. The trace showed igv.js also fetches the RefSeq gene track from
https://hgdownload.soe.ucsc.edu/goldenPath/hg19/database/ncbiRefSeq.txt.gz,
which failed the same way (status -1, retried 3 times) - and without a
local gene track, igv.js fell back to resolving the "TP53" locus
string via the equally unreliable igv.org/genomes/locus.php (one call
took 2.8s, another failed outright).

Rename stubUcscCytobandFetch to stubUcscHg19Fetches and have it stub
both hgdownload files with the real static data, removing the need to
hit either external host from CI.
alisman and others added 27 commits August 28, 2026 15:14
…dError crash (cBioPortal#5686)

* Guard DOM removeChild/insertBefore against third-party node mutation

Browser page translation (and similar extensions) rewrap React-owned
text nodes, after which React's next commit throws
"NotFoundError: Failed to execute 'removeChild' on 'Node'" and the
whole app falls into the ErrorBoundary. Patch the two DOM methods to
ignore nodes that are no longer children of the target instead of
throwing.

Fixes cBioPortal/cbioportal#12254

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvYDwD6eWh1fbqv6zZ46Lj

* Mark the oncoprint tab as not translatable

Browser page translation rewraps React-owned text nodes, after which
React's next DOM update throws "NotFoundError: Failed to execute
'removeChild' on 'Node'" and the app falls into the ErrorBoundary.
Setting translate="no" on the oncoprint tab keeps translators out of
that subtree.

Fixes cBioPortal/cbioportal#12254

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvYDwD6eWh1fbqv6zZ46Lj

---------

Co-authored-by: Ubuntu <ubuntu@vps-870e202d.vps.ovh.us>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* add biofluid timeline track

* rename BIOBANK and BIOFLUID tracks
…ew timeline (cBioPortal#5690)

These two tracks were previously falling wherever their first event
occurred chronologically among unlisted tracks, allowing tracks like
PROCEDURES to land between them. Adding both to sortOrder guarantees
they stay adjacent regardless of event timing.

Co-authored-by: dippindots <dippindots@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Bumps [qs](https://github.com/ljharb/qs) from 6.15.2 to 6.16.0.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.15.2...v6.16.0)

---
updated-dependencies:
- dependency-name: qs
  dependency-version: 6.16.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Announce the "Introduction to cBioPortal Webinar" (Tue Sept 22, 2026,
11am-12:30pm EDT) via the existing home-screen user message banner, with
a registration link. Expires Sept 23, 2026.

Co-authored-by: dippindots <dippindots@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…l#5619)

* Adds is a working that filter mutations by Oncotree2Genes-LLM dataset. Also, adds a basic for adding tables called O2GL-DEMO

* Remove O2GL-Demo code

* Move O2GL gene filter into the per-table gene filter dropdown

Replace the standalone OncoTree2Genes-LLM (O2GL) study-view table with an
"OncoTree2Genes-LLM" option inside the existing per-table gene filter button,
alongside the OncoKB cancer-gene filter, for the mutated genes, structural
variant genes, and CNA genes tables.

- Add GeneFilterDropdown, a multi-option filter menu rendered in the gene
  column header, replacing the single-toggle TableHeaderCellFilterIcon on the
  gene-count tables. Each table can now expose OncoKB and/or O2GL filters.
- Drive the O2GL filter from the study's oncotree codes: o2glFilterGenes is
  derived from o2gl.json and only available when the current study maps to at
  least one gene. Selecting it filters rows to that gene set.
- Remove the ONCOTREE2GENES_LLM_TABLE chart type, its chart meta, layout,
  priorities, comparison-session handling, and the oncotree2GenesTableRowData
  remoteData; the data file o2gl.json is unchanged.
- Update e2e specs to open the dropdown and toggle the OncoKB option, matching
  the new interaction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Preserve table sort order when toggling a gene filter

Clicking a checkbox in the gene-filter dropdown bubbled through the React
portal tree to the column header, triggering a re-sort by gene name and
discarding the user's current sort (e.g. by frequency). Stop click propagation
on the dropdown menu so toggling a filter leaves the existing sort intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Link O2GL filter option to source repo and show code/gene counts

Make the "OncoTree2Genes-LLM" gene-filter option link out to the dataset's
source repository (github.com/SuhasiniLulla/OncoTree2Genes-LLM), mirroring the
OncoKB cancer-gene-list linkout, and annotate it with the scope of the filter
for the current study — e.g. "(1 oncotree code, 23 genes)" — so users can see
how many oncotree codes matched and how many genes the filter covers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Add OncoKB and O2GL gene indicator icons to study view tables

Show per-gene source indicators in the mutated-genes, SV-genes, and CNA-genes
tables, alongside the existing MutSig/GISTIC icons:

- OncoKB icon (the OncoKB oncogenic mark) on genes in the OncoKB Cancer Gene
  List, with a tooltip linking to the list.
- OncoTree2Genes-LLM icon (a blue OncoTree-style badge) on genes associated
  with the study's oncotree code(s) by the O2GL dataset, tooltip linking to the
  source repository.

The O2GL membership is derived from the o2glGenes already passed to the tables;
no new data fetching.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Unify gene-cell tooltip and clarify the O2GL icon

Hovering the OncoKB icon showed two near-identical tooltips (the gene cell's
OncoKB tooltip plus the icon's own). Drop the per-icon tooltips and fold the
OncoTree2Genes-LLM note into the single shared gene-cell tooltip, so hovering
the gene name or either source icon shows one combined tooltip. The cell
tooltip is now also shown for O2GL genes that are not OncoKB cancer genes.

Make the O2GL indicator legible at icon size: a solid OncoTree-blue circle with
a centered bold white "T" (for OncoTree) instead of the small off-center "O".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Vertically align gene annotation icons

The OncoKB/O2GL/MutSig icon wrappers carried a top margin and let their inline
svg/img sit on the text baseline, so the icons rendered slightly below the gene
name and each other. Center them in the flex row (inline-flex + align-items)
and drop the top margin so all annotation icons line up with the gene symbol.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Shrink and tighten gene annotation icons

The OncoKB and O2GL indicators made the gene cell feel busy. Reduce them to
11px and tighten the spacing between annotation icons so the OncoKB, O2GL, and
MutSig marks read as one compact group next to the gene symbol.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Vertically center annotation icons with the gene symbol

The icons were centered on the text line box, but the all-caps gene symbols sit
optically above that center, so the icons looked low. Tighten the gene cell's
line-height so its box hugs the caps, aligning the icons with the symbol.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Fix MutSig icon floating above the gene-cell icon row

The MutSig icon wraps its svg in a tooltip span that inherited a line-height,
adding a baseline gap so it sat higher than the OncoKB/O2GL icons. Collapse the
line-height on the icon wrappers so all annotation icons align on one row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Show source icons in the gene tooltip

Prefix each source line in the gene-cell tooltip with its icon (the OncoKB mark
for the Cancer Gene List line, the OncoTree2Genes badge for the O2GL line) so
the tooltip ties each statement to the icon shown in the table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Optically center gene-cell icons with the all-caps symbol

align-items:center centered the icons on the text line box, but with the app's
Helvetica font stack the caps sit in the upper part of that box, so the icons
(and the hover search icon) read as too low. Nudge them up to sit on the caps.

Verified against Helvetica metrics; the offset is tuned for the app's
Helvetica/Arial font stack the same way the original MutSig icon offset was.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Tune gene-cell icon vertical offset to -1px

Per visual review on macOS, a 1px upward nudge centers the icons on the gene
symbol (the earlier 3px was too much); align the hover search icon to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Center the "T" within the O2GL icon

The T sat slightly high in the circle. Drop to font-size 8.5 and lower the
baseline so it's vertically centered with even space above and below.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Show source icons in the gene filter dropdown

Prefix each option in the "Filter genes by" dropdown with its icon (OncoKB mark,
OncoTree2Genes badge) so the dropdown matches the table and tooltip. Allow the
OncoKB icon to render without a specific gene for the generic filter label.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Fold the MutSig/GISTIC tooltip into the unified gene-cell tooltip

The MutSig/GISTIC "M"/"G" badge carried its own tooltip, so hovering it showed
a second popup. Render the badge without a tooltip and add a concise, icon-
marked driver-gene line (with q-value) to the shared gene-cell tooltip, matching
the OncoKB and O2GL rows. The cell tooltip now also shows for driver genes that
are neither OncoKB nor O2GL genes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Align the search icon with the gene icons and explain MutSig/GISTIC

Match the hover search icon to the 11px annotation icons and drop it 1px so it
lines up with them. Expand the MutSig/GISTIC tooltip line with a short
explanation of what the algorithm flags.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Add a MutSig/GISTIC driver-gene filter to the gene dropdown

Add a third "Filter genes by" option that restricts the table to candidate
driver genes (those with a MutSig/GISTIC q-value), labeled per table type with
a gene count. The filter reads the q-value already on each row, so it needs no
extra data fetching.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Fix article in OncoKB gene tooltip ("a oncogene" -> "an oncogene")

Choose "a"/"an" based on the following word so oncogene reads "an oncogene"
while "tumor suppressor gene" stays "a tumor suppressor gene".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Name the cancer type(s) in the O2GL gene tooltip

Instead of always saying "this cancer type", name the specific oncotree code
when the cohort maps to one, and say "one of the N cancer types in this cohort"
when it spans several (e.g. msk_chord_2024). Plumb the matched oncotree codes
through to the gene cell for the wording.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Make the O2GL tooltip cancer type(s) per-gene

A gene in a multi-cancer cohort maps to only a subset of the cohort's oncotree
codes, so use the gene's own matched codes rather than the cohort total: name
the specific cancer type when a gene maps to exactly one, and show that gene's
count ("N cancer types in this cohort") when it maps to several.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Color the O2GL icon by the gene's cancer type

When a gene maps to a single oncotree code, fill its O2GL icon with that cancer
type's color (using the same clinical-value coloring the study view uses);
fall back to OncoTree blue when it maps to several. Always draw a border so
light colors stay visible, and pick black/white "T" text by fill luminance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Use canonical cancer type color and name for the O2GL icon/tooltip

Color the O2GL icon by the cancer type's canonical dedicatedColor from the
cancer-types API (e.g. HCC -> MediumSeaGreen), matching how cBioPortal colors
cancer types in the query tree, instead of an arbitrary palette. Resolve CSS
color names for the text-contrast check. Name the cancer type in the tooltip
(e.g. "Lung Adenocarcinoma") instead of the bare oncotree code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Color the OncoKB icon by gene role (oncogene/TSG/both)

Render the OncoKB bullseye inline and color it by the gene's OncoKB role:
muted red for oncogene, blue for tumor suppressor, purple for both, and gray
for a cancer gene with no oncogene/TSG role. The generic filter-label icon
keeps the OncoKB brand blue. The tooltip already states the role in words.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Revert OncoKB icon role coloring

Drop the oncogene/TSG/both coloring of the OncoKB icon per request; restore the
plain OncoKB bullseye for all cancer genes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Add an OncoTree annotation link to the gene filter dropdown

Add a "View these genes on OncoTree" link under the filter options that opens
the OncoTree annotation overlay (inodb.github.io/oncotree) with the cohort's
O2GL genes per oncotree code (value = gene count, plus the gene list). Falls
back to gene counts only when the full payload would make the URL too long.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Add an /oncotree2genes method page and link the dropdown to it

Replace the per-cohort OncoTree footer link with an /oncotree2genes page that
explains the O2GL method and lists every oncotree code -> cancer type -> genes
in a filterable table, plus a "view on OncoTree" link (per-code gene counts,
which stays within URL length limits). The "OncoTree2Genes-LLM" name in the
gene filter dropdown and tooltips now links to this page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Base64-encode the OncoTree counts link to shorten the URL

Encode the all-codes annotation payload as base64url (the viz decodes base64)
instead of raw url-encoded JSON, cutting the OncoTree link from ~16k to ~12k
chars to reduce "URI Too Long" errors. A full iframe/postMessage integration
will replace this for full gene lists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Trim the OncoTree2Genes page intro copy

Remove the cBioPortal-usage sentence and point to the source repo as "Method
and dataset is further described at ...".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Embed OncoTree via iframe and push full genes by postMessage

Replace the length-limited OncoTree URL with an embedded iframe: on the
"oncotree-ready" message, post the full per-code annotations (gene count + gene
list) to the viz. No URL limit, full gene names.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Use LazyMobXTable for the OncoTree2Genes table

Replace the hand-rolled table with the reusable LazyMobXTable: sortable
columns, a built-in filter, and pagination, with the "# genes" column
right-aligned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Use full page width on the OncoTree2Genes page

Drop the 1100px max-width so the embedded OncoTree and the gene table use the
full content width.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Drive the OncoTree and the table from one search box

Add a single search at the top of the page: it filters the gene table and
re-posts only the matching codes' annotations to the embedded OncoTree, so a
search (e.g. a gene like RB1) highlights every matching cancer type on the tree
and filters the table together. The table's own filter box is hidden.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Use OncoTree embed mode + search message, debounce the search

Switch the iframe to ?embed=1, post the full annotations once on ready, and
drive the tree's own search via the new "oncotree-search" message instead of
re-filtering annotations. Debounce the search (250ms) so the table filter and
the tree search update after typing stops rather than on every keystroke.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Surface the OncoTree search match count

Listen for the "oncotree-search-result" message and, while searching, show the
tree's match count next to the table count ("N cancer types on the tree").

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Right-align the # genes cells in the table

Column align only styles the header, so right-align the cell content in the
render too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Show unique gene count and rename "codes" to "cancer types"

The count line now reads "N of 894 cancer types · M genes" (unique genes across
the filtered rows), and the tree match count reads "K matched on the tree".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Enhance the OncoTree2Genes page: highlighting, examples, per-gene table

- Highlight the matching substring in the Code, Cancer type, and Genes columns.
- Add clickable example searches (IDC, FLT3, TP53) that fill the search box.
- Add a second "Genes -> cancer types" table (each gene with its associated
  cancer types and count), driven by the same search; both tables paginate at
  10 rows.
- Drop the redundant "matched on the tree" count and tidy the intro copy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Mention the gene count in the OncoTree2Genes intro

"covers 894 OncoTree codes and 596 genes."

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Show unique gene counts on the OncoTree and share table page size

Send only the gene list (no numeric value) in the OncoTree annotations so a
collapsed parent's badge shows the number of distinct genes across its subtree
(union) rather than the summed count — e.g. Myeloid shows 111, not 1,255.

Use a shared ROWS_PER_PAGE for both tables so they always show the same number
of rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Remove the TISSUE root entry from o2gl.json

TISSUE is the OncoTree root pseudo-node, not a real cancer type, so its 11-gene
entry caused the tree root to render a "11 genes" badge and added a bogus row to
the cancer-types table. Drop it (894 -> 893 codes; unique gene count unchanged
at 596, since all 11 genes occur under real cancer types).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Allow fullscreen for the embedded OncoTree iframe

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Let clicks in the embedded OncoTree drive the table filter

Listen for an "oncotree-node-click" message ({ code, label }) from the iframe
and set the search to that code, so clicking a cancer type / annotation in the
tree filters the tables (and re-highlights the tree) to that code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Multi-select cancer types by clicking nodes in the embedded OncoTree

Clicking a node in the iframe (oncotree-node-click) now toggles that code into a
selection rather than replacing the search: clicking again removes it. Selected
codes show as removable chips with a "clear" link, and both tables filter to the
union of the selected codes (combined with the text search).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Reflect the selection on the embedded OncoTree

Post an "oncotree-selection" message with the selected codes whenever the
selection changes, so the tree marks those cancer types with a checkmark (and
clears them when a chip is removed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Group-toggle OncoTree selection; support add-mode

Handle the node-click message's codes[] with a group toggle (remove all if all
already selected, else add all), and an "add" mode (used when expanding a parent
selects its subtree) that only adds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Add an LLM-hallucination caveat to the OncoTree2Genes page

Note that the lists are LLM-suggested gene names to explore (not expert-curated)
representing relationships found in published literature, may contain
hallucinated connections, and to report any to cbioportal@googlegroups.com.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Remove non-gene "1p/19q codeletion" entry from ODG in o2gl.json

"1p/19q codeletion" is a cytogenetic alteration (the oligodendroglioma marker),
not a gene, so drop it from the ODG gene list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Add a "How it works" method summary to the OncoTree2Genes page

Succinctly describe the pipeline: a Google Gemini model generates per-OncoTree
gene lists, which are validated against PubMed (NCBI E-utilities + a second LLM
checking abstracts) and cross-referenced with an expert-curated TCGA set.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5WyodUiNgnYgVkEXxR3jE

* Move OncoTree2Genes page under /tools/oncotree2genes

Groups it with the other standalone tool pages (mutation_mapper,
oncoprinter) under staticPages/tools/, and frees up /oncotree2genes
for a future tools listing page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Keep the OncoTree2Genes route top-level

mutation_mapper and oncoprinter both live under staticPages/tools/
but route at the top level rather than under /tools/ — match that
convention. The source file stays grouped under staticPages/tools/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Gate the study-view O2GL integration behind a feature flag

Add FeatureFlagEnum.ONCOTREE2GENES and check it in
StudyViewPageStore.o2glFilterGenes, the single computed that feeds
the gene-filter-dropdown option, the per-gene O2GL icon/tooltip, and
the table filtering — so all of it stays off until the flag is set
(?featureFlags=ONCOTREE2GENES). The standalone /oncotree2genes page
is unaffected and stays reachable without the flag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Address Copilot review comments on PR cBioPortal#5619

- Restrict the OncoTree iframe postMessage/message handling to its
  known origin instead of '*', and add rel="noopener noreferrer" to
  the external OncoTree/repo links (security review flagged both).
- Make contrastingTextColor() handle the rgb()/rgba() string a canvas
  2d context's fillStyle can normalize to, not just #rrggbb, so the
  O2GL icon text doesn't silently default to white on those colors.
- Rename the driver-genes filter option's data-test id away from
  "-mutsig" — it's shared by the CNA table's GISTIC option too.
- Stop fetching cancerTypes (and deriving the oncotree color/name
  maps) when O2GL isn't available for the study, avoiding an
  unconditional extra network request on every Study View load.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Fix stale Playwright e2e specs for the new gene-filter dropdown

These specs arrived via the master rebase (a parallel webdriverio ->
Playwright migration) and still assumed the old single-click filter
toggle, so CircleCI's active e2e suite (end-to-end-test-playwright/)
caught real regressions: clicking the OncoKB filter icon now opens a
dropdown instead of toggling the filter directly.

- studyview.spec.ts, local/study-view-screenshot-cancer-gene-filter.spec.ts:
  click the icon, then the OncoKB option, then the icon again to close
  the dropdown before the screenshot comparison.
- local/annotation-filter-menu.spec.ts: turnOffCancerGenesFilters now
  opens the dropdown and unchecks whichever gene-filter option(s) are
  active, generically, instead of assuming a single-click toggle.

Also gate o2glFilterMatchedOncotreeCodes behind FeatureFlagEnum.ONCOTREE2GENES
(same fix as the earlier cancerTypes one) — SummaryTab reads it
unconditionally, so without this the ONCOTREE_CODE clinical-data-count
fetch fired on every Study View load regardless of the flag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Address remaining code-review findings: OR filters, driver-genes state, O2GL persistence, SV gene-pair table

- MultiSelectionTable/StructuralVariantMultiSelectionTable: combine
  active gene filters (OncoKB/O2GL/driver-genes) with OR instead of
  AND — checking multiple independent checkboxes narrowed to their
  intersection, which didn't match the UI.
- Lift the MutSig/GISTIC driver-genes toggle out of MultiSelectionTable's
  component-local state into StudyViewPageStore (one boolean per gene
  table, mirroring the OncoKB/O2GL pattern), so it round-trips through
  session save/restore instead of resetting on remount.
- Wire O2GL and driver-genes filter state into ChartUserSetting /
  getChartSettingsMap / loadChartSettings / clearPageChartSettings, so
  they persist and restore like the OncoKB filter does. Also fixes a
  pre-existing gap where the SV gene-pairs table's own OncoKB filter
  was never actually serialized for saving.
- Wire O2GL into the SV gene-pairs table (StructuralVariantMultiSelectionTable):
  swap its single-toggle filter icon for the same GeneFilterDropdown
  used elsewhere, with an OncoKB + O2GL option (a gene pair matches
  O2GL if either gene is in the set).
- OncoTree2GenesIcon: resolve fill colors via CSSOM (element.style.color)
  instead of a canvas 2d context, removing the fallback path that
  defaulted annotation text to white when canvas is unavailable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Revert unrelated prettier reformatting picked up in the last commit

A local prettier --write touched three unrelated pre-existing lines;
restore their original formatting to keep the diff focused.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Let the user pick union vs intersection when multiple gene filters are checked

Mirrors the existing row-selection union/intersection toggle (same
SelectionOperatorEnum, same union.svg/intersection.svg icons, same
per-table-type localStorage persistence): once 2+ checkboxes are
checked in the gene-filter dropdown, a small row appears at the
bottom of the menu to switch between showing genes matching any
checked filter (union, the default) versus all of them
(intersection).

Wired into both MultiSelectionTable and the SV gene-pairs table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Address second Copilot review pass: iframe sandbox + icon accessibility

- Sandbox the embedded OncoTree iframe (allow-scripts allow-same-origin
  allow-fullscreen) to limit blast radius if the third-party embed is
  ever compromised, while keeping the postMessage integration and
  fullscreen feature working.
- Give OncoTree2GenesIcon's SVG an accessible name (role="img" +
  aria-label) and mark it non-focusable, since it conveys meaning
  (O2GL membership) that was previously invisible to screen readers.

(The third comment from this pass — o2glFilterMatchedOncotreeCodes
reading oncotreeCodeValues unconditionally — was already fixed in a
later commit before this review ran.)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Fix invisible O2GL icon text on named OncoTree colors like Gainsboro

Reading a detached element's style.color back doesn't resolve named
CSS colors the way canvas fillStyle does — it returns "Gainsboro"
unchanged instead of an rgb()/hex form, so parseRgb failed to match
and contrastingTextColor silently defaulted to white. White text on
Gainsboro (a light gray many OncoTree dedicatedColor values use) is
invisible, which is exactly what showed up testing against live data.

Revert to canvas-based normalization (proven to resolve named colors
correctly) while keeping the rgb()/rgba() regex support alongside hex,
verified against the live dev server with Puppeteer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Shorten the OncoTree2Genes-LLM display name to OncoTree2Genes

Drop the "-LLM" suffix from user-facing text (page title, heading,
intro copy, gene-filter dropdown label, iframe title, icon
aria-label) — the page's own copy already explains it's
LLM-generated. Leaves the two references to the actual upstream
GitHub repo (SuhasiniLulla/OncoTree2Genes-LLM) unchanged, since
that's its real name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Revert "Shorten the OncoTree2Genes-LLM display name to OncoTree2Genes"

This reverts commit 4bf931d.

* Move O2GL from pages/studyView/oncotree2genes to shared/oncotree2genes

Nothing about the icon, linkout/tooltip helpers, or the gene-mapping
data file is Study View-specific — this follows the codebase's
existing convention of putting cross-page code under shared/ rather
than nesting it in the one page that happens to use it first, so it's
ready to reuse from results view or patient view later without another
move. The routed /oncotree2genes page itself stays under
staticPages/tools/, matching mutation_mapper and oncoprinter.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Hide the new OncoKB gene-cell icon when ONCOTREE2GENES is off

The OncoKB cancer-gene icon in GeneCell is new — checked against
origin/master, the gene cell only ever showed a hover tooltip for
OncoKB status, never a persistent icon (only the MutSig/GISTIC
driver-gene icon pre-existed). Since it was added purely to make the
new multi-source icon row (OncoKB/O2GL/driver) consistent, gate it
behind the same feature flag as O2GL rather than changing gene-cell
appearance for everyone ahead of the flag flip.

Also bump the annotation icons' marginLeft from 1 to 4 — they were
hugging the gene name.

Verified with Puppeteer: 0 OncoKB/O2GL icons rendered with the flag
off, 5/3 with it on, on the same study.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

* Make the union/intersection combine-operator toggle keyboard-accessible

It had role="button" and tabIndex but only an onClick handler, so
keyboard users couldn't activate it. Add the same Enter/Space
onKeyDown pattern already used by the filter icon in this file.

Verified with Puppeteer: focusing the control and pressing Enter
toggles Union -> Intersection.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zpHfAkB2Zkn2QCZiLXtKL

---------

Co-authored-by: cannin <790284+cannin@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Portal#5695)

* Enhancing tooltip for more information and removing hardcoded values

* Enhancing tooltip by making it look like color by and fixing it to the right

* pretty fix

* Adhering to copilots suggested changes

* Renaming osMonthly to osMonths

* Rework embedding tooltip fields and remove unavailable backend call

- Drop the realEmbeddingData loader (fetchEmbeddingInStudyUsingPOST) since
  that backend endpoint isn't available yet; embeddings still load from the
  static datahub JSON.
- Make Patient ID, Sample ID, Position, Category, Cancer Type, Cancer Type
  Detailed and Sample Type fixed, always-shown tooltip rows (conditioned on
  patient vs. sample embedding and cohort membership) instead of a mix of
  hardcoded defaults and toggleable dropdown options.
- Generalize the "Tooltip fields" dropdown to offer every Gene, Map
  Attribute, and Clinical Attribute available in the study, grouped the
  same way as the "Color by" dropdown.
- Dedupe tooltip rows and label the Category row after whatever attribute
  is currently colored by.
- Fix the tooltip fields dropdown's broken horizontal-scroll styling and
  widen the tooltip box for longer values.
- Dev server: make devServer.host configurable via HOST and fix
  output.publicPath so deep-linked routes load their JS bundles correctly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Retrigger deploy preview

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Bump deck.gl to 9.3.11 to fix Metal shader compile error on Apple Silicon

@deck.gl/core@9.3.6's DECKGL_FILTER_COLOR shader hook (inout vec4 + struct
param) hits a known ANGLE Metal backend / Apple Metal compiler bug, causing
"no matching overloaded function found" and a blank embeddings canvas on
Apple Silicon Macs across browsers. Confirmed unrelated to this branch's
own changes (reproduces on unmodified upstream code too). Bumping to the
latest 9.3.x patch (9.3.11, still satisfying the existing ^9.1.x range)
resolves it; @luma.gl/* peers didn't need to move.

Also move Cancer Type / Cancer Type Detailed to the end of the tooltip's
fixed field order, after Sample Type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Fix tooltip dropdown perf/ordering, plot sizing, and driver annotations

- TooltipDropdown: switch to AsyncSelect with a capped (50/group), scored
  search, matching ColorSamplesByDropdown's pattern - the plain sync Select
  was rendering the full genome-wide gene list uncapped, making it load
  much slower than the color-by dropdown reusing the same data.
- TooltipDisplay: order dynamically selected fields by type (Clinical
  Attributes, then Map Attributes, then Genes) instead of selection order.
- EmbeddingsTab: gate tooltipGeneValueMaps on OncoKB/Hotspots/
  getMutationPutativeDriverInfo readiness, mirroring molecularDataForColoring -
  reading the mutation cache before annotations loaded was letting
  putativeDriver get cached as false, so genes added via the tooltip
  dropdown always showed as VUS regardless of actual driver status.
- EmbeddingsTab: replace the hardcoded 300px header-height guess in
  plotHeight with an actual ref + ResizeObserver measurement of the
  toolbar's bottom position, and drop the redundant viewportHeight*0.8 cap -
  fixes both scroll-required layouts (toolbar taller than guessed, e.g. an
  active filter bar) and leftover bottom whitespace.
- EmbeddingsTab: add left margin to the Tooltip fields wrapper so it isn't
  flush against the preceding checkbox when the toolbar doesn't wrap.
- ColorSamplesByDropdown: add an optional selectStyles passthrough prop;
  EmbeddingsTab uses it to match the Map/Tooltip fields dropdown height
  (34px/14px) - Color by previously used react-select's taller default.
- EmbeddingDeckGLVisualization: fix a circular height measurement bug -
  actualHeight was being "measured" from the container's own rendered
  height, which is itself driven by actualHeight, so a new incoming height
  prop was never actually applied after first mount; now synced directly
  from the prop. Also memoize the OrthographicView instance (previously
  recreated on every render) so DeckGL sees a stable view identity across
  hover/pin re-renders.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Add compact control stack and multi-panel split view to embeddings tab

Redesigns the Map/Color by/Tooltip fields toolbar into a compact
in-canvas control stack, and adds a Split view feature (up to 4
independent panels, each with its own map/color-by/tooltip selection,
fully synced to the URL via fixed per-panel param slots).

EmbeddingsTab.tsx becomes a thin wrapper managing panel count;
EmbeddingsPanel.tsx (renamed from the old EmbeddingsTab) holds the
per-panel state, parameterized by panelIndex for URL param naming.
EmbeddingDeckGLVisualization gets a renderControls render-prop so the
new EmbeddingControlStack component can replace the old toolbar
buttons without touching its mouse/lasso/export internals.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Redesign split-view controls: dedicated dropdowns, cross-panel sync, and export

Replaces the click-to-open fan-out popovers for Color by/Tooltip with
plain self-contained dropdowns matching the Map select (same border,
chevron, and menu-opens-below behavior), fixes a width bug where gene
coloring checkboxes could stretch the control column wider than
intended, and tightens their spacing.

Split view gets a "Lock panel viewports" toggle (default on once
multiple panels exist) that keeps every panel's pan/zoom in sync -
panning any one panel, not just the primary, now broadcasts to the
rest via a plain non-reactive holder so it doesn't force a re-render
of every panel on each frame. Export PNG now exports every open panel
at once instead of just the primary's. The legend's Total/Visible
Samples header and Configuration section now show only on the primary
panel to save space, its collapse state persists per panel via the
URL, and QC category visibility is shared across panels.

Also fixes two real bugs surfaced along the way: a MobX computed
caching bug where toggling the lock checkbox off silently failed to
re-render (converted the affected render path from a cached @computed
to a plain method), and rawPlotData unconditionally depending on the
store-wide driver annotation setting, which made changing Color by to
a gene on one panel force every other panel to recompute and
re-render regardless of its own coloring.

Reverts deck.gl to 9.3.6 (from 9.3.11) per current preference; this is
a known-flaky, environment-level shader compile issue on Apple Silicon
unrelated to app code, not a fix either way.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Bump deck.gl/luma.gl to 9.4.0 to fix WebGL shader compile failures

9.3.x's ScatterplotLayer shader intermittently fails to compile/link on
non-Metal software WebGL backends (SwiftShader), which luma.gl surfaces
by injecting a full-screen debug overlay with the raw GLSL source,
silently swallowing all pointer input to the embeddings panel underneath
it. 9.4.0 resolves it; luma.gl comes along transitively since deck.gl
9.4.0 requires ^9.4.0 peers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Add cross-panel selection filtering, Make Global, and a persistent status bar

- Redesign legend hide/select and lasso selection into a true cross-panel
  sample-identity filter: hiding/selecting a category or lassoing points
  in one panel now filters the same underlying samples in every panel,
  regardless of that panel's own coloring - not just matching by
  category name.
- Add a "Make Global" action: apply the current cross-panel filter (or
  lasso selection) as a real Study View custom selection affecting the
  whole page, plus a "Clear" button, both in a shared status bar above
  the panels. Legends and the status bar reset once applied globally,
  since filtering then happens upstream of the component.
- Move Pan/Select (shared across every panel) and, for the single-panel
  case, the Map dropdown into a persistent top bar, replacing the
  previous per-panel floating controls and the literal "similarity map"
  text with the live dropdown.
- Add an info/warning tooltip next to the status line explaining what an
  embedding is in plain terms, and dynamically reporting how many of the
  cohort's samples are actually part of the precomputed map (only shown
  when relevant, hidden once a selection is active).
- Show the visible/total count per legend category ("x / y") when a
  cross-panel filter is active, and give the legend a highlighted border
  while filtered.
- Remove the "Study Page Help" link specifically on this tab, since it
  doesn't cover the embeddings view.
- Fix a real perf regression from lifting Pan/Select into a shared prop:
  mobx-react's @observer makes the whole `this.props` object reactive as
  one unit, so any @computed reading `this.props.X` was getting
  needlessly invalidated by ANY prop change (including Pan/Select),
  cascading into a full ~50k-point plot data rebuild and a synchronous
  deck.gl GPU redraw on every click and lasso mouse-move. Cache the
  never-changing `store` prop as a plain field, and mirror the props
  that do need to stay reactive (hiddenSampleKeys, hiddenQcCategories,
  tooltipFields) into their own observables updated only when
  componentDidUpdate's prevProps snapshot shows they actually changed.
- Fix missing whitespace in the status bar sentence that produced
  "...embedded insimilarity map..." when the inline Map dropdown isn't
  shown.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Hide per-embedding sample counts from the status bar in multi-panel view

The "N samples embedded in [map] similarity map (constructed using N
samples)" sentence, its Map dropdown, and its explainer tooltip only
make sense for a single panel - each panel can have a different map
selected, so with 2+ panels open there's no single "the" map whose
counts/description belong in a shared status line. The numbers were
also silently last-write-wins across panels via the shared
onReportSampleCounts callback, so they could reflect whichever panel
happened to report most recently rather than any panel the user was
actually looking at.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Fix legend label wrapping, add data-test hooks, update e2e coverage

- Legend rows with long category names (e.g. "Breast Invasive Ductal
  Carcinoma") were wrapping to two lines while the count span stayed
  vertically centered against the whole wrapped block, landing beside
  the second line instead of next to the label. Truncate the label
  with an ellipsis (full name still available via title on hover) and
  keep the count on a single line instead.
- Add data-test hooks (embeddings-status-bar, embeddings-pan-button,
  embeddings-select-button, embeddings-clear-button,
  embeddings-make-global-button, embeddings-panel-count-N) so e2e
  tests don't have to match on button text/position.
- Update embeddings.spec.ts: the "Total Samples:/Visible Samples:"
  legend assertion is stale (that text moved to the shared status bar
  this session) - replaced with checks against the new status bar,
  plus new coverage for the multi-panel corner cases fixed this
  session: the per-embedding status sentence disappearing once a
  second panel is open, and a cross-panel selection filter (set from
  one panel) showing up in the shared status bar.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Fix flaky Show All/Hide All e2e test colliding with the legend's collapse button

The test located the Hide All/Show All toggle via
locator(LEGEND).getByRole('button').first() - the legend's own
collapse/expand chevron button (added since this test was first
written) sits earlier in the DOM and also matches, so the test was
clicking the chevron instead, collapsing the legend panel and
removing the actual toggle button it was trying to assert against.
Add a dedicated data-test hook to the toggle-all button and target
that directly. Confirmed against the PR's deploy preview: this was
the one remaining failure in embeddings.spec.ts, all 12 tests pass
with this fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Regenerate stale embeddings screenshot references

All 12 reference screenshots under embeddings-screenshot.spec.ts
predate this session's redesign (multi-panel controls, persistent
status bar, legend label truncation) and no longer matched the
current UI. Regenerated via the canonical Docker Playwright lane
(pnpm run test:docker:update, per end-to-end-test-playwright/README.md)
against this PR's deploy preview, so they're byte-stable and match
what CI will produce.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Address Copilot review comments: sample-level tooltip values, dead URL params

- getClinicalAttributeValueMap always returned the patient-aggregated
  value map, even for sample-level embeddings (one point per sample).
  For a sample-only attribute like Sample Type, that map has no entry
  keyed by patientId, so the tooltip row was silently blank. For
  sample embeddings, build a map keyed by uniqueSampleKey directly
  from the clinical data cache instead - matching how every other
  point lookup in this file keys sample embeddings.
- TooltipDisplay's clinical attribute lookup only ever tried
  point.patientId. Points from sample embeddings carry
  uniqueSampleKey (already populated by makeEmbeddingScatterPlotData),
  so prefer that, falling back to patientId for patient embeddings.
- Removed embeddings_panel{2,3,4}_tooltip_fields from the URL schema
  (StudyViewPageStore's StudyViewURLQuery and StudyViewURLWrapper):
  tooltip fields are deliberately shared across every panel via the
  single embeddings_tooltip_fields param (see EmbeddingsTab), so the
  per-panel variants were declared but never read or written anywhere
  - dead params that only obscured what state is actually persisted.

Verified the tooltip fix live: hovering a sample point with Sample
Type in the tooltip fields now shows its real value ("Primary")
instead of blank.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Simplify axis label to the map's name, drop the Y-axis label

The rotated Y-axis label ("<map name> 2") sat right where the Panels/
Lock-viewport controls now live and was effectively unreadable; the
numbered axis convention doesn't mean much to a non-technical audience
either. Keep a single X-axis label with just the map's name (e.g.
"Mosaic (2026) - H&E") instead of repeating it sideways for an axis
nobody reads.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Split panel locking into separate Lock Map and Lock Viewport toggles

Both default on. With Lock Map enabled, every panel uses the same map,
driven from a single dropdown in the status bar (each panel's own Map
row is hidden). Disabling it gives each panel its own independent Map
dropdown again, and the status bar's map summary hides itself since
there's no longer one map to report.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Trim excessive comments across the embeddings feature

Cut comment volume roughly in half across the touched files (e.g.
EmbeddingsPanel.tsx 362 -> ~125 comment lines, EmbeddingsTab.tsx
136 -> 39), removing ones that just restated what the following code
already makes obvious, and shortening the rest to their actual "why"
instead of multi-paragraph explanations. A couple were also stale
(referring to the legend's "Total/Visible Samples header", which was
already removed from the legend itself this session) and are now
either dropped or corrected. No behavior changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Update e2e test for Lock Map's default-on status bar behavior

The multi-panel test asserted the status bar always hides its
per-embedding sentence once a second panel opens - true before Lock
Map existed, but Lock Map defaults to on, so the status bar correctly
stays visible until it's explicitly disabled. Updated the test to
match, and added a data-test hook to the Lock Map button so the test
doesn't rely on button text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Remove dead-code duplicate publicPath assignments in rspack.config.js

Both branches of the isDev/isTest conditional were reassigning
config.output.publicPath to '/' - the exact same value the base
config object already sets unconditionally. Verified: the dev server
still starts, binds correctly, and the embeddings tab still loads and
renders with no regression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uirQqy8U3rajiDE5LfkJK

* Add gradient range editor with histogram and percentile clipping for numeric coloring

Consolidates numeric-coloring controls behind a single gear icon in the
legend: a draggable min/mid/max color range over a live value histogram,
quick/custom percentile outlier clipping, low/high color swatches, 2-color
presets, and perceptual (viridis/magma/plasma/inferno) scales. The plain
legend now shows a simple non-editable gradient with just the low/high
values, publication-style.

Also bumps two flaky embeddings e2e timeouts (Show All/Hide All click,
multi-panel status bar) that were outrunning their defaults against the
full 50k-sample cohort, and adds unit tests for the new gradient math
(seedLowHighColors, getGradientStops, makeGradientColorFn's mid-pivot
interpolation, pickPercentileRange).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012E3iMpRk28njveVybcEhTi

* Fix stale embeddings screenshot references and another flaky e2e timeout

The gear-icon legend consolidation changed the numeric-attribute legend's
size/contents (no more Hide All button, simplified gradient bar), so its
two screenshot references were stale - pulled the new "actual" images
directly from the failing CircleCI job's artifacts.

Also bumped the cross-panel selection filter test the same way as the
other two flaky timeouts fixed in the previous commit: hiding a category
across two open 50k-sample panels can outrun the default click timeout
on a loaded backend.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012E3iMpRk28njveVybcEhTi

* Fix remaining flaky timeout in the Lock Map multi-panel e2e test

Switching back to a single panel unmounts/remounts the 50k-sample
visualization, which can outrun the default 5s assertion timeout on a
loaded backend - same category of flakiness as the other timeouts fixed
in this test already, just on the two assertions after the panel-count
click that hadn't been bumped yet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012E3iMpRk28njveVybcEhTi

* Bump the last un-timed-out clicks in the embeddings e2e spec

The Lock Map button click itself (not just the assertions after it) was
still on the default 15s timeout, and the Clear-button click in the
"Selection active" test had no explicit timeout either - both recompute
visibility across the full 50k-sample point set synchronously, the same
class of slowness already fixed for every other interaction in this file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012E3iMpRk28njveVybcEhTi

* Condense multi-line comments to single lines across the PR

Trims every 3+ line comment block down to one concise line, per the
repo convention of comments explaining current intent rather than a
paragraph of history/rationale. Comment-only change - no code or
behavior touched. Also fixes one comment left stale by this session's
own log-scale removal (ColorSamplesByDropdown's `stacked` doc still
mentioned the log-scale checkbox).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012E3iMpRk28njveVybcEhTi

---------

Co-authored-by: i-am-leslie <ejehboss@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…bedded count (cBioPortal#5701)

The status bar's leading sample count and this parenthetical were showing
the same number whenever every cohort sample is part of the map, so drop
the parenthetical in that case instead of repeating it.


Claude-Session: https://claude.ai/code/session_012E3iMpRk28njveVybcEhTi

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@raylim
raylim force-pushed the feature/native-wsi-viewer branch from 349ac54 to 304d0e2 Compare September 15, 2026 15:03
@raylim

raylim commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Superseded by the WSI viewer foundation (cBioPortal#5708) and the resource-data stack (cBioPortal#5732). Closing; the branch feature/native-wsi-viewer is kept because the follow-up PRs #3-#7 still target it (their non-WSI changes are being audited separately).

@raylim raylim closed this Sep 30, 2026
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.