@@ -120,7 +120,7 @@ export function organizeSubjectData(records, subjectId) {
120120 rec . acquisition ?. acquisition_start_time &&
121121 rec . data_description ?. data_level !== 'derived'
122122 ) {
123- bundle . acquisitions . push ( { ...rec . acquisition , _assetName : rec . name ?? '' } ) ;
123+ bundle . acquisitions . push ( { ...rec . acquisition , _assetName : rec . name ?? '' , _modalities : rec . data_description ?. modalities ?? [ ] } ) ;
124124 }
125125 }
126126
@@ -294,7 +294,6 @@ async function _loadSubject(contentEl, subjectId, coordinator, signal) {
294294 assetsTableEl . querySelectorAll ( 'tr[data-asset-name]' ) . forEach ( ( r ) => {
295295 const isTarget = targetName && r . dataset . assetName === targetName ;
296296 r . classList . toggle ( 'asset-highlighted' , isTarget ) ;
297- if ( isTarget ) r . scrollIntoView ( { block : 'nearest' } ) ;
298297 } ) ;
299298 }
300299 } ,
@@ -310,8 +309,21 @@ async function _loadSubject(contentEl, subjectId, coordinator, signal) {
310309
311310 // Async: fetch DuckDB asset data (projects + grouped assets table)
312311 if ( coordinator ) {
313- _fetchAndRenderAssets ( coordinator , subjectId , infoEl , assetsSection , bundle . subject ) . then ( ( tableEl ) => {
312+ _fetchAndRenderAssets ( coordinator , subjectId , infoEl , assetsSection , bundle . subject ) . then ( ( { tableEl, assets } ) => {
314313 assetsTableEl = tableEl ;
314+ // Enrich acquisition event data with S3 location and Code Ocean from DuckDB
315+ if ( assets ?. length ) {
316+ const assetByName = new Map ( assets . map ( ( a ) => [ a . name , a ] ) ) ;
317+ for ( const ev of events ) {
318+ if ( ev . type === 'Acquisition' && ev . data ?. _assetName ) {
319+ const asset = assetByName . get ( ev . data . _assetName ) ;
320+ if ( asset ) {
321+ ev . data . _codeOcean = asset . code_ocean ?? null ;
322+ ev . data . _location = asset . location ?? null ;
323+ }
324+ }
325+ }
326+ }
315327 } ) . catch ( ( err ) => {
316328 console . error ( '[SubjectView] Asset fetch failed:' , err ) ;
317329 assetsSection . innerHTML = `<h3>Assets</h3><p class="error-banner">Failed to load assets: ${ err . message } </p>` ;
@@ -388,7 +400,7 @@ async function _fetchAndRenderAssets(coordinator, subjectId, infoEl, assetsSecti
388400 assetsSection . innerHTML = '<h3>Assets</h3>' ;
389401 const tableEl = _buildAssetsTable ( assets , sourceMap ) ;
390402 assetsSection . appendChild ( tableEl ) ;
391- return tableEl ;
403+ return { tableEl, assets } ;
392404}
393405
394406function _buildAssetsTable ( assets , sourceMap ) {
0 commit comments