Skip to content

Kpmp 6342 remove feature switch#613

Merged
zwright merged 5 commits intodevelopfrom
KPMP-6342_RemoveFeatureSwitch
Jan 5, 2026
Merged

Kpmp 6342 remove feature switch#613
zwright merged 5 commits intodevelopfrom
KPMP-6342_RemoveFeatureSwitch

Conversation

@rlreamy
Copy link
Contributor

@rlreamy rlreamy commented Jan 5, 2026

Summary by CodeRabbit

Release Notes

  • Features Removed

    • Discontinued experimental V2 variants of gene summary, cell type summary, data visualization, differential expression, and UMAP explorer routes.
  • Updates

    • Updated UMAP reference visualizations with new high-resolution reference images for improved clarity.
  • Improvements

    • Streamlined application routing and state management for better performance and maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

Walkthrough

This PR removes V2 component variants and feature flag-based conditional logic, consolidating the application to use 2025-era helper functions exclusively. Function signatures are simplified by eliminating feature data parameters (featureSNData, featureSCData, featureNewCellClusterData), routes to V2 components are removed, and related Redux reducers and state initialization are cleaned up.

Changes

Cohort / File(s) Summary
App routing
src/App.js
Removed imports and routes for all V2 component variants (GeneSummaryContainerV2, CellTypeSummaryContainerV2, RNASeqVizContainerV2, DiffexByClusterContainerV2, UMAPContainerV2); removed routes /explorer/genesummary2, /explorer/celltypesummary2, /explorer/dataviz2, /explorer/diffex2, /explorer/dataViz/umap2.
Feature flag cleanup
src/actions/FeatureSwitch/featureSwitchActions.js, src/components/DataViz/featureSwitchReducer.js, src/initialState.json, src/reducers.js
Removed feature switch action creators (setFeatureSNData, setFeatureSCData) and their corresponding Redux reducers; eliminated feature flags from initial state and combined reducer.
Action creators refactored
src/actions/Concepts/conceptActions.js, src/actions/DataType/dataTypeActions.js
Simplified function signatures: setSelectedConceptAndRedirect now takes (concept, props) instead of (concept, featureNewCellClusterData, props); setDataTypeAndRedirect changed to (dataType, props). Removed conditional navigation logic; consolidated routes to non-V2 endpoints.
Concept select pipeline
src/components/ConceptSelect/ConceptSelect.js, src/components/ConceptSelect/ConceptSelectContainer.js, src/components/ConceptSelect/ConceptSelectFullWidth.js
Streamlined prop passing by removing featureSNData, featureSCData, featureNewCellClusterData from mapStateToProps and dispatch signatures. Consolidated data-type fetching to always use 2025 variants.
Data type selector pipeline
src/components/DataViz/DataTypeSelector.js, src/components/DataViz/DataTypeSelectorContainer.js
Unified to consistently use 2025-era fetch helpers; removed conditional logic based on feature flags; simplified setDataType calls to single argument.
RNASeqViz updates
src/components/DataViz/RNASeqViz.js, src/components/DataViz/RNASeqVizContainer.js
Replaced legacy helper imports with 2025 variants (fetchGeneExpression2025, fetchPlotlyData2025, getDataTypeOptions2025); minor formatting in container (removed trailing comma).
RNASeqViz V2 removal
src/components/DataViz/RNASeqVizContainerV2.js, src/components/DataViz/RNASeqVizV2.js
Deleted entire V2 component and its Redux-connected container wrapper.
UMAP component updates
src/components/DataViz/UMAPContainer.js
Updated import and export to use UMAPViz instead of UMAP for consistency.
UMAP V2 removal
src/components/DataViz/UMAPContainerV2.js, src/components/DataViz/UMAPVizV2.js
Deleted V2 component and Redux-connected container.
UMAP plot updates
src/components/Plots/UMAPPlot.js, src/components/Plots/UMAPPlot2.js
Updated image asset references in UMAPPlot; deleted UMAPPlot2 component.
Summary components pipeline
src/components/Summary/GeneSummary.js, src/components/Summary/GeneSummaryContainer.js, src/components/Summary/CellTypeSummary.js, src/components/Summary/CellTypeSummaryContainer.js
Consolidated to 2025 helpers; removed feature flag parameters from setDataType and setDataTypeAndCluster signatures; updated routes from V2 endpoints to standard endpoints (/explorer/diffex).
Summary V2 removal
src/components/Summary/GeneSummaryContainerV2.js, src/components/Summary/CellTypeSummaryContainerV2.js
Deleted V2 Redux-connected containers.
Explorer components
src/components/Explorer/DataSelector.js, src/components/Explorer/DataSelectorContainer.js, src/components/Explorer/NephronSchemaCard.js, src/components/Explorer/NephronSchemaCardContainer.js, src/components/Explorer/SamplesByDataTypeTable.js
Removed feature flag dependencies from mapStateToProps and function signatures; consolidated to 2025 helper functions for cell type hierarchy and data type summaries.
Expression tables
src/components/ExpressionTables/DiffexByCluster.js, src/components/ExpressionTables/DiffexByClusterContainer.js, src/components/ExpressionTables/DiffexInfoBar.js
Consolidated to 2025 fetch helpers; removed legacy data-fetch branching; minor style fixes (trailing comma removal).
DiffexByCluster V2 removal
src/components/ExpressionTables/DiffexByClusterContainerV2.js
Deleted V2 Redux-connected container with routing.
Home components
src/components/Home/SamplesByDataTypeTable.js, src/components/Home/SamplesByDataTypeTableContainer.js
Consolidated to 2025 helpers; simplified setDataType signature to accept only dataType; removed feature data parameters.
Helper module updates
src/helpers/ApolloClient.js, src/helpers/Utils.js
Removed legacy fetch functions (fetchCellTypeHierarchy, fetchClusterHierarchy, fetchDataTypeSummaryInformation, fetchDataTypesForConcept, fetchGeneExpression) and getDataTypeOptions; consolidated to 2025 variants throughout.
Configuration
package.json
Reordered devDependencies entries (sass and react-scripts swapped); no version changes.

Possibly related PRs

  • Update dataTypeActions.js #608: Modifies setDataTypeAndRedirect in src/actions/DataType/dataTypeActions.js (this PR rewrites its signature and routing logic; the retrieved PR disables the Spatial Transcriptomics case).
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/Summary/GeneSummary.js (1)

32-43: Remove the unused gene.symbol argument from fetchDataTypeSummaryLocal call on line 33.

Line 33 passes this.props.gene.symbol to fetchDataTypeSummaryLocal(), but the function defined on line 55 accepts no parameters: fetchDataTypeSummaryLocal = async () => {...}. The argument is silently ignored. Additionally, the internal call to fetchDataTypeSummaryInformation2025() does not accept a gene symbol parameter—only an optional fetchPolicy argument. Simply remove the unused argument.

🧹 Nitpick comments (5)
src/components/Explorer/DataSelectorContainer.js (1)

6-9: Consider removing the empty mapStateToProps.

Since mapStateToProps returns an empty object and provides no state-derived props to the component, you can simplify this by passing null as the first argument to connect or omitting mapStateToProps entirely.

🔎 Proposed refactor
-const mapStateToProps = (state, props) =>
-({
-  
-});
-
 const mapDispatchToProps = (dispatch, props) =>
 ({
     setSelectedConcept(dataType){
         dispatch(setDataTypeAndRedirect(dataType, props));
     }
 });
 
-export default withRouter(connect(mapStateToProps, mapDispatchToProps)(DataSelector))
+export default withRouter(connect(null, mapDispatchToProps)(DataSelector))
src/components/DataViz/DataTypeSelectorContainer.js (1)

20-33: Consider simplifying the dispatch pattern and consolidating duplicate cases.

  1. The dispatch((dispatch) => window.open(...)) pattern dispatches a thunk that ignores its parameter. This works but is unconventional—you could call window.open directly after the dispatch.

  2. The 'sc' and 'sn' cases have identical navigation logic and could be combined.

🔎 Proposed simplification
     setDataType(dataType) {
         dispatch(setDataType(dataType));
         if (dataType === 'rt') {
-          dispatch((dispatch) => window.open("/explorer/regionalviz", "_self"));
-        } else if (dataType === 'sc') {
-          dispatch((dispatch) => window.open("/explorer/dataViz", "_self"));
-        }
-        else if (dataType === 'sn') {
-          dispatch((dispatch) => window.open("/explorer/dataViz", "_self"));
-        }
-        else if(dataType === "rp"){
-          dispatch((dispatch) => window.open("/explorer/regionalpro", "_self"));
+          window.open("/explorer/regionalviz", "_self");
+        } else if (dataType === 'sc' || dataType === 'sn') {
+          window.open("/explorer/dataViz", "_self");
+        } else if (dataType === "rp") {
+          window.open("/explorer/regionalpro", "_self");
         }
     }
src/actions/DataType/dataTypeActions.js (2)

29-29: Unused props parameter.

The props parameter is declared but never used within setDataTypeAndRedirect. Consider removing it if not needed, or document its purpose if retained for API consistency with other action creators.


57-64: Minor style inconsistencies: prefer let over var and ensure consistent semicolons.

Line 58 uses var while line 62 uses let (implicitly through reassignment). Also, some break statements are missing trailing semicolons (lines 50, 53, 56, 60, 64) while others have them.

🔎 Proposed fix
             case "Segmentation Masks & Pathomics Vectors":
-                var linkVariable = "PAS%20%28Segmentation%20Masks%29";
-                window.open('/spatial-viewer/?size=n_20_n&filters%5B0%5D%5Bfield%5D=imagetype&filters%5B0%5D%5Bvalues%5D%5B0%5D=' + linkVariable +'&filters%5B0%5D%5Btype%5D=any', '_self')
-                break
+                let linkVariable = "PAS%20%28Segmentation%20Masks%29";
+                window.open('/spatial-viewer/?size=n_20_n&filters%5B0%5D%5Bfield%5D=imagetype&filters%5B0%5D%5Bvalues%5D%5B0%5D=' + linkVariable +'&filters%5B0%5D%5Btype%5D=any', '_self');
+                break;
             default:
-                linkVariable = dataType.replaceAll(" ", "%20")
-                window.open('/spatial-viewer/?size=n_20_n&filters%5B0%5D%5Bfield%5D=datatype&filters%5B0%5D%5Bvalues%5D%5B0%5D='+ linkVariable +'&filters%5B0%5D%5Btype%5D=any', '_self')
-                break
+                const encodedDataType = dataType.replaceAll(" ", "%20");
+                window.open('/spatial-viewer/?size=n_20_n&filters%5B0%5D%5Bfield%5D=datatype&filters%5B0%5D%5Bvalues%5D%5B0%5D='+ encodedDataType +'&filters%5B0%5D%5Btype%5D=any', '_self');
+                break;
         }
src/components/Summary/GeneSummary.js (1)

55-67: Consider adding the geneSymbol parameter if needed by the API.

If fetchDataTypeSummaryInformation2025 should filter by gene, the function signature should be updated:

🔎 Potential fix if gene filtering is needed
-    fetchDataTypeSummaryLocal = async () => {
-        await fetchDataTypeSummaryInformation2025().then(
+    fetchDataTypeSummaryLocal = async (geneSymbol) => {
+        await fetchDataTypeSummaryInformation2025(geneSymbol).then(
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09d8957 and e9b8258.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (42)
  • package.json
  • src/App.js
  • src/actions/Concepts/conceptActions.js
  • src/actions/DataType/dataTypeActions.js
  • src/actions/FeatureSwitch/featureSwitchActions.js
  • src/components/ConceptSelect/ConceptSelect.js
  • src/components/ConceptSelect/ConceptSelectContainer.js
  • src/components/ConceptSelect/ConceptSelectFullWidth.js
  • src/components/DataViz/DataTypeSelector.js
  • src/components/DataViz/DataTypeSelectorContainer.js
  • src/components/DataViz/RNASeqViz.js
  • src/components/DataViz/RNASeqVizContainer.js
  • src/components/DataViz/RNASeqVizContainerV2.js
  • src/components/DataViz/RNASeqVizV2.js
  • src/components/DataViz/UMAPContainer.js
  • src/components/DataViz/UMAPContainerV2.js
  • src/components/DataViz/UMAPViz.js
  • src/components/DataViz/UMAPVizV2.js
  • src/components/DataViz/featureSwitchReducer.js
  • src/components/Explorer/DataSelector.js
  • src/components/Explorer/DataSelectorContainer.js
  • src/components/Explorer/NephronSchemaCard.js
  • src/components/Explorer/NephronSchemaCardContainer.js
  • src/components/Explorer/SamplesByDataTypeTable.js
  • src/components/ExpressionTables/DiffexByCluster.js
  • src/components/ExpressionTables/DiffexByClusterContainer.js
  • src/components/ExpressionTables/DiffexByClusterContainerV2.js
  • src/components/ExpressionTables/DiffexInfoBar.js
  • src/components/Home/SamplesByDataTypeTable.js
  • src/components/Home/SamplesByDataTypeTableContainer.js
  • src/components/Plots/UMAPPlot.js
  • src/components/Plots/UMAPPlot2.js
  • src/components/Summary/CellTypeSummary.js
  • src/components/Summary/CellTypeSummaryContainer.js
  • src/components/Summary/CellTypeSummaryContainerV2.js
  • src/components/Summary/GeneSummary.js
  • src/components/Summary/GeneSummaryContainer.js
  • src/components/Summary/GeneSummaryContainerV2.js
  • src/helpers/ApolloClient.js
  • src/helpers/Utils.js
  • src/initialState.json
  • src/reducers.js
💤 Files with no reviewable changes (11)
  • src/components/DataViz/RNASeqVizV2.js
  • src/components/DataViz/featureSwitchReducer.js
  • src/components/Plots/UMAPPlot2.js
  • src/actions/FeatureSwitch/featureSwitchActions.js
  • src/components/DataViz/UMAPContainerV2.js
  • src/components/ExpressionTables/DiffexByClusterContainerV2.js
  • src/components/DataViz/UMAPVizV2.js
  • src/components/Summary/GeneSummaryContainerV2.js
  • src/components/Summary/CellTypeSummaryContainerV2.js
  • src/helpers/ApolloClient.js
  • src/components/DataViz/RNASeqVizContainerV2.js
🧰 Additional context used
🧬 Code graph analysis (17)
src/components/DataViz/UMAPViz.js (1)
src/helpers/ApolloClient.js (2)
  • fetchPlotlyData2025 (169-199)
  • fetchPlotlyData2025 (169-199)
src/components/DataViz/RNASeqViz.js (2)
src/helpers/Utils.js (6)
  • options (64-91)
  • options (97-118)
  • options (123-148)
  • options (153-153)
  • getDataTypeOptions2025 (122-150)
  • getDataTypeOptions2025 (122-150)
src/helpers/ApolloClient.js (4)
  • fetchGeneExpression2025 (249-283)
  • fetchGeneExpression2025 (249-283)
  • fetchPlotlyData2025 (169-199)
  • fetchPlotlyData2025 (169-199)
src/components/ConceptSelect/ConceptSelectContainer.js (2)
src/actions/DataType/dataTypeActions.js (2)
  • setDataTypeAndRedirect (29-67)
  • setDataTypeAndRedirect (29-67)
src/actions/Concepts/conceptActions.js (2)
  • setSelectedConceptAndRedirect (23-37)
  • setSelectedConceptAndRedirect (23-37)
src/components/ExpressionTables/DiffexByCluster.js (1)
src/helpers/ApolloClient.js (2)
  • fetchGeneExpression2025 (249-283)
  • fetchGeneExpression2025 (249-283)
src/components/ExpressionTables/DiffexInfoBar.js (1)
src/helpers/Utils.js (6)
  • getDataTypeOptions2025 (122-150)
  • getDataTypeOptions2025 (122-150)
  • options (64-91)
  • options (97-118)
  • options (123-148)
  • options (153-153)
src/components/Explorer/NephronSchemaCardContainer.js (2)
src/actions/EnrollmentCategory/enrollmentCategoryActions.js (2)
  • setEnrollmentCategory (3-8)
  • setEnrollmentCategory (3-8)
src/actions/Concepts/conceptActions.js (2)
  • setSelectedConceptAndRedirect (23-37)
  • setSelectedConceptAndRedirect (23-37)
src/components/Explorer/DataSelectorContainer.js (1)
src/actions/DataType/dataTypeActions.js (2)
  • setDataTypeAndRedirect (29-67)
  • setDataTypeAndRedirect (29-67)
src/components/DataViz/DataTypeSelectorContainer.js (4)
src/components/DataViz/UMAPContainer.js (1)
  • mapDispatchToProps (12-15)
src/components/DataViz/RegionalVizContainer.js (1)
  • mapDispatchToProps (15-26)
src/components/Explorer/Explorer.js (1)
  • mapDispatchToProps (31-48)
src/actions/DataType/dataTypeActions.js (2)
  • setDataType (3-27)
  • setDataType (3-27)
src/components/ConceptSelect/ConceptSelect.js (1)
src/helpers/ApolloClient.js (2)
  • fetchDataTypesForConcept2025 (235-247)
  • fetchDataTypesForConcept2025 (235-247)
src/components/Explorer/NephronSchemaCard.js (2)
src/helpers/ApolloClient.js (2)
  • fetchCellTypeHierarchy2025 (85-109)
  • fetchCellTypeHierarchy2025 (85-109)
src/helpers/googleAnalyticsHelper.js (2)
  • handleGoogleAnalyticsEvent (3-9)
  • handleGoogleAnalyticsEvent (3-9)
src/components/Home/SamplesByDataTypeTableContainer.js (4)
src/components/Summary/GeneSummaryContainer.js (1)
  • mapDispatchToProps (13-20)
src/components/ConceptSelect/ConceptSelectContainer.js (1)
  • mapDispatchToProps (15-26)
src/components/Explorer/DataSelectorContainer.js (1)
  • mapDispatchToProps (11-16)
src/actions/DataType/dataTypeActions.js (2)
  • setDataTypeAndRedirect (29-67)
  • setDataTypeAndRedirect (29-67)
src/components/Home/SamplesByDataTypeTable.js (1)
src/helpers/ApolloClient.js (2)
  • fetchDataTypeSummaryInformation2025 (138-167)
  • fetchDataTypeSummaryInformation2025 (138-167)
src/components/Summary/GeneSummary.js (1)
src/helpers/Utils.js (2)
  • getDataTypeOptions2025 (122-150)
  • getDataTypeOptions2025 (122-150)
src/components/Summary/CellTypeSummary.js (1)
src/helpers/ApolloClient.js (2)
  • fetchClusterHierarchy2025 (111-136)
  • fetchClusterHierarchy2025 (111-136)
src/components/Explorer/SamplesByDataTypeTable.js (2)
src/helpers/ApolloClient.js (2)
  • fetchDataTypeSummaryInformation2025 (138-167)
  • fetchDataTypeSummaryInformation2025 (138-167)
src/helpers/googleAnalyticsHelper.js (2)
  • handleGoogleAnalyticsEvent (3-9)
  • handleGoogleAnalyticsEvent (3-9)
src/components/DataViz/DataTypeSelector.js (1)
src/helpers/ApolloClient.js (2)
  • fetchDataTypeSummaryInformation2025 (138-167)
  • fetchDataTypeSummaryInformation2025 (138-167)
src/components/Summary/GeneSummaryContainer.js (1)
src/actions/DataType/dataTypeActions.js (2)
  • setDataTypeAndRedirect (29-67)
  • setDataTypeAndRedirect (29-67)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (20.19.0)
🔇 Additional comments (32)
package.json (1)

60-61: Minor: DevDependencies reordering appears unrelated to PR objective.

Lines 60–61 show a reordering of the react-scripts and sass devDependencies entries with no version changes. This change is purely cosmetic and unrelated to the feature switch removal objective.

Consider reverting this change to keep the PR focused on its core goal (removing V2 components and feature flags).

src/components/ConceptSelect/ConceptSelectFullWidth.js (1)

17-17: Props spreading simplifies pass-through logic.

The change to spread all props ({...this.props}) simplifies the component by eliminating explicit prop assignments. This aligns with the removal of feature flag props and maintains flexibility as the prop surface evolves.

src/components/Explorer/SamplesByDataTypeTable.js (1)

45-45: Consolidation to 2025 helper function is correct.

The migration to fetchDataTypeSummaryInformation2025 removes the conditional logic based on feature flags, simplifying the data fetching path.

src/actions/Concepts/conceptActions.js (2)

23-23: Verify all callers updated for simplified function signature.

The signature change from setSelectedConceptAndRedirect(concept, featureNewCellClusterData, props) to setSelectedConceptAndRedirect(concept, props) removes the feature flag parameter. Confirm all call sites have been updated to use the new 2-parameter signature.


26-35: Route consolidation is complete.

The routes have been successfully simplified:

  • cell_type/explorer/celltypesummary
  • gene/explorer/genesummary

Route definitions are properly configured in src/App.js and match the references in conceptActions.js. V2 route variants have been fully removed from the codebase.

src/initialState.json (1)

1-10: Feature flags completely removed from codebase.

Verification confirms that featureSNData, featureSCData, and featureNewCellClusterData have been completely removed—no remaining references found in reducers, selectors, components, or elsewhere.

src/components/Explorer/DataSelector.js (1)

24-24: Props correctly simplified to remove feature flags.

The removal of featureSCData and featureSNData props aligns with the broader refactor to eliminate feature-flag-based conditional logic. Reviewing SamplesByDataTypeTable.js confirms these props are no longer needed.

src/components/Home/SamplesByDataTypeTable.js (2)

4-4: API migration to 2025 data source.

The migration from fetchDataTypeSummaryInformation to fetchDataTypeSummaryInformation2025 simplifies the data-fetching logic by removing feature-flag conditionals. The relevant code snippet confirms the 2025 API returns the expected data structure.

Also applies to: 38-38


54-54: Verify setDataType signature consistency across the codebase.

The call to setDataType has been simplified from a 4-argument form to 2 arguments, removing featureSNData and featureSCData. Ensure all implementations and callers of setDataType have been updated to match this new signature.

Run the following script to verify consistent usage of the simplified setDataType signature:

#!/bin/bash
# Description: Verify all setDataType calls use the new 2-argument signature

# Find all setDataType implementations
echo "=== setDataType implementations ==="
ast-grep --pattern $'setDataType($$$) {
  $$$
}'

# Find all setDataType calls with context
echo -e "\n=== setDataType call sites ==="
rg -nP -C3 'setDataType\s*\(' --type=js --type=jsx -g '!node_modules' -g '!*.test.js'

# Check for any remaining 4-argument calls (heuristic: look for setDataType with multiple commas)
echo -e "\n=== Potential 4-argument setDataType calls ==="
rg -nP 'setDataType\([^)]*,[^)]*,[^)]*,' --type=js --type=jsx -g '!node_modules'
src/components/Plots/UMAPPlot.js (1)

20-31: UMAP reference image assets verified and in place.

The new v3 reference images exist in the public directory:

  • public/img/KPMP_SC_reference-UMAP_v3.png (232 KB)
  • public/img/KPMP_SN_reference-UMAP_v3.svg (17.5 MB)

No action needed.

src/components/DataViz/UMAPViz.js (1)

5-5: Migration to 2025 API is complete and consistent.

The import at line 5 and usage at line 67 correctly use fetchPlotlyData2025. No remaining references to the old fetchPlotlyData function exist in the codebase. The response structure with referenceData containing cluster properties (clusterAbbreviation, clusterName, xValues, yValues, color) is properly handled in the setData() method. The same function is also consistently used in RNASeqViz.js.

src/components/ExpressionTables/DiffexInfoBar.js (1)

3-3: LGTM! Feature flag removed and consolidated to 2025 helper.

The conditional logic based on featureNewCellClusterData has been successfully removed, and the component now consistently uses getDataTypeOptions2025. The change aligns with the PR objective to remove feature switches and consolidate to 2025-era helpers. Error handling is preserved.

Also applies to: 18-27

src/components/Explorer/NephronSchemaCard.js (1)

3-3: LGTM! Feature-gated logic removed successfully.

The component has been simplified to always use fetchCellTypeHierarchy2025 and the setSelectedConcept call no longer branches on feature flags. This consolidation aligns with the PR's goal to remove V2 component variants and feature switches.

Also applies to: 25-34

src/components/ExpressionTables/DiffexByCluster.js (1)

5-5: LGTM! Consolidated to 2025 data fetching path.

The component now consistently uses fetchGeneExpression2025 for all non-regional data types, and the featureNewCellClusterData prop has been correctly removed from the DiffexInfoBar component. This simplification aligns with the broader refactor to remove feature switches.

Also applies to: 56-64, 205-205

src/components/DataViz/RNASeqViz.js (1)

7-11: LGTM! Successfully migrated to 2025-era helpers.

All data-fetching helpers have been updated to use the 2025 variants:

  • getDataTypeOptions2025 (line 102)
  • fetchGeneExpression2025 (line 122)
  • fetchPlotlyData2025 (line 134)

The component logic remains unchanged, and the file has been reformatted for consistency. This aligns with the PR's goal to consolidate to 2025-era helpers.

Also applies to: 102-102, 122-131, 134-141

src/components/DataViz/UMAPContainer.js (1)

2-2: UMAPViz component correctly replaces the old UMAP component.

The container now wraps UMAPViz instead of UMAP. The consolidated component exists and the old UMAP component has been removed. Redux wiring remains unchanged.

src/components/Summary/CellTypeSummaryContainer.js (2)

8-12: LGTM! Clean removal of feature switch state dependencies.

The removal of featureSNData, featureSCData, and featureNewCellClusterData from mapStateToProps correctly aligns with the PR objectives.


17-23: The /explorer/diffex route is properly configured. The route exists in src/App.js:82 and correctly maps to the DiffexByClusterContainer component.

src/components/Home/SamplesByDataTypeTableContainer.js (1)

7-18: LGTM! Consistent simplification of state and dispatch props.

The removal of featureSNData and featureSCData from mapStateToProps and the simplified setDataType signature correctly align with the updated setDataTypeAndRedirect action that now accepts only (concept, props). This is consistent with similar changes across other container components.

src/components/Explorer/DataSelectorContainer.js (1)

11-16: LGTM! Simplified dispatch signature.

The updated setSelectedConcept now correctly dispatches setDataTypeAndRedirect(dataType, props) without feature switch parameters, aligning with the consolidated action signature shown in the relevant code snippets.

src/components/DataViz/DataTypeSelector.js (3)

6-6: LGTM! Consolidation to 2025 data fetcher.

The import change from fetchDataTypeSummaryInformation to fetchDataTypeSummaryInformation2025 correctly consolidates to the newer API variant as part of removing legacy feature switch logic.


60-76: LGTM! Simplified setDataType calls.

The removal of featureSNData and featureSCData parameters from the setDataType calls (Lines 63 and throughout) correctly simplifies the data type selection flow.


158-164: LGTM! Simplified handleInputChange.

Line 161 correctly updates the setDataType call to pass only inputValue.value, removing the extra feature switch parameters.

src/reducers.js (1)

8-16: No orphaned references to removed reducers detected.

The removal of featureSNData, featureSCData, and featureNewCellClusterData from the combined state is clean with no remaining references in the codebase.

src/components/Summary/CellTypeSummary.js (1)

48-48: LGTM!

The simplified setDataTypeAndCluster call with two arguments aligns with the updated function signature after feature switch removal.

src/components/ConceptSelect/ConceptSelect.js (1)

21-46: LGTM!

The handleSelect method is cleanly refactored to use the simplified signatures. The data flow is straightforward:

  • Always uses fetchDataTypesForConcept2025
  • Calls setDataType and setSelectedConcept with single arguments
  • Error handling is preserved
src/components/ConceptSelect/ConceptSelectContainer.js (1)

15-26: LGTM!

The mapDispatchToProps is cleanly refactored:

  • setDataType now dispatches setDataTypeAndRedirect with simplified arguments
  • setSelectedConcept correctly uses conditional dispatch based on props.useRedirection

This aligns well with the simplified action creator signatures defined in the relevant code snippets.

src/components/Explorer/NephronSchemaCardContainer.js (1)

12-18: LGTM!

The mapDispatchToProps is correctly updated to use the simplified setSelectedConceptAndRedirect(concept, props) signature while preserving the enrollment category reset behavior.

src/components/Summary/GeneSummary.js (2)

5-6: LGTM on helper migration.

The imports are correctly updated to use the 2025-era helper functions, aligning with the broader refactoring effort.


194-194: LGTM on removing featureNewCellClusterData prop.

This aligns with the PR objective to remove feature switch logic. The component now uses a simpler API without feature flags.

src/App.js (2)

19-27: LGTM on V2 component removal.

The imports are correctly updated to reference non-V2 containers (RNASeqVizContainer and GeneSummaryContainer), and the corresponding V2 routes have been removed. This consolidation aligns with the PR objective to remove feature switches.


75-88: Routes look consistent.

All routes now reference non-V2 components. The cleanup is complete with no orphaned V2 route definitions.

Comment on lines 89 to 112
fetchDataTypeSummaryInformation = async (geneSymbol) => {
this.setState({ isDatasetSummaryLoading: true, datasetToggle: 'collapsed' });
if ((this.props.dataType === "sc" && this.props.featureSCData) || (this.props.dataType === "sn" && this.props.featureSNData)) {
return fetchDataTypeSummaryInformation2025(geneSymbol).then(
(datasetSummary) => {
if (datasetSummary) {
datasetSummary = this.formatGeneDataset(datasetSummary)
this.setSelectedDatasetSummary(this.props.dataType, datasetSummary)
this.setState({ isDatasetSummaryLoading: false });
return datasetSummary
}
},
(error) => {
let selectedDataset = {
participantCount: '-',
hrtCount: '-',
akiCount: '-',
ckdCount: '-'
}

console.log('There was a problem fetching the gene summary data: ' + error)
this.setState({ selectedDataset, isDatasetSummaryLoading: false });
return fetchDataTypeSummaryInformation2025(geneSymbol).then(
(datasetSummary) => {
if (datasetSummary) {
datasetSummary = this.formatGeneDataset(datasetSummary)
this.setSelectedDatasetSummary(this.props.dataType, datasetSummary)
this.setState({ isDatasetSummaryLoading: false });
return datasetSummary
}
);
} else {
return fetchDataTypeSummaryInformation(geneSymbol).then(
(datasetSummary) => {
if (datasetSummary) {
datasetSummary = this.formatGeneDataset(datasetSummary)
this.setSelectedDatasetSummary(this.props.dataType, datasetSummary)
this.setState({ isDatasetSummaryLoading: false });
return datasetSummary
}
},
(error) => {
let selectedDataset = {
participantCount: '-',
hrtCount: '-',
akiCount: '-',
ckdCount: '-'
}

console.log('There was a problem fetching the gene summary data: ' + error)
this.setState({ selectedDataset, isDatasetSummaryLoading: false });
},
(error) => {
let selectedDataset = {
participantCount: '-',
hrtCount: '-',
akiCount: '-',
ckdCount: '-'
}
);
}

console.log('There was a problem fetching the gene summary data: ' + error)
this.setState({ selectedDataset, isDatasetSummaryLoading: false });
}
);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for the fetchDataTypeSummaryInformation2025 function definition and usage
echo "=== Looking for fetchDataTypeSummaryInformation2025 definition ==="
rg -n 'fetchDataTypeSummaryInformation2025' --type js --type ts -B 3 -A 10

echo -e "\n=== Looking for getDataTypeSummaryInformation2025 GraphQL query ==="
rg -n 'getDataTypeSummaryInformation2025' --type js --type ts --type graphql -B 2 -A 5

echo -e "\n=== Checking for older fetch variants (non-2025) ==="
rg -n 'fetchDataTypeSummaryInformation' --type js --type ts | grep -v '2025' | head -20

Repository: KPMP/pegasus-web

Length of output: 11743


🏁 Script executed:

#!/bin/bash
echo "=== Full fetchDataTypeSummaryInformation2025 implementation ==="
sed -n '138,170p' src/helpers/ApolloClient.js

echo -e "\n=== Checking if there are multiple versions or overloads ==="
rg -n 'const fetchDataTypeSummaryInformation2025|export const fetchDataTypeSummaryInformation2025' src/helpers/ApolloClient.js -A 3

Repository: KPMP/pegasus-web

Length of output: 1537


🏁 Script executed:

#!/bin/bash
echo "=== Check fetchDataTypeSummaryInformation method signature and parameters ==="
sed -n '89,115p' src/components/DataViz/DataTypeSelector.js

echo -e "\n=== Check where geneSymbol comes from ==="
sed -n '35,45p' src/components/DataViz/DataTypeSelector.js

echo -e "\n=== Check old implementation if it exists ==="
git log --oneline -n 5 src/components/DataViz/DataTypeSelector.js 2>/dev/null || echo "Git history not available"

Repository: KPMP/pegasus-web

Length of output: 1838


Fix parameter mismatch: geneSymbol is being passed to wrong parameter slot.

The refactored fetchDataTypeSummaryInformation method calls fetchDataTypeSummaryInformation2025(geneSymbol) at line 91, but the actual function signature only accepts fetchPolicy as a parameter: async (fetchPolicy = 'no-cache'). This passes the gene symbol string where a fetch policy strategy is expected, which will cause incorrect behavior. The geneSymbol parameter is unused by the underlying query and should not be passed. Either remove the argument or update the function to accept and use geneSymbol if the query needs gene-specific filtering.

Comment on lines 48 to 51
handleDataTypeClick(dataType) {
handleGoogleAnalyticsEvent('Explorer', 'Navigation', `data type: ${dataType} and gene: ${this.props.gene}`);
this.props.setSelectedConcept(dataType, this.props.featureSNData, this.props.featureSCData, this.props);
this.props.setSelectedConcept(dataType, this.props);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

rg -n -A 2 'setSelectedConcept\s*\(' --type=js --type=jsx -g '!node_modules'

Repository: KPMP/pegasus-web

Length of output: 87


🏁 Script executed:

# Also find the implementation/definition of setSelectedConcept
rg -n -B 2 'setSelectedConcept\s*[=:]' --type=js --type=jsx -g '!node_modules' | head -50

Repository: KPMP/pegasus-web

Length of output: 87


🏁 Script executed:

rg -n -A 2 'setSelectedConcept\s*\(' --type=js -g '!node_modules'

Repository: KPMP/pegasus-web

Length of output: 3249


🏁 Script executed:

# Search for setSelectedConcept definition without type restriction
rg -n 'setSelectedConcept\s*[:=]' -g '!node_modules' | head -50

Repository: KPMP/pegasus-web

Length of output: 322


🏁 Script executed:

sed -n '12,40p' src/actions/Concepts/conceptActions.js

Repository: KPMP/pegasus-web

Length of output: 946


🏁 Script executed:

# Also check what type of parameter concept should be
cat -n src/actions/Concepts/conceptActions.js | head -50

Repository: KPMP/pegasus-web

Length of output: 1513


Fix incorrect setSelectedConcept call signature in SamplesByDataTypeTable.js.

The call at line 50 passes (dataType, this.props) but the function signature expects a single concept object with {type, value, name} properties. All other call sites correctly pass a concept object. Update the call to match the expected format, similar to how it's done in NephronSchemaCard.js.

Comment on lines 32 to 36
fetchClusterHierarchy = async () => {
this.setState({ isLoading: true });
if (this.props.featureNewCellClusterData){
console.log("Using 2025 query for cluster hierarchy");
let results = await fetchClusterHierarchy2025(this.props.cellType);

this.setState({ cellTypeSummary: results, isLoading: false });
}else {
let results = await fetchClusterHierarchy(this.props.cellType);
this.setState({ cellTypeSummary: results, isLoading: false });
}
let results = await fetchClusterHierarchy2025(this.props.cellType);
this.setState({ cellTypeSummary: results, isLoading: false });
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add null check for results to prevent potential runtime error.

fetchClusterHierarchy2025 returns undefined when an error occurs (per ApolloClient.js lines 110-135). Setting cellTypeSummary to undefined could cause issues when passed to the Grid component's rows prop.

🔎 Proposed fix
     fetchClusterHierarchy = async () => {
         this.setState({ isLoading: true });
         let results = await fetchClusterHierarchy2025(this.props.cellType);
-        this.setState({ cellTypeSummary: results, isLoading: false });
+        this.setState({ cellTypeSummary: results || [], isLoading: false });
     };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fetchClusterHierarchy = async () => {
this.setState({ isLoading: true });
if (this.props.featureNewCellClusterData){
console.log("Using 2025 query for cluster hierarchy");
let results = await fetchClusterHierarchy2025(this.props.cellType);
this.setState({ cellTypeSummary: results, isLoading: false });
}else {
let results = await fetchClusterHierarchy(this.props.cellType);
this.setState({ cellTypeSummary: results, isLoading: false });
}
let results = await fetchClusterHierarchy2025(this.props.cellType);
this.setState({ cellTypeSummary: results, isLoading: false });
};
fetchClusterHierarchy = async () => {
this.setState({ isLoading: true });
let results = await fetchClusterHierarchy2025(this.props.cellType);
this.setState({ cellTypeSummary: results || [], isLoading: false });
};

Comment on lines 69 to 72
handleLinkClick = (dataTypeShort, dataType) => {
handleGoogleAnalyticsEvent('Explorer', 'Navigation', `data type: ${dataTypeShort} and gene: ${this.props.gene.symbol}`);
this.props.setDataType(dataType, this.props.featureSNData, this.props.featureSCData, this.props);
this.props.setDataType(dataType, this.props);
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove unused second argument from setDataType call.

As noted in the container review, setDataType only accepts dataType as a parameter. The this.props argument is ignored.

🔎 Proposed fix
     handleLinkClick = (dataTypeShort, dataType) => {
         handleGoogleAnalyticsEvent('Explorer', 'Navigation', `data type: ${dataTypeShort} and gene: ${this.props.gene.symbol}`);
-        this.props.setDataType(dataType, this.props);
+        this.props.setDataType(dataType);
     };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
handleLinkClick = (dataTypeShort, dataType) => {
handleGoogleAnalyticsEvent('Explorer', 'Navigation', `data type: ${dataTypeShort} and gene: ${this.props.gene.symbol}`);
this.props.setDataType(dataType, this.props.featureSNData, this.props.featureSCData, this.props);
this.props.setDataType(dataType, this.props);
};
handleLinkClick = (dataTypeShort, dataType) => {
handleGoogleAnalyticsEvent('Explorer', 'Navigation', `data type: ${dataTypeShort} and gene: ${this.props.gene.symbol}`);
this.props.setDataType(dataType);
};

Comment on lines +13 to +20
const mapDispatchToProps = (dispatch, props) =>
({
setDataType(dataType) {
dispatch(setEnrollmentCategory("all"));
dispatch(setDataTypeAndRedirect(dataType, props));
}

});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Unused parameter in setDataType call from GeneSummary.

The setDataType function signature here accepts only dataType, but in GeneSummary.js (line 71), it's called with two arguments: this.props.setDataType(dataType, this.props). The second argument is silently ignored.

Since props is already available via the mapDispatchToProps closure, the behavior is correct, but the call site in GeneSummary.js should be updated to remove the unused argument for clarity.

🔎 Suggested fix in GeneSummary.js
// In src/components/Summary/GeneSummary.js line 71
-        this.props.setDataType(dataType, this.props);
+        this.props.setDataType(dataType);

Committable suggestion skipped: line range outside the PR's diff.


export const getDataTypeOptionsWithEnrollmentCategory = async (geneSymbol, cluster, datasetSummary, currentEnrollmentCategory) => {
let options = await getDataTypeOptions(geneSymbol, cluster, datasetSummary);
let options = await getDataTypeOptions2025(geneSymbol, cluster, datasetSummary);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Extra argument passed to getDataTypeOptions2025.

getDataTypeOptions2025 (defined at lines 122-150) accepts only two parameters: (geneSymbol, cluster). The third argument datasetSummary is being passed but will be ignored. This appears to be leftover from when the older getDataTypeOptions was called. Consider removing it for clarity.

🔎 Proposed fix
 export const getDataTypeOptionsWithEnrollmentCategory = async (geneSymbol, cluster, datasetSummary, currentEnrollmentCategory) => {
-    let options = await getDataTypeOptions2025(geneSymbol, cluster, datasetSummary);
+    let options = await getDataTypeOptions2025(geneSymbol, cluster);
     for (let index in options) {

@zwright zwright merged commit bb2bb43 into develop Jan 5, 2026
1 check passed
@zwright zwright deleted the KPMP-6342_RemoveFeatureSwitch branch January 5, 2026 18:50
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.

2 participants