Fix empty funder chips on dataset pages - #230
Conversation
Deploying nemar-website with
|
| Latest commit: |
eae527f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://397f2f6f.nemar-website.pages.dev |
| Branch Preview URL: | https://fix-issue-204-funder-field.nemar-website.pages.dev |
Review (code-reviewer subagent, sonnet)Verdict: approve, no blocking issues. One cosmetic nit, fixed in Checks run independently of CI: typecheck 0 errors (213 files), lint clean (209 files), full suite 1020/1020 including the 5 new The fixture is real. The survey went much wider than mine, and it settles the one real design risk. I had checked 11 funding entries across 10 datasets. The reviewer fetched all 754 datasets and every
That last one matters: the open question on Other findings: the generic signature is sound (the spread preserves sibling fields, covered by test); folding Nit (fixed): the fixture had no trailing newline. Cosmetic only — Findings addressed: 1 of 1. Nothing skipped. |
Closes #204.
Problem
Funding.funderdid not exist.data.nemar.orgsendsfunder_name, soDetailRail.astrorendered an empty<span class="rail__funder"></span>forevery funding entry. Live on production right now: nm000103 has two funding
entries and shows two blank spans. Award numbers were unaffected
(
award_numberwas already the right name), which is why this read as apartial rendering quirk rather than a broken field.
Change
neuroschema.ts:Funding.funder->funder_name, and the two fields theAPI sends but the type omitted (
award_uri,funder_identifier_type).Typed nullable, matching the rest of the file: a shape violation must render
an incomplete rail, never throw and drop the page.
format.ts: newdisplayableFunding()resolves and trims the name and dropsentries without one, so a null can never reproduce the blank-chip symptom.
DetailRail.astroconsumes it.No compatibility branch for the old key: I surveyed 11 funding entries across
10 datasets on production and zero carry a
funderfield.Tests
Five cases in
src/lib/format.test.ts, including one againsttest/fixtures/funding-nm000103.jsoncaptured fromdata.nemar.org/nm000103/metadata.json— the exact document that rendersblank today. Full suite 1020 passing, typecheck and lint clean.
Verified rendering against real production data on a dev server: both funder
names now appear ("See https://childmind.org/..." and "NIH"), with the
R01MH125934 award number still alongside.