Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Background
The BIDS file tree panel on /dataset/<id> currently displays "0 B" for every file when rendering from the schema 1.1 summary fast path. buildTreeFromPaths in src/lib/bids-tree.ts:76-85 synthesizes zero-size manifest entries because summary.paths is string[] with no size data. The slow-path manifest fallback DOES carry sizes, but using it would re-introduce the multi-MB fetch the summary fast path was designed to eliminate.
nemar-cli#TBD proposes schema 1.2 with a parallel summary.path_sizes: number[] array aligned by index to paths. Once that ships and backfills, the website needs to consume it.
Scope
- Extend the
SummaryTypeScript interface insrc/lib/data-api.tswithpath_sizes?: number[](optional, additive). - Update
buildTreeFromPaths(paths)insrc/lib/bids-tree.tsto accept an optionalsizes?: number[]argument and thread the per-index size into the synthesizedManifestEntry. Back-compat: when sizes is undefined orsizes.length !== paths.length, fall back to 0 as today. - Update the call site in
src/pages/api/dataset/[id]/tree.tsto passsummary.path_sizeswhen present. - Unit tests:
buildTreeFromPathswith paths-only, paths+sizes, mismatched lengths.
Why no immediate website-only fix
The data simply isn't in summary.json until 1.2 ships. The website cannot synthesize per-file sizes without re-introducing the manifest fetch.
Acceptance
-
Summary.path_sizes?: number[]typed and read by the tree path. - Per-file size column on the BIDS tree shows real sizes (e.g.,
52.4 MBinstead of0 B) for datasets backfilled to schema 1.2. - Datasets still on schema 1.0/1.1 continue to render with
0 Bper-file (unchanged behavior). - Unit tests cover the three cases above.
Depends on
- nemarOrg/nemar-cli#TBD (schema 1.2 with
path_sizesarray + backfill)
Related
- Eliminate per-pageload GitHub roundtrip for README #63 (schema 1.1
readme.contentconsumer — same back-compat pattern) - nemarOrg/website#TBD (hotfix that fixes the panel-header "0 B total" without needing schema 1.2, since
summary.totals.bytesis already populated in schema 1.1)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
neuromechanist commentedon May 27, 2026
Cross-refs: depends on nemarOrg/nemar-cli#635 (schema 1.2 with
path_sizesarray + backfill). The panel-header "0 B total" subset of the symptom is fixed independently in #74 (hotfix, in flight) by reading the existingsummary.totals.bytes.fix(tree): real total bytes + 4s summary timeout
neuromechanist commentedon May 27, 2026
Obsoleted by #76 (canonical-sources pivot, merged 2026-05-27T14:48:13Z). The JSON directory listings shipped in nemar-cli#636 already carry per-file sizes natively; the website now consumes them directly and no longer needs schema 1.2
path_sizesto surface that information.