Skip to content

Conversation

@thinknoack
Copy link
Contributor

@thinknoack thinknoack commented Jun 17, 2025

Based on newest designs for Annotation feature. This will move the search results tools towards that approach before we make any updates RE: annotation

updates to search layouts

  • full width contianer
  • search teaser display to resemble pubmed
  • new search details panel/drawer component
  • adding fields README and Citation
  • moves dataset filter/tabs to above results
  • moves components from generic components dir to search/components

@thinknoack thinknoack marked this pull request as draft June 17, 2025 18:20
@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 20.84548% with 543 lines in your changes missing coverage. Please review.

Project coverage is 48.28%. Comparing base (9529cf0) to head (79de8a7).
Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
.../scripts/search/components/SearchResultDetails.tsx 10.17% 150 Missing ⚠️
.../src/scripts/search/inputs/sliding-radio-group.tsx 16.53% 106 Missing ⚠️
...rc/scripts/search/components/DatasetsRadioTabs.tsx 8.73% 94 Missing ⚠️
...nneuro-app/src/scripts/search/search-container.tsx 12.22% 78 Missing and 1 partial ⚠️
...src/scripts/search/components/SearchResultItem.tsx 17.54% 47 Missing ⚠️
...rc/scripts/search/components/SearchResultsList.tsx 35.55% 29 Missing ⚠️
...src/scripts/search/components/MetaListItemList.tsx 38.70% 19 Missing ⚠️
...o-app/src/scripts/search/components/SearchPage.tsx 20.00% 12 Missing ⚠️
...ipts/components/activity-slider/ActivitySlider.tsx 0.00% 4 Missing ⚠️
...app/src/scripts/search/components/FiltersBlock.tsx 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3495      +/-   ##
==========================================
+ Coverage   45.30%   48.28%   +2.98%     
==========================================
  Files         585      588       +3     
  Lines       41658    41972     +314     
  Branches     1324     1377      +53     
==========================================
+ Hits        18872    20268    +1396     
+ Misses      22595    21534    -1061     
+ Partials      191      170      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thinknoack thinknoack requested a review from nellh June 24, 2025 19:51
@thinknoack thinknoack marked this pull request as ready for review June 24, 2025 19:51
@thinknoack thinknoack changed the title WIP Update/search results layouts details component Update/search results layouts details component Jun 24, 2025
Copy link
Contributor

@nellh nellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still working on the code review. One functional issue:

Screenshot From 2025-06-25 10-17-25

We recently fixed this issue where this dataset cannot be clicked if it has a white space title. To keep the layout, we should probably just replace the title with the accession number if it is only white space.

@thinknoack
Copy link
Contributor Author

thinknoack commented Jun 25, 2025

I'm still working on the code review. One functional issue:

Screenshot From 2025-06-25 10-17-25

We recently fixed this issue where this dataset cannot be clicked if it has a white space title. To keep the layout, we should probably just replace the title with the accession number if it is only white space.

oh, looks like I wasn't checking for white space.

  const datasetId = node.id

  const heading = node.latestSnapshot.description?.Name
    ? node.latestSnapshot.description?.Name
    : datasetId

how about this - I updated to check for white space dataset names

const heading = node.latestSnapshot.description?.Name?.trim() || datasetId

@thinknoack thinknoack requested a review from nellh June 25, 2025 17:44
const subjectCountRangeIsNull =
JSON.stringify(subjectCountRange) === JSON.stringify([null, null])

const labelText = modality_selected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a modalityShortMapping function that does this in a general way.

/**
* Provide a mapping from the schema names to an expected short name used for OpenNeuro display
*/
export function modalityShortMapping(modality) {
switch (modality) {
case "ieeg":
case "iEEG":
return "iEEG"
case "beh":
return "Behavioral"
case "motion":
return "Motion"
case "micro":
return "Microscopy"
case undefined:
return undefined
case null:
return null
default:
return modality.toUpperCase()
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated this lableText and two other places I was doing the same thing

Comment on lines 37 to 57
const _list = (
type: JSX.Element,
items: (string | JSX.Element)[],
): JSX.Element | null => {
if (items && items.length > 0) {
return (
<div className="result-summary-meta">
<label>{type}:</label>
<div>
{items.map((item, index) => (
<span className="list-item" key={index}>
{item}
</span>
))}
</div>
</div>
)
} else {
return null
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sort of thing would probably make sense as a component rather than just a function in the render step. Functions that don't create a closure over any value should generally be defined outside of rendering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new component added for list items in the SearchDetails

…yShortMapping function for formatting modalities in various places in search and dataset page header
@thinknoack thinknoack requested a review from nellh June 27, 2025 22:37
@nellh nellh merged commit f091fa9 into master Jun 28, 2025
14 of 15 checks passed
@nellh nellh deleted the update/search-results-layouts-details-component branch June 28, 2025 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants