Repository navigation
fix: external datasets are dropped from the atlas datasets tab when it has no hca datasets (#3236) - #3241
Conversation
9245386 to
168ed43
Compare
NoopDog
left a comment
There was a problem hiding this comment.
I'm requesting changes mainly because the branch needs a rebase (see eslint.config.mjs). The fix itself is correct: externalDatasets is a required ProjectsResponse[], so the old if (datasets) check isn't needed. Inline comments cover the rest. Two more findings are on lines outside this diff:
utils/trackerAtlasPages.ts:87: tracker atlases have the same bug. The tracker path hard-codesprojectsResponses: []and never readsatlas.externalDatasets. A tracker-sourced atlas (breast, gut, liver and others) that gets a non-emptyexternalDatasetswould show "No Source Studies" on its datasets tab, the same symptom #3236 fixes for non-tracker atlases. MergingexternalDatasetsin one shared place, or ruling it out in the type for tracker atlases, would close both paths.utils/atlasPages.ts: the Overview and Source Datasets pages fetch data they never show. They still go through this builder, so they make the Azul round trips and embedprojectsResponsesin__NEXT_DATA__(now including external datasets), but only the Datasets main column reads it. A per-page option like the existingTrackerDataOptionscould skip building it on those pages. Lower priority.
No page today is affected by the bug or by the ordering change, because every non-tracker atlas with external datasets also has HCA datasets.
…t has no hca datasets (#3236) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsKeyxfv4ZT3FdQaqtGBdV
168ed43 to
bf93683
Compare
#3236) move the azul projects fetch into fetchatlasprojects, explain why the empty datasets guard must stay, drop the unverified azul ordering comment, and use type imports for type-only symbols. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Replies to the two findings outside the diff:
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused change satisfies the acceptance criteria without introducing unresolved issues.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes atlas dataset tabs so external-only atlases display their datasets.
Changes:
- Separates guarded Azul fetching into
fetchAtlasProjects. - Always merges and sorts external datasets.
- Runs Azul and CELLxGENE requests concurrently.
| File | Description |
|---|---|
utils/atlasPages.ts |
Corrects dataset merging and refactors concurrent fetching. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Closes #3236
In
getContentStaticProps, the append ofatlas.externalDatasetslived inside theif (atlas.datasets.length > 0)guard, so an atlas with only external datasets rendered an empty datasets tab.The guard now gates only the Azul fetch, which has moved into a
fetchAtlasProjectshelper. That helper returns[]early when the atlas has no HCA datasets, and a comment explains why the guard has to stay:filterProjectId([])would send an empty filter that Azul doesn't define. External datasets are always merged. The merged list is sorted by title, ignoring case, the same as onmain, where the oldif (datasets)check on the always-present array was always true. So the order of HCA-only atlases doesn't change.The Azul and CELLxGENE fetches now run in parallel.
Verification
tsc --noEmit, prettier andnpm run build-prod:data-portalpass.datasets.htmllisted the external dataset and no HCA project. Config restored afterwards.Notes from review
datasets.tsxusesgetNonTrackerStaticPaths), so the hard-codedprojectsResponses: []on the tracker path can't cause this bug.projectsResponses, which it never renders. Tracked in refactor: the non-tracker atlas overview page fetches azul projects it never renders #3249.🤖 Generated with Claude Code