Skip to content

Request WSI access by resource identity; relate slides to their sequenced samples - #15

Closed
raylim wants to merge 214 commits into
masterfrom
codex/wsi-resource-data
Closed

raylim wants to merge 214 commits into
masterfrom
codex/wsi-resource-data

Conversation

@raylim

@raylim raylim commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Requests WSI access by resource identity and makes slides easier to read against their sequenced samples. Stacked on the WSI viewer foundation (cBioPortal#5708, branch codex/wsi-release-hardening). Against master, the diff also contains the foundation; compare with codex/wsi-release-hardening to see only this change.

Changes

  • Resource access: slide capabilities are requested with the (study, patient, resourceId, resourceDataId) tuple from the hierarchy.
    • Access targets follow cached, seeded, refreshed and cleared hierarchies.
    • A 404 after a reimport triggers one refresh and a retry.
    • Unknown slides never trigger a backend lookup.
  • Viewer links: /wsi/patient/:patientId?studyId=..&imageId=.. opens the named slide.
    • A slide hash takes precedence over imageId.
    • An unknown imageId shows a notice and the default slide.
    • Array.at is gone, so the configured TypeScript libraries are enough.
  • Slide ↔ sample: each sample group shows "sequenced d+7" and each slide "Proc 249 d before sequencing". The panel shows the Procedure, Acquired and Sequenced days. Sequencing days come from the patient's clinical events.
  • Tooltips: d0 is explained on every day label, and pathology and image-property values have tooltips (physical size, pixel spacing, match meaning, specimen).
  • Clinical Data tab: a readable pathology-slides table.
    • Columns: procedure, sample, days relative to sequencing, stain, match, specimen, viewable count.
    • Its Open action goes to the Pathology Slides tab already filtered.
    • The Pathology Slides tab now honours the link's stainFilter/sampleId/matchLevel/specimenKey, so the timeline links do too.
  • Timeline: pathology events use their sample's numbered, colour-coded icon (numbers de-duplicated when several samples share a day; unmatched events are grey) and a readable tooltip with "Open slides".
  • Tab order: Pathology Slides now comes before Files & Links.
  • Study Files & Links: the tab no longer downloads every slide resource. For MSK-IMPACT that was 812 MB of JSON.

Testing

  • Typecheck passes. patientView tests: 185. WSI viewer tests: 196.
  • Checked in the browser on the independent wsi-rd stack with the full MSK-IMPACT study: real tiles, viewer links, Files & Links, the Clinical Data table and its Open action, the timeline markers and tooltips, and the study pages.
  • Mocked Playwright: the chunk-retry spec fails only against the dev server, whose error overlay intercepts the Retry click.

🤖 Generated with Claude Code

inodb and others added 30 commits June 12, 2026 16:15
* Upgrade React 16 → 17

Bump react, react-dom, @types/react, @types/react-dom, and the pnpm
overrides for @types/react and react-is to the latest 17.x line. Swap
enzyme-adapter-react-16 for @wojtekmaj/enzyme-adapter-react-17 (the
community-maintained adapter; no official React 17 adapter was ever
published). Widen workspace package peer-dep ranges to include ^17.0.0.

Build, tsc, and all unit tests (main + workspace packages) pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Upgrade React 17 → 18

Runtime bump: react/react-dom → ^18.3.1, react-is → 18.3.1,
mobx-react → 7.6.0 (6.0.0 doesn't support React 18's rendering model).

Kept @types/react and @types/react-dom on 17.x (via direct deps and
pnpm overrides). React 18 removed implicit `children` from class
component and React.FC props types, which triggers dozens of
"Property 'children' does not exist" errors across this codebase.
@types/react@17 with React 18 runtime is a documented transition
strategy and keeps the diff focused on actual runtime changes.
@types/react bump is a separate, mechanical follow-up.

Enzyme adapter: @wojtekmaj/enzyme-adapter-react-17 →
@cfaester/enzyme-adapter-react-18 (no official React 18 enzyme
adapter was ever published; cfaester's is the community standard).

ReactDOM.render migrations (5 call sites):
- appBootstrapper.tsx: createRoot + memoize Root across HMR renders
- exposeComponentRenderer.ts: createRoot wrapped in flushSync
  (callers read DOM synchronously after render)
- MutationOncoprint.tsx (x2): renderToStaticMarkup (sync JSX → HTML
  string for tooltip, the previous dummy-element trick was already
  render-to-string; this is more direct and doesn't leak a root)
- TrackHeader.tsx: createRoot wrapped in flushSync (SVG DOM injection
  that must be synchronous so appendChild sees rendered content)

Type shims in typings/ (and packages/typings/ for workspace builds):
- react-if.d.ts: adds children to IfOptions / Then / Else. react-if@2
  types predate React 18's removal of implicit children.
- react-dom-client.d.ts: declares the react-dom/client module, which
  @types/react-dom@17 doesn't know about.

Workspace peer-dep ranges widened to include ^18.0.0 in the 5
packages that declare react peer deps.

Known regressions on main test suite (18 failures / 2033 tests,
all in enzyme tests that mount components and read DOM synchronously):
- MSKTabs.spec.tsx, Scrollbar.spec.tsx, LazyMobXTable.spec.tsx,
  GeneSymbolValidator.spec.tsx, GeneFilterMenu.spec.tsx
These are the expected fallout of React 18's concurrent rendering
vs. enzyme's legacy mount model. Workspace package tests (all 10
packages) remain green. tsc, buildModules, buildMain all clean.
Fixing the enzyme tests is a separate concern from the version bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix enzyme test regressions under React 18

testMain was 18 failures / 2033 after the React 17→18 commit. All in
5 enzyme test suites where mobx observable -> observer re-render ->
React commit is now async instead of synchronous. Fixes only touch
the test files.

Patterns used:

- GeneFilterMenu: shallow().dive() no longer works with the mobx-react
  7 @observer HOC shape. Switched to mount() with concrete selectors.

- Scrollbar: bumped test-side setTimeout from 3ms to 50ms. The
  component internally schedules a setTimeout(1ms) inside
  componentDidUpdate; with React 18's deferred commit that 3ms
  window closed before the internal timer + mobx re-render chain
  completed.

- GeneSymbolValidator: wrapped instance.forceUpdate() in act() and
  added wrapper.update(). React 18 no longer commits forceUpdate
  synchronously, so the immediate .text() read saw stale DOM.

- MSKTabs: added explicit delays (50ms) to the existing
  setTimeout(fn) calls that were implicitly relying on setTimeout(0)
  firing after the DeferredRender's internal setTimeout + the
  follow-up mobx -> React commit. For the first test in the file I
  polled up to 1000ms — something about warming up mobx-react in a
  fresh module means the first mount consistently needs ~250ms
  before the deferred render flips.

- LazyMobXTable: wrapped clock.tick() (lolex fake-timers) and the
  pagination callback invocations (clickPrevPage/clickNextPage/
  selectItemsPerPage) in act(). lolex advances fake time to fire
  the debounced setTimeout, which calls the mobx action — but the
  observer's React re-render is scheduled through React 18's own
  scheduler which lolex doesn't mock. act() drains that scheduler
  synchronously.

testMain: 2022 passed / 13 skipped / 0 failed (matches the React 16
baseline). Workspace package tests all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Guard fetchPatients against empty samples

Under React 18's concurrent rendering, the `patients` remoteData in
ResultsViewPageStore briefly evaluates with an empty samples result
before the full list populates. fetchPatients() then POSTs
{uniquePatientKeys: []} to /api/patients/fetch, which the backend
rejects with 400 "interceptedPatientFilter size must be between 1 and
10000000". The global error handler pushes this onto appStore.siteErrors,
appStore.isErrorCondition flips true, and the Container's top-level
If/Then/Else swaps all route content for ErrorScreen("Oops. There was
an error retrieving data.").

Net effect on e2e: almost every [data-test=...] selector on results/
study/patient pages times out — not because the component is broken
but because the page has been replaced by ErrorScreen. That cascade
explains 9 of the 11 e2e_localdb spec failures on the React 18 commit.

Fix returns an empty Patient[] synchronously when samples is empty,
matching the semantics the backend rejects (no patients to fetch).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix MobX @action-on-lifecycle crashes under mobx-react 7

Under mobx-react 7 + mobx 6, @action decorated directly onto
React lifecycle methods (componentDidMount, componentWillReceiveProps)
throws at construction time with:

  [MobX] Cannot decorate 'componentDidMount': action can only be
  used on properties with a function value.

The reason is that mobx-react 7's @observer installs its own
componentDidMount on the prototype, which makeObservable() then sees
as a non-function descriptor when the @action annotation is processed.
In mobx-react 6 the ordering was such that @action always saw the
original function.

Two sites in this repo used that pattern:

  - packages/react-mutation-mapper/src/component/lollipopPlot/Domain.tsx
    (@action componentDidMount — the crash that kept the entire
    mutations tab on /results/mutations from mounting, blanking the
    page for 10s+ and timing out every e2e selector downstream)

  - src/shared/components/lazyMobXTable/LazyMobXTable.tsx
    (@action componentWillReceiveProps — same crash pattern, would
    trigger on any LazyMobXTable prop change)

Both rewritten to call the mutation inside runInAction() from the
plain lifecycle method. Semantics are identical; the decorator form
is what mobx-react 7 can no longer support.

Also guards AnalysisStore#getClinicalData against empty `entities`
(mirrors the fetchPatients guard from the previous commit — under
React 18's concurrent rendering, inherited remoteData in
ResultsViewPageStore briefly evaluates with empty samples before
populating, and the backend's /studies/{id}/clinical-data/fetch
rejects empty ids with 400 "ids size must be between 1 and 10000000",
tripping the global ErrorScreen).

Reproduced + verified against the dev server pointed at
www.cbioportal.org: /results/mutations no longer shows the ErrorScreen
and /patient pages continue to render correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Drop makeObservable(this) in LazyMobXTable

The previous commit rewrote `@action componentWillReceiveProps` into
a plain lifecycle method wrapping the mutation in runInAction — which
removed the only @-decorator on the LazyMobXTable class itself (all
other observables live on the sibling LazyMobXTableStore, decorated
there). With no decorators left to annotate, makeObservable(this)
throws at every mount:

  [MobX] No annotations were passed to makeObservable, but no
  decorator members have been found either
    at new LazyMobXTable (LazyMobXTable.tsx:972)
    at new MutationTableComponent (MutationTable.tsx:233)

That broke 40 unit tests and every e2e page that mounts a
MutationTable (~all of them). The class itself genuinely has nothing
observable — the store holds the state — so the correct fix is to
drop the makeObservable call, not to reintroduce a dummy annotation.

testMain back to 2022 passing / 0 failing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Upgrade @types/react 17 → 18

Previous commit (b99cb5a) intentionally held @types/react and
@types/react-dom on 17.x with React 18 runtime because React 18's type
package removed implicit `children` from class-component / React.FC
props, which triggers ~150 errors across this codebase. That deferral
is cleaned up here as a mechanical follow-up.

Changes:

- package.json: @types/react → ^18.3.27, @types/react-dom → ^18.3.7,
  and same in the pnpm `overrides` block.
- Added `children?: React.ReactNode` to the Props interfaces of every
  class component (and a couple of React.FC sites) that render
  `this.props.children` / destructure `children` without declaring it:
  IMSKTabProps, IMSKTabsProps, DeferredRender inline props,
  IFadeInteractionProps, IHeaderIconMenuProps, ISampleInlineProps,
  ILoader, IGeneSelectionBoxProps, IGeneSymbolValidatorProps,
  GeneSymbolValidatorMessageProps, IChartContainer, IFilterHeaderProps,
  IGeneModalProps, IInfoBeaconProps, ILabeledCheckboxProps, IPageLayout,
  ICancerTreeCheckboxProps, StudyLink's inline props, DelayedRender,
  TabContentWrapper in OncoKbCardBody.
- React.SFC → React.FC in MiniOncoprint; React.StatelessComponent →
  React.FunctionComponent in exposeComponentRenderer (both symbols
  removed in @types/react 18).
- react-if.d.ts (already introduced in prev commit) now needed only
  for workspace package builds; kept.
- typings/react-dom-client.d.ts removed — @types/react-dom@18 ships
  types for the `react-dom/client` entry point natively.
- New typings/third-party-children.d.ts augments a handful of third-
  party component Props that lost `children` under @types/react 18:
  react-router v5's Router/Switch/*Router, react-draggable's
  DraggableProps, react-grid-layout's ReactGridLayoutProps,
  @types/react-bootstrap's OverlayTrigger/Overlay namespaces.
- Some @types/react-bootstrap Props types are declared inside nested
  namespaces that resist external augmentation; at those call sites I
  import the component with an alias and re-export it as `any` with a
  one-line reason comment:
  OverlayTrigger in GroupCheckbox and ClinicalTrackColorPicker, Overlay
  in GroupSelectorButton, DropdownButton in NonClosingDropdown (also
  needed for `open`/`onToggle` props the 0.32 types omit entirely).
- Same pattern for react-overlays Portal in ScatterPlotTooltip,
  TimelineTracks, WaterfallPlotTooltip — imported then cast to a local
  `React.ComponentType<{container, children}>` alias.
- SortableElement/SortableContainer HOCs from react-sortable-hoc strip
  the wrapped component's prop types. Re-asserted them at each export:
  GroupSelectorButton, GroupSelectorButtonList, CollapsedGroupsButton,
  SelectAllDeselectAll.
- SVG `textAnchor` / `dominantBaseline`: React 18 types tightened the
  allowed literal unions. Cast through the matching
  React.SVGAttributes<SVGTextElement>['textAnchor' | 'dominantBaseline']
  in Lollipop and TablePlot.
- FeatureInstruction's `content: Element | string` → `React.ReactNode`
  (the `Element` here was the DOM `Element` global, which is no longer
  assignable to ReactNode in R18 types).
- MSKTabs.tsx React.Children.forEach callback signature tightened in
  R18 types; loosened the local cast to `any` since the body already
  guards on `tab.props.id`.
- ClinicalInformationSamplesTable and ContextUtils: tightened
  `ReactNode` / context types — cast at the render/read site.
- TruncatedTextWithTooltipSVG: cast the `{...rest}` spread on the SVG
  `<text>` because `verticalAnchor`/`textAnchor` in its Props are
  declared as plain `string` instead of the SVG-attr literal unions.

Local verification:
- `tsc --noEmit` clean
- `pnpm run buildMain` — rspack compiled 0 errors, 17 warnings
  (same warning set as before)
- `pnpm run buildModules` — all 10 workspace packages green
- `pnpm run testMain` — 2022 passed / 13 skipped / 0 failed
- `pnpm run testPackages` — all 10 packages green

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Include react-if typing augmentation in oncokb-frontend-commons test config

The prior commit's @types/react 18 bump broke unit_tests_packages for
oncokb-frontend-commons only. Its tsconfig.test.json explicitly narrows
the includes to just ../typings/file.d.ts, so the react-if.d.ts
augmentation that adds `children?: ReactNode` to IfOptions never
entered the ts-jest type-check pass.

Main-app testMain was fine because its tsconfig picks up the typings
root via `./typings/**/*`; the other workspace test configs were fine
because they either don't touch react-if or don't override includes.
The rollup build of this same package already passes — only the jest
test transform was missing the file.

Adds ../typings/react-if.d.ts to the explicit include list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix table "Columns" dropdown not opening under React 18

ColumnVisibilityControls renders a react-bootstrap 0.31 <Dropdown> whose
<Dropdown.Menu> wraps its content in react-overlays' RootCloseWrapper,
which attaches a document-level click listener while the menu is open.
Under React 17+ event delegation (handlers bound to the root container,
not document) React flushes the toggle click's state update synchronously
before the native event finishes bubbling, so the menu mounts mid-click
and the very same click reaches the freshly-attached document listener,
which immediately closes it again. React 18's automatic batching collapses
the open->close pair so the menu never even renders open. (Keyboard
ArrowDown opens fine — it dispatches no document click.)

Net effect: every "Columns" menu (patient/results mutation, CNA and
struct-var tables, plus the mutation-mapper tool) was dead — the
checkboxes stayed in the DOM but never visible. This broke ~9 e2e specs
(namespace columns, ASCN columns, VAF-plot gene-filter, dbSNP column,
gene-panel-modal-from-gene-panel-id) that open the menu to toggle a column.

Fix: stopPropagation on the toggle's click so the opening click never
reaches RootCloseWrapper's document listener (no self-close on open),
while the toggle's own handler still flips it shut on a second click and
genuine outside clicks still close it. Verified against production
(React 16) with headless Chromium: the menu opens on click, multi-select
keeps it open, a second toggle click closes it, and outside clicks close it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* e2e: settle lollipop hit-zone before clicking to select (React 18)

The lollipop plot's clickable target is a single shared hit-zone <svg>
overlay that LollipopPlot repositions over the hovered lollipop — and
wires that lollipop's onClick onto — in response to a MobX observable
update driven by onMouseOver. Under React 18 that observer re-render is
committed asynchronously, so a click issued immediately after the pointer
arrives lands before the overlay (and its onClick) is in place: the
selection silently no-ops.

This is not user-facing — a human hovers and then clicks with a natural
delay — but Playwright's back-to-back move+click races the commit. Two
specs that click a lollipop to *select* (rather than just hover for a
tooltip) flaked out:
  - "filters table with lollipop selection"
  - fisher exact "...dynamically changes when filtering and selecting"

Hover and let the overlay settle before the selecting click. Verified on
the results-view mutation lollipop with headless Chromium: an immediate
click leaves the table at 25 rows; hover-settle-click filters it to 10.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* e2e: settle lollipop hit-zone in fisher pagination test too

The 'displaying table header and pagination status text' fisher spec also
selects by clicking a lollipop and hit the same React-18 async hit-zone
reposition race. Apply the same hover-settle-then-click as the sibling
fisher/lollipop specs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* e2e: extract selectLollipop helper to de-dup hit-zone comment

The three lollipop select-click sites each repeated the same paragraph
explaining the React-18 async hit-zone reposition. Move the hover-settle-
click into a single selectLollipop(page, selector) helper that carries the
explanation once; the call sites are now one line each.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix oncoprint losing heatmap sort on column-mode switch under React 18

Switching the oncoprint between sample and patient mode dropped any active
heatmap-track sort, reverting the columns to the default alteration sort
("heatmap sort 6 — back to patient mode" e2e screenshot regression).

Root cause: the track-spec props (genetic/heatmap/clinical/...) are
remoteData-backed and momentarily resolve to empty while their data
recomputes for the new column mode. Under React 18's more granular async
rendering that transient empty render is committed on its own, so
Oncoprint.refreshOncoprint runs transition() with zero tracks and
oncoprintjs removes every track; one tick later the real tracks return but
now diff as brand-new (no matching prev keys) and are re-added fresh with
default sort directions. Heatmap track sort direction lives only in
oncoprintjs (unlike clinical tracks it is never persisted to React state),
so the re-add discards it. React 16 never committed that intermediate
empty state, so tracks updated in place and the sort survived.

Skip a refresh whose track set is entirely empty when the previous render
had tracks — an oncoprint always has at least one gene track, so an
all-empty set following a non-empty one is always a transient pending
state, never a real one. Tracks then update in place across the mode
switch and oncoprintjs-only state (heatmap sort directions) is preserved.

Verified with headless Chromium against the gbm_tcga_pub heatmap oncoprint:
sort a heatmap track Z-a, switch to patient mode, and the track keeps sort
direction -1 with stable track IDs — matching production (React 16), where
before the fix all tracks were rebuilt and the sort reset to 0. All 262
oncoprint unit tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Address review feedback and trim change-narration comments

Copilot review fixes:
- Widen `mobx-react` peer range to `^6.0.0 || ^7.0.0` in the four workspace
  packages (app runs on mobx-react 7.6.0 for React 18).
- Bump `react-test-renderer` / `@types/react-test-renderer` to 18 to match
  React (was an unused 17.x with a react@17 peer).
- exposeComponentRenderer: reuse one `createRoot` per mount node via a
  WeakMap instead of creating a root on every call.
- NonClosingDropdown: cast the DropdownButton to
  `React.ComponentType<DropdownButtonProps>` instead of `any` so `open` /
  `onToggle` stay type-checked.
- MSKTabs: guard the `React.Children.forEach` callback with
  `React.isValidElement` before reading `.props.id`.
- LazyMobXTable.spec: drop the unused `flushSync` import.

Also trim verbose comments that narrated the React-18 change rather than
the current intent, and document the comment convention in
copilot-instructions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix misleading comment

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: alisman <lisman.aaron@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
 - cbioportal-clinical-timeline@0.4.5
 - cbioportal-frontend-commons@0.6.5
 - oncokb-frontend-commons@0.1.5
 - react-mutation-mapper@0.9.6
 - react-variant-view@0.4.6
…tal#5613)

* fix query page search test and data type filter dropdown bug

* fix data type filter tests
…ioPortal#5615)

The hg38 IGV reference in defaultGrch38ReferenceProps() pointed cytobandURL
at a bare S3 directory ('.../annotations/') instead of an actual cytoband
file. That URL returns HTTP 403, so igv.js fails to build the genome and
igv.createBrowser() rejects. Because initBrowser() only had a success
handler, the rejection was swallowed and no tracks were ever loaded, leaving
the patient-view Genomic Overview empty for hg38 studies (e.g. the new
ccle_broad_2025 study) even when mutation and CNA-segment data exist.

- Point the hg38 cytobandURL at the working file igv.js itself uses for hg38:
  igv.org.genomes/hg38/annotations/cytoBandIdeo.txt.gz
- Add a rejection handler to igv.createBrowser() so a future reference-load
  failure surfaces in the console instead of silently rendering nothing.

Co-authored-by: Ubuntu <ubuntu@vps-870e202d.vps.ovh.us>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sion) (cBioPortal#5620)

## Root cause

React 18 moved event delegation from `document` to the React root
container. This broke react-bootstrap's `RootCloseWrapper`, which adds
an outside-click listener to `document` to close the dropdown.

In React 16, React's own listener was at `document` (the final bubble
target). Per the DOM spec, listeners added to the *current dispatch
target* during an event do not fire for that same event — so the
dropdown stayed open after clicking the toggle.

In React 18, React's listener fires at the root div (an intermediate
element). `RootCloseWrapper` adds its listener to `document` during
React's commit phase. The click event then *continues bubbling* up to
`document`, where the newly-registered listener fires, sees the click as
"outside", and immediately closes the dropdown. The open→close cycle
completes within the same frame, so the user sees nothing.

## Fix

**`src/appShell/App/PortalHeader.tsx`**
- Convert the uncontrolled `Dropdown` to controlled mode, driving
  `open` via React `state` (avoids reliance on `uncontrollable` HOC).
- Defer `setState(true)` by one tick (`setTimeout 0`) when opening so
  that `RootCloseWrapper` only attaches its document listener after the
  triggering click has fully dispatched. Closing remains synchronous.

**`src/shared/components/dataAccessTokens/DataAccessTokensDropdown.tsx`**
- Add `key={l.id}` to list items to fix React key warning.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix tooltip for uncalled mutations in patient view

The tooltip previously showed 'Mutation not detected' for both
PROFILED_WITH_READS_BUT_UNCALLED and PROFILED_BUT_NOT_MUTATED statuses.
Now uncalled mutations correctly display 'Mutation uncalled' to
distinguish them from mutations that were truly not detected.

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

* Fix tooltip showing wrong sample's read counts for uncalled mutations

When a mutation is called in one sample but absent/uncalled in another,
the tooltip for the 'not detected' sample was incorrectly showing the
called sample's read counts. This happened because the noData path in
makeMutationHeatmapData stores a mutation object from mutationsByKey
(which belongs to a different sample), and the tooltip handler was
unconditionally computing VAF from that wrong-sample mutation.

Fix: only compute vafReport from d.mutation when the datum's status
indicates per-sample data (MUTATED_WITH_VAF or
PROFILED_WITH_READS_BUT_UNCALLED). For PROFILED_BUT_NOT_MUTATED, pass
null so the tooltip shows 'Mutation not detected' without misleading
read counts from another sample.

Also adds test coverage for mutationTooltip with cases based on real
patient IM-GBM-33 data from glioma_msk_2018, plus uncalled mutation
test cases in MutationOncoprintUtils.

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

* Show read counts in tooltip when uncalled mutation data is available

Previously, uncalled mutations with 0 alt reads were filtered out
entirely, causing the tooltip to fall back to a mutation object from
a different sample (showing wrong/misleading read counts) or no counts
at all. Now these entries flow through the main processing loop as
PROFILED_BUT_NOT_MUTATED with their own per-sample read data preserved.

The tooltip uses a simple sampleId match to determine if the mutation
object belongs to the current sample, only showing read counts when
it does. This means:
- Called mutation in sample A: shows its VAF and read counts
- Uncalled (0 reads) in sample B: shows 'Mutation not detected (VAF: 0.00 (0 reads of N total))'
- Truly absent (no uncalled data): shows 'Mutation not detected'

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

* fix: use linear scan for track tooltip resolution in oncoprintjs

The binary search in getOverlappingCells assumes cell_tops values are
monotonically increasing when indexed by the tracks array order. During
async clustering transitions, getTracks() and getCellTops() can briefly
be out of sync, causing the binary search to resolve the wrong track.

This manifested as flipped tooltips in the transposed (MUTATION_TRACKS)
mutation heatmap view. Replace the binary search with a linear scan that
explicitly checks containment bounds for each track. The number of
visible tracks is small enough that the performance difference is
negligible.

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

* fix: handle null vafReport in uncalled mutation tooltip

Remove non-null assertion on vafReport in the
PROFILED_WITH_READS_BUT_UNCALLED case. When vafReport is null, show
plain 'Mutation uncalled' without misleading read counts.

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

* refactor: address review feedback

- Use binary search with linear fallback in getOverlappingCells for
  better performance on large oncoprints while preserving correctness
- Simplify redundant else-if to plain else in MutationOncoprintUtils
- Clarify test comments about simplified read counts vs real data

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
 - oncoprintjs@6.1.4
The Chat (cBioAgent) tab was gated behind the client-side CHAT feature
flag (set via ?featureFlags=CHAT or localStorage), so MSK users never
saw it by default. Show the tab unconditionally when app_name is
'mskcc-portal'; other instances (e.g. public-portal) remain behind the
CHAT feature flag, so their behavior is unchanged.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* add mrna violin plot chart to study view

* fix description

* clean up chart layout and styling

* additional layout and styling improvements

* change violin plot color to match other charts in summary page
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.4.4 to 7.29.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.29.6/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-version: 7.29.6
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix renders cnsegments tab test

* create new helper for waiting for igv rendering
* stabilize exclude custom driver tiers test

* remove 20s visbility timeout
…tal#5548)

* Improve gene specific chart labels and group name formatting

* Improve gene specific chart labels and group name formatting

* Remove unwanted build and config files
…th Genome Nexus annotation (cBioPortal#5493)

* Add genomic location input format (chr/start/end/ref/alt) to Oncoprinter with Genome Nexus annotation

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/7c2a785d-4bc8-4b28-aa42-f4ea8eaabe57

Co-authored-by: dippindots <15748980+dippindots@users.noreply.github.com>

* Address code review: add comments to genomicLineToType2 and make genome build requirement more prominent in help

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/7c2a785d-4bc8-4b28-aa42-f4ea8eaabe57

Co-authored-by: dippindots <15748980+dippindots@users.noreply.github.com>

* Support optional Cancer_Type column in genomic location input format (Format 3)

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/3d477042-6508-4f2a-b055-d6a8b5c74d8f

Co-authored-by: onursumer <3604198+onursumer@users.noreply.github.com>

* Fix tab-delimited parsing to support multi-word Cancer_Type values

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/63a68d50-e86f-4006-a5a1-ac87223a1016

Co-authored-by: onursumer <3604198+onursumer@users.noreply.github.com>

* Fix help text: move Format 3 below type-2 definitions, keep columns on one line, add type-3 column table

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/3dd8bf7b-0e7e-437e-be36-57e8f522d4ef

Co-authored-by: onursumer <3604198+onursumer@users.noreply.github.com>

* Update src/pages/staticPages/tools/oncoprinter/OncoprinterStore.ts

pass `isoformOverrideSource` from server config

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

* De-duplicate genomic locations before Genome Nexus POST, use genomicLocationString for consistent keys, add isoformOverrideSource, surface annotation errors

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/327a24ce-a1e5-4f65-b1cc-55d5ee34850d

Co-authored-by: onursumer <3604198+onursumer@users.noreply.github.com>

* Apply suggestion from @Copilot

Throw an error if unable to resolve genomic input

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

* Allow 7-column genomic rows unconditionally, not just when a Cancer_Type header is detected

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/40caebd3-90c9-42f7-a0f5-da50ab2b68b6

Co-authored-by: onursumer <3604198+onursumer@users.noreply.github.com>

* Fix TS1135 build error: remove duplicate orphaned lines.map block in resolvedGeneticInputLines

Agent-Logs-Url: https://github.com/cBioPortal/cbioportal-frontend/sessions/04dbe62d-0ffb-408c-a128-e029e315a02f

Co-authored-by: onursumer <3604198+onursumer@users.noreply.github.com>

* Enhance Oncoprinter functionality: deduplicate sample rows, handle missing samples, and improve column width management

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dippindots <15748980+dippindots@users.noreply.github.com>
Co-authored-by: onursumer <3604198+onursumer@users.noreply.github.com>
Co-authored-by: Onur Sumer <s.onur.sumer@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add stacked bar chart option for generic assay tracks (#10747)

Adds a "stacked bar chart" visualization for generic assay tracks
(composition + absolute modes), shared palette across paired profiles
that describe the same cell types, a single legend when both paired
tracks are visible, and fixes two pre-existing crashes in oncoprintjs
(cluster-sort undefined length, addTrack race in label_view).

Composition mode (each bar sums to 100%) and absolute mode (bars
scaled to max total, bottom-anchored) reuse the existing STACKED_BAR
rule set used by the Mutational Spectrum clinical track, so rendering
matches the existing stacked-bar track.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix WebGL frustum-clipping bars for stacked tracks with >5 shapes

The shader packs the shape-list index as gl_Position.z. The ortho
projection's near plane was -5, mapping z_index=6..9 below NDC_z=-1
and getting frustum-clipped. This is only a visible bug for stacked
tracks with 7+ categories — Mutational Spectrum (6 cats) stayed just
inside the frustum, but the new generic-assay stacked-bar track used
10 cell-type categories and rendered at ~60% height (last 4 rects
clipped).

Widen near to -1000 so z_index has ~1000 shapes of headroom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Sort stacked-bar tracks by a picked category, suppress redundant group header

- Add "Sort by <category>" items to the stacked-bar track menu. Selecting
  one sets the track as primary sorter with a descending-by-value
  comparator; "Sort by total (default)" clears it. Persists via URL
  param `generic_assay_stacked_sortby=<profileId>:<entityId>`.
- Skip the big track-group section header (and its Cluster / Don't-cluster
  options) when a profile is displayed as a stacked-bar track — it's a
  single-row track that already carries its label, and cluster doesn't
  make sense for a single stacked track.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Option to render split generic-assay rows as bar charts instead of gradient

Each entity gets its own row (as before) but the heatmap gradient is
replaced by a bar whose height is proportional to the value, using the
BAR rule set (same machinery as the clinical "number" track). Toggle
from the per-row track menu: "Show as bar chart" / "Show as heatmap
gradient". Persists via URL param \`generic_assay_bar_profiles\` (set of
profile IDs, semicolon separated).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Use white-to-dark gradient for non-negative generic-assay tracks

Previously fractions and counts rendered with a dark-blue-at-zero
gradient (`[darkBlue, lightBlue, lightRed, darkRed]` when pivot in
middle), which left a cold blue sliver at zero and made low values
read as "absence of signal, blue" rather than "absence of signal,
background". When leftBoundaryValue >= 0 we now skip the blue half of
the scale entirely and use `[white, darkRed]` (or `[white, lightRed,
darkRed]` if a pivot falls inside the data range). Negative-valued
tracks (log2 ratios, etc.) still use the blue-to-red scheme.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Nested "Sort by" submenu for stacked-bar tracks

Replaces the 11 flat "Sort by <cat>" items with a single "Sort by ▸"
parent that reveals the category list on hover, unclutters the track
menu. Adds optional \`children?: CustomTrackOption[]\` to
CustomTrackOption; when present the option renders as a hover-
expanding parent instead of a leaf.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* "Chart type" submenu + hide absolute mode for fraction-like profiles

- Collapse all chart-type toggles (separate heatmap / separate bars /
  stacked composition / stacked absolute) under a single "Chart type ▸"
  hover submenu. Current selection marked with ✓.
- Detect fraction-like profiles (max per-sample total <= 1.01 across
  all entities in the profile) and hide the "Stacked bar (absolute)"
  option for them — absolute mode on fractions produces identical
  100% bars, so it's meaningless.
- Unified setGenericAssayChartType action atomically toggles both
  stacked and bar URL params so transitions between the four view
  types don't leave inconsistent intermediate state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Hide default sort items on stacked-bar tracks; relabel default sort

The stacked-bar track menu exposes a "Sort by >" submenu for picking a
category, so the default "Sort a-Z / Sort Z-a / Don't sort" items were
redundant. Added a sort_direction_menu_visible track param in oncoprintjs
to gate rendering of those items while leaving programmatic sort intact.

Also relabeled the default sort option to "Dominant category (default)"
since the comparator sorts by dominant category + proportion, not by a
total (which is always 1 for fraction-like data).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix sort-by on mobile + stacked-bar track menu touch support

Two related issues surfaced when using the generic-assay stacked-bar
track menu on a phone:

1. Sort-by category never applied. Root cause: the MobxPromise that
   builds the stacked-bar track specs read oncoprint.genericAssayStackedSortBy
   after an `await`, so MobX stopped tracking it and the promise never
   re-invoked when URL state changed. Snapshot the observable before the
   first await to restore reactivity.

2. Menu items (Move up, Move down, Sort by submenu children, etc.) did
   not respond to taps on touch devices. Native click often doesn't fire
   on <li> elements on iOS Safari unless touch-action is explicit. Added
   touch-action: manipulation to remove the 300ms delay, and attached a
   touchend fallback alongside click with per-handler debounce. Also
   closes the outer dropdown when a submenu child is selected so the
   effect is visible.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Anchor the sort-by category at the bottom of each stacked bar

When a user picks a category to sort by, they're asking to compare that
dimension across samples. Leaving the category mid-stack makes comparison
hard because each bar's top edge drifts. Reorder the stack so the picked
category renders at the bottom — every bar shares the same baseline, and
the visual gradient reads cleanly.

Delta detection also rebuilds the rule set on sort-by change so the new
visual order takes effect without a full track re-add.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Add "Select all" in track picker and "Total" sort for absolute stacks

Two small additions to the oncoprint UI:

- GenericAssaySelection gains an optional selectAllThreshold prop.
  When set (TracksMenu passes 25), a "Select all" button appears next to
  the submit button — but only if the profile has few enough entities to
  make a one-click bulk-add reasonable. Larger profiles (hundreds of
  entities) keep the old behavior so users aren't one tap away from
  flooding the oncoprint.

- Stacked-bar tracks in absolute mode get a "Total" entry in the
  Sort by submenu, above the per-category list. It orders samples by
  the sum of all category values descending. Intentionally hidden in
  composition mode, where every bar totals 1 and a total-sort is a
  no-op. Uses the sentinel "__total__" for stackedBarSortByCategory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Let Move up/Move down cross groups when the track is alone in its group

Previously, Move up/Move down in the track menu only reordered tracks
within their containing group. That's fine when a group has siblings,
but stacked-bar generic-assay tracks render as a single-track group
without a header — so the user sees a track sitting next to genes and
clinical rows and expects Move up/Down to reorder it past them, only to
find the buttons were no-ops.

Added a swapTrackGroups(i, j) pair on the model + Oncoprint. When the
track has no siblings in its group, Move up/Down now swaps the whole
(single-track) group with its neighbor. Within-group behavior is
unchanged when siblings exist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Restore Sort a-Z / Z-a / Don't sort items on stacked-bar tracks

Previously hidden because the new "Sort by" submenu looked like enough,
but a-Z/Z-a actually flips the direction of whichever comparator is
active (including the Sort-by-category one) — useful and distinct from
picking the sort key. Removed the now-unused sort_direction_menu_visible
flag introduced earlier in this branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix stacked-bar a-Z/Z-a direction and move Chart type to menu bottom

Sort-direction fix: the category/total comparators were written descending
(largest first) with init_direction=1, which flipped the cbioportal a-Z
= ascending convention. Sort a-Z ended up showing largest values first
and Sort Z-a showed smallest — inverted from what the labels imply.

Now the comparators sort ascending and the picked-category default uses
direction=-1, so:
- Sort a-Z → smallest value first (matches label)
- Sort Z-a → largest value first (matches label)
- Picked category default → largest first (what the UI wants initially)

Menu reorder: Chart type ▸ moves to the bottom of the stacked-bar track
menu with a separator above it. Everything else is sort-related; the
separator groups them visually and puts the less-frequently-used
rendering-mode toggle out of the way.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Revert "Let Move up/Move down cross groups when the track is alone in its group"

This reverts commit 67bfb79.

* Don't gray out Move up/down for single-track groups

Move up/down were disabled whenever the track's group was flagged as
clustered, even for groups with a single track — where clustering is a
no-op and the grayed items just look broken. Require > 1 tracks in the
group before considering the clustered flag a reason to disable moves.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Move up/down on stacked-bar tracks reorders within the generic-assay space

Move up/down on a stacked-bar track is now a real reorder: the two
generic-assay profiles' track-group indexes swap via a new
swapGenericAssayProfileOrder action. The track spec keys include the
current trackGroupIndex so the delta layer remove/re-adds tracks in the
new groups, keeping React state and the oncoprintjs model in sync — no
more desync on a later unstack.

Items gray out at the limits: Move up is disabled when the profile is
already at the top of the generic-assay section, Move down when it's at
the bottom. Crossing into the hardcoded gene (1) or clinical (0) group
is still out of scope; swap is limited to profiles that share the
dynamic generic-assay index space, which keeps the change local.

Plumbing: oncoprintjs gains on_move_up / on_move_down callback overrides
and move_up_disabled / move_down_disabled flags on the track spec;
ICategoricalTrackSpec gains the same (onMoveUp / onMoveDown /
moveUpDisabled / moveDownDisabled); molecularProfileIdToTrackGroupIndex
is now @observable so swaps propagate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Place bulk-toggle before Add Track and make it "Clear all" when selected

The bulk-select button now sits to the left of the primary submit button
and flips between "Select all" and "Clear all" based on whether anything
is selected, so it's a one-tap toggle instead of two separate buttons.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Raise Select-all threshold from 25 to 50 entities

Covers profiles like the 48-signature mutational-signature set on
msk_impact_50k_2026 where a one-click "Select all" is genuinely useful.
Still well below the 100-option search cap, so the button never appears
when the dropdown is paginated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Guard against undefined submit payload and rejected-with-undefined

onClickAddGenericAssays in ResultsViewOncoprint reached info[0].profileId
with no prior length check, so submitting an empty track selection (now
easier to trigger via "Clear all" + Add Track) threw. Bail out when
info is empty.

AppStore's global service-error handler assumed the error argument was
always defined and would crash on `error.status` when a promise rejected
with `undefined` — which then masked whatever failure triggered the
reject. Guard the access so the handler survives undefined.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Batch generic-assay data fetch + guard null response + strip shared label prefix

Scale fixes triggered by adding all 30 mutational signatures to the
oncoprint on msk_impact_50k_2026 (~50k samples):

- fetchGenericAssayData now chunks stableIds into batches of 5 per POST.
  A single request for all 30 signatures produced ~750 MB of row-per-
  datum JSON, which V8 couldn't parse and quietly returned null.
  Backend-side fix tracked separately: cBioPortal/cbioportal#12131.
- augmentQueryResults skips null / non-iterable responses instead of
  throwing a TypeError that cascaded into a cache error state.
- LazyMobXCache.tryTrigger now passes a real Error to the promise's
  error callback; previously called it with no arg, so every downstream
  handler saw `undefined` and could crash on `error.status`.

UX fix for generic-assay split-mode labels:

- Track labels from the same profile share the same long prefix
  ("mutational_signatures_contribution_v2_Signature1", etc.). Under the
  label-column truncation every row rendered as "mutational_sign...".
  Strip the common prefix per profile, cut at the last separator
  (_, -, ., :, whitespace) so a meaningful token stays. Labels become
  "Signature1", "Signature2", ..., "Signature30".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Chart-type selector in the Add Tracks dialog for generic-assay profiles

Users previously had to add tracks, then drill into each track's menu to
switch Chart type ▸. Adds a radio row above the submit button (Separate
rows heatmap / Separate rows bar chart / Stacked bar composition /
Stacked bar absolute) that maps the selection into the URL's stacked /
bar profile params via setGenericAssayChartType, so the tracks appear in
the chosen form on the first render.

Gated behind showChartTypeSelector so the study-view AddChart surface —
which shares GenericAssaySelection — stays unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Unit tests for sort comparators + prefix-strip; chart type in group header

Tests:
- SortUtils.spec: covers makeStackedBarTrackSortComparatorByCategory
  (ascending by picked category, NA-to-end, missing category treated as 0)
  and makeStackedBarTrackSortComparatorByTotal (sum ordering, NaN handling,
  NA-to-end).
- OncoprintUtils.spec: covers commonPrefixLength — no-strip when shared
  prefix has no separator, cut at last separator within the common prefix,
  support for _ - . : and whitespace separators, prefix-of-another case.
  Exported the helper for this.

UX:
- Chart type options now appear in the generic-assay track-group header
  menu (Heatmap / Bar chart / Stacked bar (composition / absolute)),
  not just inside each per-row track's menu. Switching to a stacked
  mode swaps to the single-row render path; the header disappears as
  expected once the profile is stacked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Rework GenericAssaySelection layout: radios below, wide Add Track

Restructure the Add Tracks dialog so the elements stack by purpose:
- Row 1: entity search + Select all / Clear all
- Row 2: "Chart type:" radios (flex-wrap row below the dropdown)
- Row 3: full-width Add Track button

The radios were cramped inline on the same row as the dropdown; dropping
them to their own row gives them breathing room and keeps the primary
Add Track CTA visually distinct as the final commit step.

btn-block / inline width:100% wouldn't take effect here (something in the
global CSS is pinning .btn width to content), so the button is flex: 1
inside a flex container which reliably stretches it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Discriminated union for ICategoricalTrackSpec + chart-type loading spinner

ICategoricalTrackSpec is now a union of ISingleCategoricalTrackSpec (the
classic single-value track) and IStackedBarTrackSpec (where the datum's
attr_val is a category->number map and stackedBarCategories +
stackedBarFills are required). Consumers narrow via `if (spec.stackedBar)`
and drop the redundant `&& spec.stackedBarCategories` guards.

Loading spinner on chart-type switch:

- Include genericAssayStackedBarTracks in the isLoading check so the
  spinner shows while the stacked-bar promise is fetching.
- setGenericAssayChartType now flips renderingComplete to false so the
  spinner also shows during the React re-render of the track set —
  swapping 30 per-entity tracks for 1 stacked track (or vice versa)
  takes long enough on large studies to look like a hang. The Oncoprint
  lifecycle calls onReleaseRendering once the new tracks are on screen,
  flipping the flag back.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Speed up oncoprint rendering: skip core-js parseInt/parseFloat polyfill

A CPU-profile of a chart-type swap on msk_impact_50k_2026 (50k samples,
30 mutational signatures) showed 95s in exporter.trim — all reached via
the core-js polyfills for parseInt and parseFloat. Two hot paths:

1. OncoprintModel.getRuleSets dedup'd numeric rule-set ids through a
   number → toString → arrayUnique → parseInt roundtrip. Replaced with
   Array.from(new Set(ids)) so numbers stay numbers. Cuts ~95s.
2. StackedBarRuleSet's per-shape height/y functions called parseFloat
   on every category's value for every sample, every render. Each call
   went through the polyfill's trim(). Replaced with the unary-plus
   coercion (`+d[...][...]`) — same result, no polyfill, ~5x faster on
   its own plus no trim overhead. Cuts ~93s (48s + 45s across height
   and y).

Chart-type swap on that study goes from ~153s to ~61s end-to-end. More
cleanup possible in the remaining WebGL vertex/shape loop (still the
top post-fix hotspot at ~7.6s), but this is the big win.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Use unary + instead of parseFloat on generic-assay datum values

Same polyfill-avoidance fix as the stacked-bar shape functions: every
parseFloat call goes through core-js's polyfill which trims its input.
In the heatmap track build path we map every datum with
{...d, value: parseFloat(d.value)}, which for 30 signatures × 50k
samples on msk_impact_50k_2026 = 1.5M parseFloat calls per render.
Also two isFractionLikeByProfile loops that parseFloat every datum
value. All converted to +d.value — same behaviour, ~5s saved.

Also gitignore the common-dist/ build artifacts that rspack drops at
the repo root during dev; accidentally committing them dwarfs the
actual diff.

Note: the dominant remaining cost on that URL is seamless-immutable
deep-freezing the generic-assay data cache in LazyMobXCache.updateCache
(~30s in addPropertyTo + Immutable + the resulting GC). That's a
structural change to the shared cache implementation and not in
scope for this PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Trim redundant/verbose comments in oncoprint stacked-bar changes

Condense over-verbose comment blocks and drop change-history narration and
comments that merely restate the code, keeping the non-obvious rationale
(MobX await-tracking, sync track_tops, frustum near-plane, fraction
detection, etc.). Comments only; no logic changes.

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

* Drop stray common-dist/ gitignore entry

Nothing in the build config, scripts, or templates produces or references a
common-dist/ directory; the entry was unrelated to the stacked-bar work.

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

* Address Copilot review issues on stacked-bar tracks

- All-zero stacked rows render as N/A instead of NaN bar heights (builder
  marks zero-total rows NA; ruleset guards a zero denominator)
- Clear generic_assay_bar_profiles when a profile's last entity is removed,
  so it doesn't reappear as a bar chart on re-add
- Move up/down on stacked tracks stays within generic-assay profiles
- Rebuild the stacked rule set when the entity set or absolute-mode max
  changes, not only on sort-by change
- Rebuild the shared heatmap/bar rule set order-independently so all rows
  switch chart type on a heatmap<->bar toggle
- Fix reversed top/bottom category-order doc comment

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

* Use primary (blue) styling for Add Genes to Heatmap button

Match the prominent Add Track button so the two heatmap-add actions are
styled consistently.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Ino de Bruijn <ino4president@gmail.com>
 - oncoprintjs@6.1.5
* Add generic assay frequency table to Study View

- Adds a **profile-level frequency table** for Generic Assay data in Study View
- Shows both **counts** and **frequency** for Generic Assay values across the current cohort
- Supports interactive row selection so users can filter the cohort from the table
- Preserves existing per-entity Generic Assay charts while adding this new cohort summary view
- Improves the Add Chart experience for Generic Assay profiles
- Aligns the table behavior and styling with other Study View tables

Co-authored-by: dippindots <dippindots@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
 - cbioportal-ts-api-client@0.9.85
The docs news page (https://docs.cbioportal.org/news/) migrated to a
Retype-based layout, replacing the #docs-content container with
#retype-content. parseNews looked up #docs-content, found nothing, and
rendered an empty news feed on the homepage RightBar.

Locate the news container by the parent of the first date-ID heading
instead of a hardcoded container id, so the parser survives future layout
changes. Fall back to known container ids (#retype-content, #docs-content)
when no date heading is present.


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

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* Rename LOH_HLA display text to HLA LOH

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

* Remove duplicate LOH_HLA server default

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>
* Move generic assay title defaults into frontend config

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

* Add generic assay display title override test

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>
…+ improvements) (cBioPortal#5627)

* add mrna violin plot chart to study view

* fix description

* clean up chart layout and styling

* additional layout and styling improvements

* change violin plot color to match other charts in summary page

* Add drag-selection filtering and robust rendering to mRNA violin plot

- Drag across a single violin track to filter the study view by that
  gene's expression range; drags are locked to one track so selections
  never span across tracks. Click a track to clear it.
- Selections apply via a GenomicDataFilter so they round-trip through
  study-view filters (new updateMrnaViolinSelection/getMrnaViolinSelection
  on StudyViewPageStore).
- Dashed hover guide line confined to the hovered track.
- Violin styling: dark-blue outline with a light-blue fill.
- Handle near-constant distributions (e.g. cancer-testis antigens like
  MAGEA4) with a jittered strip plot instead of a degenerate KDE spike,
  and compute each violin's KDE over a robust per-gene 1st-99th
  percentile domain so outliers can't flatten the shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* mRNA violin plot: filter pill, header control z-index, small loader

- Show a removable filter pill for violin drag-selections (they own a
  GenomicDataFilter without a registered chart, so render a fallback pill).
- Keep chart header controls above chart bodies that create their own
  stacking context (fixes top-right buttons being cut off).
- Use the small loading indicator on chart reload.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* mRNA violin plot: prefer all-sample z-scores, restrict to single z-score study

- Prefer "all-sample" z-score profiles over diploid/normal-reference ones.
  Reference z-scores can explode for genes silent in normal tissue (e.g.
  MAGEA4 reaches z > 200), wrecking the shared cross-gene axis; all-sample
  z-scores stay bounded (~±sqrt(n)).
- Only show the chart for a single-study view that has a z-score mRNA
  profile. The shared multi-gene axis is only meaningful in cohort-
  comparable z-score units, and precalculated z-scores aren't comparable
  across studies (each is standardized against its own cohort/reference).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* mRNA violin plot: match gene-label size to tables, add bottom padding

- Render gene row labels at 13px to match the alteration tables (.row).
- Increase bottom margin 6 -> 9px for a little breathing room under the
  last violin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Add multi-gene violin as a gene-specific chart

Selecting a continuous-numeric molecular profile with multiple genes in
the Add Chart gene-level menu now builds one shared-axis violin chart
instead of N bar charts. A single gene stays a bar chart and categorical
profiles stay one pie chart per gene.

- New ChartTypeEnum.GENE_SPECIFIC_VIOLIN_PLOT (config, name, dimensions)
- addGeneSpecificCharts branches multi-gene numeric selections into one
  violin via _geneSpecificViolinChartMap + getGeneSpecificViolinChart
- Generalize MrnaViolinPlotChart with optional genes/profileType props:
  selects profiles by suffix (any continuous profile, not just mRNA),
  hides the gene picker, keeps fixed per-track height
- Wire ChartContainer + SummaryTab to render the new chart type

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Add gene-set dropdown to the chart gene-level selection

Mirror the query page's gene-set selector above the gene textarea in the
Add Chart gene-level panel: a dropdown of curated gene-set lists (built-in
pathways, or the server's query_sets_of_genes when configured) that
populates the textarea on selection.

Flip validateInputGeneQuery to true so a programmatically populated query
is validated (otherwise GeneSymbolValidator skips it and validGenes stays
empty, so no chart is created); typed input validates as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Replace one-off mRNA violin with a default gene-specific violin

Stop auto-adding the bespoke MRNA_VIOLIN_PLOT special chart (drop its
SPECIAL_CHARTS entry). Instead, for a single-study view with an mRNA
z-score profile, auto-add a default-configured GENE_SPECIFIC_VIOLIN_PLOT:
the same 10 MSK-trial genes on the best (all-sample) z-score profile,
via a shared registerGeneSpecificViolinChart helper.

Give it priority 990 so it lands just below the genomic-profile/case-list
summary charts instead of at the very top. The old MRNA_VIOLIN_PLOT chart
type, ChartContainer case, and SummaryTab entry remain but are now unused.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Move violin log scale to the chart-header options menu

Drop the violin's top toolbar (the log-scale checkbox and the drag-to-filter
instructions); gene-specific mode now has no toolbar and the plot reclaims
that height. Log scale is exposed in the chart-header options menu like other
charts: per-chart state lives in the store
(_geneSpecificViolinLogScale / isGeneSpecificViolinLogScale /
toggleGeneSpecificViolinLogScale), wired through SummaryTab and
ChartContainer.chartControls, and passed to the chart as a prop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Persist gene-specific violin charts in user settings

The violin's genes/profile live in a side map that the save/load path never
touched, so saved settings dropped it and it vanished on reload. Serialize
the gene list, profile, and log-scale state into ChartUserSetting
(hugoGeneSymbols / profileType / violinLogScale) via getChartSettingsMap, and
reconstruct the chart on load by routing the persisted genes back through
addGeneSpecificCharts (idempotent on the deterministic uniqueKey).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Condition gene violins on a single anchor selection

Brushing a range on one gene now keeps that gene's full distribution
with the selected slice highlighted, while every other gene reshapes to
its conditional distribution over the selected cohort. Only one gene may
be selected at a time, and per-row sample counts label the anchor
("selected") and the conditional rows so the asymmetry is legible.

A new store helper, getMrnaViolinDistributionSamples, returns samples
filtered by every active filter except the violin's own gene-range
selections, so the anchor reflects other charts' filters without
collapsing on its own.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Drop per-row sample-count labels from gene violins

Revert the n= row labels under each gene name; they crowded the label
gutter and the conditional tag clipped. The gene name alone is enough.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Scale violin row height to fill when fewer than 10 genes

With fewer than MAX_GENES genes the tracks now grow to use the available
plot height instead of staying at 1/10 size with empty space below,
capped at 50px per row so a couple of genes don't render absurdly tall.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* use a custom msk-target gene list for the default gene specific violin plot

* Refactor gene-specific violin plot logic to support non-zscore mRNA profiles in multi-study views

* hide the default mrna violin plot behind a feature flag

* move default mrna violin plot after Genes tables

* fix a TS error in StudyViewUtils.spec.tsx

* remove console.log

* Fix hard-coded filter pill text

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

---------

Co-authored-by: gblaih <56288120+gblaih@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Onur Sumer <s.onur.sumer@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Add Embeddings tab to Study View

Add a new Embeddingstab to the Study View, which leverages deck.gl. The
implementation uses a randomly generated scatter plot that represent UMAP and
PCA projections. The dots can be colored by clinical attributes or tumor types,
similar to the plots tab. The plot also allows for selection.

* Make legend interactive

Make legend more interactive. Add embedding to more studies (anything that has
a sample in the embedding).

* show embedding in cross cancer studies

* fix driver coloring

* update legend on study view selection

* fix driver coloring, add URL params

* add clinical attribute url params

* fix url parm

* add umap env

* fix some of the coloring issues

* handle unselected samples better

* fix layout resizing issue

* Add comprehensive test coverage for embeddings feature

- Add unit tests for EmbeddingPlotUtils (preComputeClinicalDataMaps, lookup maps, embedding transformations)
- Add E2E screenshot tests for cancer type, gene mutation, and clinical attribute coloring
- Add E2E interaction tests for legend toggles, filtering, and URL parameters
- Add data-test attributes to embeddings visualization and legend components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Fix TypeScript errors in EmbeddingPlotUtils unit tests

Add missing required properties (studyIds, description, totalPatients, sampleSize) to PatientEmbeddingData test objects.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Implement expert mode for embeddings QC

Add &expert URL parameter to toggle QC section visibility in legend. Filter out "not in cohort" samples in normal mode. Include "Unselected" category in legend with proper gray color. Fix "Show All/Hide All" to exclude QC categories and show message when all categories hidden.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Optimize embeddings tab performance by caching raw plot data

Creates a shared `rawPlotData` computed property that is called once and
cached by MobX, eliminating redundant calls to `makeEmbeddingScatterPlotData`
across the three computed properties (plotData, categoryCounts, categoryColors).

Performance impact:
- Before: 3 calls × ~30-40ms = ~90-120ms per render
- After: 1 call × ~30-40ms = ~30-40ms per render
- Net savings: ~60-80ms per render (50-67% reduction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Fix axis label formatting to add space before dimension number

Changes axis labels from 'Boehm 20251' and 'Boehm 20252' to 'Boehm 2025 1' and 'Boehm 2025 2' by adding a space between the embedding label and dimension number.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Add three new embedding options and remove old embedding file

Replaces the single boehm_2025_umap_embedding.json with three new embedding files:
- boehm_2025_umap_he.json (H&E embeddings)
- boehm_2025_umap_genomic.json (Genomic embeddings)
- boehm_2025_umap_genomic_he.json (Combined Genomic and H&E embeddings)

The dropdown now displays three options using titles from the JSON files:
- "Boehm et al. (2025) - H&E"
- "Boehm et al. (2025) - Genomic"
- "Boehm et al. (2025) - Genomic and H&E"

Default selection is set to the H&E embedding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Increase embedding dropdown width from 150px to 300px

Widens the embedding selection dropdown to accommodate the longer embedding names like 'Boehm et al. (2025) - Genomic and H&E' without truncation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Add three new embedding data files and remove old one

Adds three new embedding JSON files for different embedding types:
- boehm_2025_umap_he.json (H&E embeddings)
- boehm_2025_umap_genomic.json (Genomic embeddings)
- boehm_2025_umap_genomic_he.json (Genomic and H&E embeddings)

Removes the old boehm_2025_umap_embedding.json file which is no longer referenced in the code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Fix embedding import in StudyViewPage to use new H&E file

Updates the import from the removed boehm_2025_umap_embedding.json to the new boehm_2025_umap_he.json file. This fixes the module resolution error while maintaining the same functionality for checking embedding support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* update h&e embedding

* Move Beta! label from Plots tab to Embeddings tab

Removes the Beta! label from the Plots tab and adds it to the Embeddings tab to indicate that Embeddings is the beta feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* feat: migrate embeddings to remote URLs and add feature flag

- Migrate embedding data from local JSON files (~15MB) to remote URLs at msk_mosaic_2026
- Add EMBEDDINGS feature flag to control tab visibility
- Fix duplicate fetching with module-level singleton remoteData instances
- Implement automatic view centering on initial load
- Add loading indicator during data fetch
- Delete local JSON files to reduce bundle size

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* chore: remove obsolete add-umap-deckgl environment config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* test: add EMBEDDINGS feature flag to e2e test URLs

All embeddings e2e tests now include featureFlags=EMBEDDINGS parameter
to ensure the Embeddings tab is visible during testing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* feat: add continuous color mapping for numeric clinical attributes in embeddings

- Implement gradient coloring for numeric clinical attributes (e.g., age)
- Add gradient legend display with color scale
- Rename hexToRgb to colorToRgb for better clarity
- Add MobX computed properties for numeric attribute detection
- Fix selection state to prevent graying out all points
- Support both hex and RGB color formats from D3 interpolation
- Add screenshot tests for numeric attribute visualization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* refactor: always show non-cohort samples and rename tab to Similarity Maps

- Remove expert URL parameter and showQCSection prop
- Always show "Sample/Case not in this cohort" dots by default
- Rename tab from "Embeddings" to "Similarity Maps"
- Rename config section from "Embedding Configuration" to "Configuration"

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

* fix: use proper package import for react-mutation-mapper

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

* refactor: remove unused embedding types, keep only umap_he.json

Remove boehmGenomicData and boehmGenomicHeData loaders.
Only H&E embedding (Boehm et al. 2026) is now supported.

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

* fix: use physical study IDs for mutation data query filter in virtual studies

studyToDataQueryFilter was using this.studyIds which contains virtual study IDs
for virtual/multi-study scenarios. This caused mutationCache to fail finding
the dataQueryFilter entries since studyToMutationMolecularProfile uses physical
study IDs as keys.

Changed to use queriedPhysicalStudyIds.result which correctly contains the
actual physical study IDs, fixing TP53 and other gene mutation coloring in
the Similarity Maps and Plots tabs for virtual studies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add Cancer Study coloring to Plots tab with shared utility

- Add ClinicalAttributeUtils.ts with createCancerStudyAttribute() and
  addCancerStudyAttribute() shared functions
- Update PlotsTab to include Cancer Study in Color samples by dropdown
- Refactor EmbeddingsTab to use shared utility
- Fix Font Awesome 6 icon compatibility:
  - SelectionControls: fa-hand-paper-o -> fa-regular fa-hand
  - ActionButtons: fa-user-circle-o -> fa-solid fa-circle-user
  - ActionButtons: Add fa-lg to all toolbar icons for consistency
  - FilesAndLinks: fa-external-link -> fa-arrow-up-right-from-square
  - VirtualStudy: fa-external-link -> fa-arrow-up-right-from-square

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: memory leak from unreleased MobX reaction in EmbeddingsTab

- Store viewStateReactionDisposer and clean up in componentWillUnmount
- Optimize createCancerStudyAttribute to return singleton object
  instead of creating new objects on every call

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: remove debug logging and fix side effect in EmbeddingsTab

- Remove all console.log/time/timeEnd statements added for performance debugging
- Move driver annotation side effect from computed property to MobX reaction
- Make driverAnnotationsEnabled computed property pure (no side effects)
- Add proper cleanup for driverAnnotationReactionDisposer in componentWillUnmount

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: hide 'Selected:' label when no filters are applied

Only show the "Selected:" prefix in the patient/sample count summary
when charts are actually filtered. When viewing all data without
filters, just show the counts without the prefix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add Custom Selection dropdown to Files & Links, Plots, and Embeddings tabs

Enable the Custom Selection dropdown on additional Study View tabs to allow
filtering samples/patients from these views.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: replace rectangle selection with lasso selection in Embeddings tab

- Change selection mode from rectangle to freeform lasso drawing
- Implement point-in-polygon algorithm for accurate selection
- Use deck.gl viewport projection for screen coordinate conversion
- Update SelectionOverlay to render SVG path instead of rectangle
- Add dashed freeform selection icon to indicate draw-to-select

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add custom attribute coloring support to Embeddings tab

- Include custom attributes in clinicalAttributes computed property
- Fix RangeError caused by MobX deeply traversing circular references
  in custom attributes by using @observable.ref for selectedColoringOption
- Add guard to URL reaction to prevent infinite loops
- Change "Unknown" label to "No data" to match Plots tab convention

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add Map Attributes category and rename Embedding label to Map

Separates embedding data fields into their own "Map Attributes" group in
the color-by dropdown, distinct from Clinical Attributes. Adds
additionalGroups prop to ColorSamplesByDropdown for extensibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add click-to-pin tooltip and fix clear-all-filters unpin logic

Pin tooltip on point click with copy/close buttons and Escape to dismiss.
Watch numberOfSelectedSamplesInCustomSelection dropping to 0 instead of
selectedPatientIds changing, so MobX-batched updateCustomSelect doesn't
immediately unpin a just-pinned tooltip.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: use 50k H&E embedding data file

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: regenerate pnpm-lock.yaml with deck.gl dependencies

* test(e2e): update study-view tab list after moving Beta! label off Plots tab

The Similarity Maps feature moves the Beta! badge from the Plots tab to the
embeddings tab, so the Plots tab now renders as 'Plots'. Update the
hide-download-controls expected tab list to match.

* test(e2e): port embeddings specs from wdio to Playwright remote lane

Port end-to-end-test/local/specs/core/embeddings{,.screenshot}.spec.js to
end-to-end-test-playwright/tests/. These live in the remote lane because
the feature renders the public msk_chord_2024 study and fetches embedding
data from a fixed remote asset, neither of which exists in the localdb
seed. The dropped wdio specs were orphaned: the wdio localdb job is
disabled and they shipped no baseline images.

embeddings.spec.ts covers functional behaviour (legend toggle, sample
counts, toolbar, filtering, URL params). embeddings-screenshot.spec.ts
covers the deck.gl visualization and legend captures; its canonical
baselines still need to be generated via the Docker lane.

The wdio 'coloring menu interactions' test is not ported: it targeted a
non-existent selector behind an isExisting() guard and asserted nothing.

* test(e2e): target msk_impact_50k_2026 for embeddings specs

msk_chord_2024 has no samples in the H&E embedding asset (which covers 28
TCGA PanCancer studies + msk_impact_50k_2026), so the tab rendered
'Embeddings are not available for any of this study' and every test timed
out. Point the specs at msk_impact_50k_2026 — a pan-cancer cohort present
in the embedding — and use attributes that exist there: CANCER_TYPE for
the Colorectal/Melanoma filters, SEX (categorical) and
FRACTION_GENOME_ALTERED (numeric gradient) for clinical coloring.

* test(e2e): fix embeddings coloring + filter encodings

- Gene coloring is keyed by entrezGeneId (EGFR=1956, BRAF=673); the bare
  'EGFR'/'BRAF' selectedOption never matched the /^(\d+)_/ parser and
  silently fell back to cancer-type coloring. Use '<id>_undefined' and
  wait for the mutation legend before snapping.
- Study-view filters use the '#filterJson=' URL hash with the
  clinicalDataFilters schema ({value} objects), not a '&filterJson='
  query with clinicalDataEqualityFilters — the latter applied no filter,
  so the 'Unselected' cohort never appeared and the tab-click timed out.
- Filter screenshots navigate directly to the embeddings route with the
  filter hash; the tab round-trip persistence check starts from a loaded
  embeddings tab so the tab anchors are actionable.

* test(e2e): add embeddings screenshot baselines from CI

Canonical baselines for embeddings-screenshot.spec.ts, generated in the
Playwright Docker CI image (build 207343) and pulled from its artifacts —
the byte-stable environment that CI compares against. 12 captures: default
cancer-type, EGFR/BRAF mutation coloring, SEX + FRACTION_GENOME_ALTERED
clinical coloring, and Colorectal/Melanoma filtered views (each viz and/or
legend).

* test(e2e): give embeddings functional waits the full load timeout

The legend renders quickly with default cancer-type coloring, but the
filter's 'Unselected' cohort and the gene/clinical coloring categories
only appear once the embedding + study data finish loading — longer than
the default expect timeout for the 50k-sample cohort. Wait for the legend
to be visible and assert the expected text with a 60s timeout, matching
the screenshot spec's waits.

* docs(e2e): fix stale study id in embeddings.spec header comment

* test(e2e): give embeddings tab-switch clicks a 60s timeout

The in-app Summary<->Similarity Maps tab anchors are slow to become
actionable in the headless CI browser while the 50k-sample view renders,
so the default 15s action timeout was exceeded. Override per click.

* test(e2e): force embeddings tab-switch clicks past stability gate

A 60s click timeout still failed: the continuous deck.gl render keeps the
tab anchors from ever satisfying Playwright's stability check in the
headless CI browser. The anchors are present and visible, so force the
clicks to perform the in-app tab switch.

* test(e2e): drop flaky cross-tab filter-persistence embeddings test

The in-app Summary<->Similarity Maps round-trip is unreliable in the
headless CI browser: the continuous deck.gl render blocks click
actionability, and forcing the click then leaves the legend slow to
re-attach. The behaviour it covered (a study-view filter producing the
'Unselected' cohort) is already verified by the preceding test via direct
navigation, so remove the marginal, flaky round-trip rather than chase it.

* fix: adapt embeddings to master PlotsTabStore refactor

Master extracted the Plots tab coloring/annotation machinery out of
StudyViewPageStore into a dedicated PlotsTabStore (accessed via
store.plotsTabStore) and moved the ColoringMenuOmnibar* types and
NONE_SELECTED_OPTION_NUMERICAL_VALUE from PlotsTab into PlotsTabTypes.

Point the embeddings coloring code at the new locations:
- read annotation caches and driver-annotation helpers off
  store.plotsTabStore
- import the coloring-menu types from PlotsTabTypes
- pass store.plotsTabStore (a MolecularDataStore) to
  getMolecularDataForGeneSync

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

* fix: address Copilot review comments on embeddings

- StudyViewPageStore: require at least one digit ('^[0-9]+') when
  extracting an entrezGeneId from embeddings_coloring_selection so
  non-gene selections no longer push an empty id into fetchGenesUsingPOST
- PatientMolecularDataUtils: drop unused lodash import
- EmbeddingPlotUtils: store the numeric value (not the field name) in the
  numeric branch of preComputeEmbeddingDataColors so valueMap holds a
  usable display value
- SelectionOverlay: remove unused bounding-box computation

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

* feat: reduce sample-level clinical attrs to patient in similarity maps

On patient-level embeddings, a sample-level clinical attribute previously
took the value of an arbitrary sample per patient (whichever the patient
-> sample lookup landed on). Reduce a patient's samples to a single value
the way the oncoprint does in patient mode: average the numeric values,
and use "Mixed" (oncoprint's out-of-palette colour) when the samples
disagree categorically. Patient-level attributes are unchanged.

preComputeClinicalDataMaps now always returns patient-keyed maps, so
transformPatientEmbedding colours both attribute kinds by patientId and no
longer depends on which sample the lookup happened to keep.

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

* revert: keep existing FontAwesome v4 icon names in study view

Drop the incidental FontAwesome v4->v6 icon-name changes to the study
view header, Files & Links, and Virtual Study — they are unrelated to the
Similarity Maps feature and inconsistent with the rest of the codebase,
which still uses the v4 names. A repo-wide FA6 migration belongs in its
own PR. The new Similarity Maps components keep their own icons.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
raylim and others added 23 commits September 24, 2026 13:55
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pass the study and patient to fetchPatientHierarchyReadOnly instead of
parsing them from the hierarchy URL. This removes the Array.at call that
the configured TypeScript libraries (es2015/es2016/dom) do not provide.

Resource access targets are now registered on every path that yields a
hierarchy: network responses, cache hits and seeded entries. Registration
replaces all targets for the study and patient, so row IDs removed by a
reimport are pruned, and a superseded response cannot overwrite newer
targets. Clearing the hierarchy cache, or one entry, clears its targets.

When access returns 404, the hierarchy is reloaded once bypassing the
cache, re-registered, and access retried once before the error surfaces.
Unknown image IDs still reject before any request, and cached access is
keyed by resource identity so a capability for a replaced row is not
reused.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Viewer links have the form
<portalBase>/wsi/patient/{patient}?studyId=..&imageId=.. and resolve under
the router basename, so a deployment context path works. The standalone
route reads imageId and passes requestedImageId through the entry point to
WSIViewer and chooseInitialServableSlide.

Precedence: a URL hash selection, then the requested image, then the
existing default ranking. An image ID that the loaded hierarchy cannot
serve shows a dismissible "The requested slide is not available" notice
and loads the default slide; no backend lookup is made for it.

readWsiHashState now also accepts the coordinate-less #wsi:slide=X form
that writeSelectedSlideHashToCurrentUrl writes. Viewport restoration and
hash rewriting only use coordinates when the hash carries them; partial or
malformed viewports are still rejected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ract

The foundation mocks now give slides resourceId/resourceDataId and serve
the /api/wsi/v2/resources/{study}/{patient}/{resource}/{row}/access
endpoint instead of the retired per-slide access route. An optional second
slide has an ID that needs URL encoding, and access requests can be
collected.

New mocked specs cover selecting a slide from an encoded ?imageId= link,
a coordinate hash taking precedence over imageId, and an unknown imageId
showing the notice and the default slide while only registered resource
identities are requested.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Whole-slide images are now stored as WSI_SAMPLE/WSI_PATIENT resources, one
row per slide. The study Files & Links tab fetched every resource of the
study and filtered it in the browser, which for MSK-IMPACT is 812 MB of JSON
(1.74M slides). Fetch the study's other patient and sample definitions
individually and skip the WSI ones; slides remain available in the patient
view and the Pathology Slides views.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Read sample acquisition and sequencing days from the patient's clinical
events (earliest event wins) and show them alongside each slide:

- slide rows: "Proc N d before/after sequencing" for sample-matched
  slides when both days are known, otherwise the existing "Proc d±X"
- sample group header: "sequenced d+7"
- pathology panel: Procedure, Acquired and Sequenced ("d+7 (249 d
  later)") rows for matched slides; unmatched slides keep Timepoint

The patient view tab passes the store's existing clinical events; the
standalone /wsi/patient route fetches them and falls back to the
patient-level display if the request fails. Time filtering still uses
patient-level days.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Slide, sample and time-filter days are counted from the patient's first
tumor sequencing (d0). Tooltips on the slide timepoint, the sample's
sequencing label, the time filter and the Procedure/Acquired/Sequenced
panel values say so, and the slide tooltip spells out the procedure's
relation to its sample's sequencing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every pathology row now has a label tooltip, and values that need
interpreting explain themselves: stain group and stain, the specimen part
and block the slide was cut from, what block- or part-matching means, the
physical size and pixel spacing of the scan, zoom levels, tile size and the
exact file size.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Some block labels already start with "Block", which showed as
"Part 6 / Block Block 1" in the specimen row and its tooltip.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Clinical Data tab renders PATHOLOGY SLIDES events as a dedicated
table (procedure day, sample, offset from sequencing, stain, match,
specimen, viewable slide counts) with an in-app Open link to the
Pathology Slides tab. That tab now reads sampleId, matchLevel,
specimenKey and stainFilter from the patient view URL and scopes the
viewer accordingly, so timeline LINKOUTs land on the matching slides.
A #wsi:slide= hash still selects its slide.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…es timeline

The PATHOLOGY SLIDES timeline track draws a matched event as its sample's
numbered, colored marker (unmatched events keep the grey point; overlapping
events keep the count-and-stack rendering, colored by sample). Its tooltip
reuses the Clinical Data table row helpers: stain and match in the title,
sample, procedure day with its offset from sequencing, specimen, viewable
slide count, and an in-app "Open slides" link to the Pathology Slides tab.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Simultaneous PATHOLOGY SLIDES events draw their sample's numbered marker
with an event count when they share one sample, or the multi-sample marker
listing each sample once when they mix samples. Events without a patient
sample draw a grey marker, or a grey stack with a count.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@raylim
raylim changed the base branch from codex/wsi-release-hardening to master September 28, 2026 22:01
… failing

A 404 from the slide access endpoint reloaded the whole patient hierarchy
and retried on every request, so each thumbnail and token refresh for a
slide that cannot be fixed by a reload (allowlist, tile metadata,
thumbnail content type) re-downloaded the hierarchy.

Refresh at most once per slide target, retry only when the refresh
changed that slide's resource identity, and remember slides whose 404
persisted so later requests fail fast until their target is cleared or
re-registered with a different identity. Concurrent 404s for one
patient still share one in-flight refresh.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@raylim

raylim commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Superseded by cBioPortal#5732 (mirror #16).

@raylim raylim closed this Oct 9, 2026
raylim added a commit that referenced this pull request Oct 13, 2026
The Summary timeline loaded its PATHOLOGY SLIDES track only for patients
with a positive WSI_PATIENT_SLIDE_COUNT, and the undated-slides notice
preferred WSI_PATIENT_UNDATED_SLIDE_COUNT. Those clinical attributes now
come only from the slide-count follow-up (core #6 / backend #15), so a
portal without it showed no track.

The loader now reads the patient's hierarchy through the viewer's shared
cache (the Pathology Slides tab and hasPathologySlides read the same
entry, so the page still requests it once) and loads the track module
only when a slide is servable. The undated count comes only from that
hierarchy, and the track no longer waits for the patient clinical data.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.