feat: atlas pages: add cap (cell annotation platform) link at the atlas level, sourced from the atlas tracker api (#3179) - #3182
Conversation
There was a problem hiding this comment.
Pull request overview
Surfaces Cell Annotation Platform (CAP) links across atlas pages by consuming tracker-provided CAP metadata (atlas-level CAP project link and per-entity CAP dataset links), and updates tracker atlas resolution to return the full published-atlas record so those fields can be threaded into page props and UI.
Changes:
- Adds CAP support to tracker and network types, plus a CAP analysis-portal definition and icon asset.
- Threads tracker CAP fields into atlas page static props and renders the CAP project link under “Data Exploration Tools”.
- Enables “Explore” links for tracker integrated objects / source datasets when CAP URLs are present, including conditional column visibility.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
@types/network.ts |
Adds ANALYSIS_PORTAL.CAP, atlas-level cap link, and per-entity capUrl fields. |
apis/tracker/types.ts |
Extends PublishedAtlas with capId and cellxgeneAtlasCollection. |
apis/tracker/api.ts |
Introduces resolveTrackerAtlas() (full record) and keeps resolveTrackerAtlasId() as a wrapper. |
utils/network.ts |
Adds builders for CAP analysis portal + CAP project link; centralizes CXG collection label constant. |
utils/trackerNetwork.ts |
Builds CAP-only analysis portals for tracker entities and prefers tracker CXG collection over config fallback. |
utils/trackerAtlasPages.ts |
Uses resolveTrackerAtlas() to populate cap and tracker-sourced CXG collection link on processed atlas. |
constants/analysisPortals.ts |
Adds the CAP analysis portal definition (icon/label/name). |
public/hca-bio-networks/network/atlas/icons/cap.svg |
Adds CAP icon asset. |
components/.../SideColumn/utils.ts |
Inserts CAP project link into “Data Exploration Tools” link list. |
components/.../Overview/.../MainColumn/utils.ts |
Adds shouldShowExplore() for tracker integrated objects table Explore-column gating. |
components/.../Overview/.../MainColumn/mainColumn.tsx |
Uses shouldShowExplore() to conditionally show Explore for tracker atlases. |
components/.../Datasets/.../table/viewBuilder.ts |
Adds Explore-cell renderer for tracker source datasets using CAP analysis portals. |
components/.../Datasets/.../table/utils.ts |
Adds conditional column visibility logic for the tracker source datasets table. |
components/.../Datasets/.../table/hook.ts |
Applies computed column visibility for tracker source datasets. |
components/.../Datasets/.../table/columns.ts |
Adds an “Explore” column to the tracker source datasets table. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code review passRan a high-effort review over the branch diff. Two findings, one actioned: Fixed — stale JSDoc (68dd7ed). Not actioned —
Verified as correct with no changes needed: grid-track count stays in sync with the visible columns for both the 5- and 6-column cases; the source datasets table derives its grid from Copilot's review generated no comments. Still blocked on the tracker releaseRe-checked today: prod |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
68dd7ed to
9dd81f8
Compare
NoopDog
left a comment
There was a problem hiding this comment.
Reviewed with Claude Code (high effort). No correctness defects in the diff — verified the CAP URL contract, the conditional Explore column and grid track sizing, and the falsy spread guards.
Two notes, both accepted as-is:
utils/trackerNetwork.ts: trackercellxgeneAtlasCollectiontaking precedence over the curatedcxgId(e.g. liver v1.0) is the intended behavior.apis/tracker/types.ts:capId/cellxgeneAtlasCollectionare typed required but absent from the currently deployed tracker API; fine until the tracker release ships.
Summary
Closes #3179
Surfaces the atlas's Cell Annotation Platform (CAP) link on atlas pages, sourced from the Atlas Tracker API rather than hardcoded in
constants/networks.ts, and threads the per-entitycapUrlwe were already receiving but discarding.Atlas level
apis/tracker/types.ts— addscapIdandcellxgeneAtlasCollectiontoPublishedAtlas(names match the merged tracker PR feat: expose atlas-level CAP and CELLxGENE collection links on /api/published-atlases (#1546) clevercanary/hca-atlas-tracker#1547).apis/tracker/api.ts— addsresolveTrackerAtlas, returning the full published-atlas record;resolveTrackerAtlasIdbecomes a thin wrapper, so its three existing callers are untouched.@types/network.ts— addscaptoAtlas, mirroringcxgDataPortal.utils/trackerAtlasPages.ts— carries CAP and CELLxGENE from the resolved tracker record ontoprocessedAtlas..../SideColumn/utils.ts— appends the CAP link ingetDataExplorationTools. Order is CZ CELLxGENE Collection → Cell Annotation Platform → cell browser → BioTuring Collection.The CELLxGENE collection now comes from the tracker for tracker atlases, falling back to the configured
cxgId— the issue's final open question. The link label stays "CZ CELLxGENE Collection" in both cases, consistent with the other Data Exploration Tools entries, which all name the tool.Per-entity
@types/network.ts— addscapUrl: string | nulltoTrackerComponentAtlasandTrackerSourceDataset, plusANALYSIS_PORTAL.CAP.constants/analysisPortals.ts— adds the CAP analysis portal, with a newpublic/hca-bio-networks/network/atlas/icons/cap.svgasset.utils/trackerNetwork.ts—buildTrackerAnalysisPortals(capUrl)builds tracker analysis portals CAP-only (tracker entities have no CELLxGENE explorer URL) and returns[]whencapUrlis null.columnVisibilitywhile every row'scapUrlis null.The table label is
CAPrather than the full name — the full name overflowed the grid and pushed the Download column out of view, and abbreviating matchesCZ CELLxGENEvs the side column'sCZ CELLxGENE Collection.Blocked on the tracker release
The atlas-level link cannot render until clevercanary/hca-atlas-tracker#1547 ships — it is merged, but the release PR (clevercanary/hca-atlas-tracker#1541, v1.82.0) is still open, so prod
/api/published-atlasesdoes not returncapIdyet.Merging early does not break anything. Every consumer is truthiness-guarded and each false branch reproduces the previous behaviour exactly; the build was verified against prod tracker in this state. The atlas-level link is simply inert until the tracker deploys, with no further code change needed. Worth a quick check that
capIdis present on/api/published-atlasesafter the deploy before closing the issue.The per-entity half is not blocked —
capUrlis already populated on/api/atlases/{id}/component-atlases.Verification
npm run build-dev:data-portalpasses; 65/65 pages generated.https://celltype.info/project/1030/dataset/*; one was opened and loads the matching CAP page.capUrl: nulltoday.cxgIdfallback, tracker collection beating config, titled collection, and neither present (renders[], so no empty section).npx tsc --noEmit,npm run lint(0 errors) andprettier --checkall clean.Not in scope
Source studies carry a
capId(null for all 22 gut studies today); the issue does not ask for it, so it is left for a follow-up. Non-tracker atlases have no config-level CAP fallback — the issue's other open question, deliberately left open.🤖 Generated with Claude Code