IGVF-3450 Reorder analysis-set list-view card items#1040
Merged
Conversation
c741fea to
5951d84
Compare
* Change the order of files and samples in the analysis set list view. * Reorder the list-view card contents for analysis sets. Convert the analysis-set list renderer to Typescript. * Get to full Jest coverage for the analysis-step list renderer. * Fix a couple minor issues. * Update Jest tests for the new required properties of file sets and workflows. * Updated Jest tests for new required properties. Removed an earlier code review Markdown file I accidentally committed.
5951d84 to
118396a
Compare
Collaborator
Author
Code Review Summary: IGVF-3450-analysisset-list-suppModelGPT-5.3-Codex Scope Reviewed
FindingsNo blocking issues were found in the current branch state. What Was Verified
Execution Results
Residual Risk
Final ConclusionThe branch changes are consistent, test-backed, and ready for merge from a code review perspective, with no defects identified in the reviewed scope. |
There was a problem hiding this comment.
Pull request overview
Migrates the AnalysisSet search list renderer to TypeScript while improving robustness around partially embedded API responses, and updates shared typings/tests to reflect required fields used by renderers.
Changes:
- Convert
AnalysisSetlist renderer to TSX, reorder supplement sections, and guard against non-embeddedlab/files. - Tighten shared types (
FileSetObject.file_set_typeandWorkflowObject.uniform_pipeline) and update affected tests/fixtures accordingly. - Extend
FileSetObjecttyping withdata_use_limitation_summariesandsample_summary.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/workflow.ts | Make uniform_pipeline required on WorkflowObject. |
| lib/tests/workflow.test.ts | Update workflow mocks to include uniform_pipeline. |
| lib/tests/ontology-terms.test.ts | Update FileSetObject mocks for required file_set_type. |
| lib/tests/files.test.ts | Update FileSetObject mock for required file_set_type and adjust SampleObject type import. |
| lib/tests/batch-download.test.ts | Update FileSetObject mocks for required file_set_type. |
| globals.d.ts | Add data_use_limitation_summaries/sample_summary; make file_set_type required. |
| components/search/list-renderer/analysis-set.tsx | TS migration + guards for non-embedded lab/files; reorder Samples/Files supplements. |
| components/search/tests/list-renderer.test.js | Add coverage for non-embedded lab rendering behavior. |
| components/file-graph/tests/types.test.ts | Update mocks for required file_set_type and updated color map shape. |
| components/tests/workflow.test.tsx | Update workflow mocks to include uniform_pipeline. |
Comments suppressed due to low confidence (1)
components/search/list-renderer/analysis-set.tsx:39
accessoryDatais given a default value (= null), which implies callers may omit the prop, but the props type currently makes it required (accessoryData: AccessoryData | null). This can cause TypeScript errors for TS/TSX call sites that render<AnalysisSet item={...} />. MakeaccessoryDataoptional (e.g.,accessoryData?: AccessoryData | null) to align the type with runtime behavior and other list renderers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code Review — IGVF-3450-analysisset-list-supp
Files reviewed:
components/search/list-renderer/analysis-set.js→analysis-set.tsxcomponents/search/__tests__/list-renderer.test.jsglobals.d.tslib/workflow.tsanalysis-set.tsx
Conversion from JS + PropTypes to TypeScript
The file is migrated cleanly.
PropTypesdeclarations are replaced with an inline TypeScript parameter type for the component, and theAccessoryDatatype is defined locally. No issues.Bug fix: non-embedded
labThe original code accessed
analysisSet.lab.titleunconditionally. Sincelabcan be either aLabObjector a plain string link depending on whether the API embedded the object, this would throw at runtime whenlabis a string. The fix is correct:Bug fix: non-embedded
filesThe original
.map((file) => file.content_type)would fail iffilescontains plain path strings rather than embedded objects. AddingisEmbeddedArray(analysisSet.files)as a guard before the map is the right approach, and returns an empty array gracefully when files are not embedded.Sort comparator
Changing
.sort()to.sort((a, b) => a.localeCompare(b))is a good improvement. The defaultArray.prototype.sortuses locale-dependent behavior in some environments; usinglocaleComparemakes ordering explicit and consistent.Supplement section reordering
Samples now appears before Files in the supplement area. This matches a more natural reading order (what the data represents → what files contain it) and is a reasonable UX improvement.
isSupplementsVisibleand render conditions are now consistentisSupplementsVisibleusesanalysisSet.sample_summary(truthy check) and the Samples render condition also usesanalysisSet.sample_summary &&(truthy check). Both are consistent. An empty string would be treated as absent, which is the correct behaviour for a display field.No TypeScript errors
No compiler errors in this file.
globals.d.ts
Three additions to
FileSetObject:data_use_limitation_summaries?: string[]— was already being consumed inanalysis-set.tsxby<DataUseLimitationSummaries>; this correctly documents the type.file_set_type: string(now required) — the component accesses this unconditionally (.split(" ")[0]), so promoting it from optional to required is accurate and tightens type safety.sample_summary?: string— correctly optional, matching API semantics.All three changes are appropriate.
lib/workflow.ts
uniform_pipelineis changed fromboolean | undefinedto a requiredboolean. The property is accessed in.some((workflow) => workflow.uniform_pipeline)without any null guard, so marking it required is more accurate. No callers break.list-renderer.test.js
A new test case is added to cover the non-embedded-lab scenario:
labis provided as a path string rather than an embedded object. The test verifies that:This directly covers the bug that was fixed and is a clear, minimal test. No issues.
Summary
The changes are well-scoped and correct. The two runtime crashes fixed (unguarded
lab.titleaccess and unguardedfiles.map) are meaningful bug fixes. The TypeScript migration is clean, the type additions toglobals.d.tsandlib/workflow.tsaccurately reflect reality, and the new test covers the primary bug scenario. No issues found.