Skip to content

Merge develop branches together#645

Merged
HaneenT merged 15 commits into
developfrom
devleop
Jun 2, 2026
Merged

Merge develop branches together#645
HaneenT merged 15 commits into
developfrom
devleop

Conversation

@Dert1129

@Dert1129 Dert1129 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Afferent Artery/Arteriole Endothelial Cell and Papillary Epithelial Cell types.
  • Bug Fixes

    • Enhanced cell interaction handlers in schematics for improved click and hover accuracy.
    • Updated cell type mappings and ontology references for consistency.
  • Documentation

    • Added citations to visualization schematics.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR extends the Explorer component's renal schematic visualizations by adding two new cell types to the enumeration, updating cell-type-to-ontology ID mappings, refactoring glomerulus and tubule schematic event handlers to route interactions based on SVG group IDs and cell types, and wiring additional state props to the Vessels tab while adding citations.

Changes

Renal Schematic Cell Type Handling and State Wiring

Layer / File(s) Summary
Cell type enumeration and ontology mappings
src/components/Explorer/CellTypeEnum.js, src/helpers/Utils.js
New AFFERENT_ARTERY_ARTERIOLE_ENDOTHELIAL_CELL and PAPILLARY_EPITHELIAL_CELL entries added to CellTypeEnum. svgToCellMap and cellMapToOntologyId updated with mappings for podocyte, collecting duct subtypes, proximal tubule segments, distal convoluted tubule, arteriole endothelial cells, juxtaglomerular cells, macula densa, and papillary epithelial cells.
Glomerulus schematic click and hover handlers
src/components/Explorer/GlomerulusSchematic.js
Cell-click handler refactored from if/else to switch on svg_group_id with explicit cases for glomerulus cell groups and default ontology-derived flow. Cell-hover handler enhanced with logging and svgToCellMap lookup to resolve and log the mapped cell type.
Tubule schematic hover routing and event registration
src/components/Explorer/TubuleSchematic.js
Expanded handleHover switch cases map multiple tubule cell types (macula densa, distal convoluted tubule, proximal tubule epithelial segments, collecting duct subtypes) to specific toggleCollapseTab event values. Effect hook now registers the cell-hover event listener and cleans it up on unmount.
Tab component state wiring and citations
src/components/Explorer/CellTypeTabs.js, src/components/Explorer/TabSection.js, src/components/Explorer/AccordionTabSection.js
Vessels tab's TabSection now receives setActiveTab, setActiveCell, and activeCell props. TabSection hover handler simplified to only call handleSchematicHoverEnter without local state updates. Citation elements added to both TabSection and AccordionTabSection.

Possibly related PRs

  • KPMP/pegasus-web#621: Refines GlomerulusSchematic's cell-click handler logic by switching on event.detail.svg_group_id, building directly on event listener infrastructure from the retrieved PR.
  • KPMP/pegasus-web#632: Modifies Explorer schematics plumbing in AccordionTabSection and TabSection by adjusting how hover and active-cell state props are wired into schematic children.
  • KPMP/pegasus-web#639: Builds on prior updates to Explorer schematic components' click and hover handlers, cell mappings in svgToCellMap and cellMapToOntologyId, and tab component state wiring.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devleop

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (5)
src/components/Explorer/GlomerulusSchematic.js (2)

31-31: ⚡ Quick win

Remove debugging console.log statements.

These console.log statements appear to be debugging artifacts left in the code. They should be removed before merging to production.

🧹 Proposed fix to remove console.log statements
                 case "Afferent_Arteriole_Endothelial_Cell":
-                    console.log("Clicked on Afferent Arteriole Endothelial Cell");
                     setActiveCell(CellTypeEnum.AFFERENT_ARTERY_ARTERIOLE_ENDOTHELIAL_CELL);
                     setActiveTab('4');
                     break;
                 case "Efferent_Arteriole_Endothelial_Cell":
-                    console.log("Clicked on Efferent Arteriole Endothelial Cell");
                     setActiveCell(CellTypeEnum.EFFERENT_ARTERIOLE_ENDOTHELIAL_CELL);
                     setActiveTab('4');
                     break;
                 case "Juxtaglomerular_Granular_Cell":
-                    console.log("Clicked on Juxtaglomerular_Granular_Cell");
                     setActiveCell(CellTypeEnum.JUXTAGLOMERULAR_GRANULAR_CELL);
                     setActiveTab('4');

Also applies to: 36-36, 41-41


62-62: ⚡ Quick win

Remove debugging console.log statement.

This console.log statement appears to be a debugging artifact and should be removed before merging.

🧹 Proposed fix
             const cellType = svgToCellMap[svgId];
-            console.log(`Hovered over SVG group: ${svgId}, mapped to cell type: ${cellType}`);
         
             if (cellType) {
src/components/Explorer/TabSection.js (2)

22-23: ⚡ Quick win

Inconsistent state management between top-level and nested buttons.

The top-level button's onMouseEnter handler (line 72) now only calls handleSchematicHoverEnter without updating local state, while the cell type (line 22) and subregion (line 35) buttons still update both parent state and local activeCell state via setState. This inconsistency may be intentional, but if the goal is to centralize state management in the parent component, all buttons should follow the same pattern.

Also applies to: 35-36, 72-72


96-96: 💤 Low value

Verify citation access date.

The citation indicates "Accessed on June 1, 2026" but the current date is June 2, 2026. Consider updating to the current date or verify if June 1 is the intended access date.

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

132-132: 💤 Low value

Verify citation access date.

The citation indicates "Accessed on June 1, 2026" but the current date is June 2, 2026. Consider updating to the current date or verify if June 1 is the intended access date.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8ae8fd5-5a66-4e59-b7a2-49519eebbe80

📥 Commits

Reviewing files that changed from the base of the PR and between d20666b and 444d53c.

📒 Files selected for processing (7)
  • src/components/Explorer/AccordionTabSection.js
  • src/components/Explorer/CellTypeEnum.js
  • src/components/Explorer/CellTypeTabs.js
  • src/components/Explorer/GlomerulusSchematic.js
  • src/components/Explorer/TabSection.js
  • src/components/Explorer/TubuleSchematic.js
  • src/helpers/Utils.js

Comment on lines +45 to 55
default:
let ontologyId = event.detail.representation_of;
ontologyId = ontologyId.replace('http://purl.obolibrary.org/obo/', '').replace(/_/g, ':');
// Find the matching object in hubmapTermMap
const hubmapTermMap = await fetchHubmapTermMap();
hubmapTermMap.forEach(obj => {
if (obj.hubmapOntologyId === ontologyId) {
handleCellTypeClick(obj.cellType);
}
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Wrap default case in a block to restrict variable scope.

The variable declarations ontologyId and hubmapTermMap in the default case should be wrapped in curly braces to prevent potential access from other switch cases due to JavaScript's block scoping rules.

🔧 Proposed fix to add block scope
                 default:
+                {
                     let ontologyId = event.detail.representation_of;
                     ontologyId = ontologyId.replace('http://purl.obolibrary.org/obo/', '').replace(/_/g, ':');
                     // Find the matching object in hubmapTermMap
                     const hubmapTermMap = await fetchHubmapTermMap();
                     hubmapTermMap.forEach(obj => {
                         if (obj.hubmapOntologyId === ontologyId) {
                             handleCellTypeClick(obj.cellType);
                         }
                     });
+                    break;
+                }
-            }
🧰 Tools
🪛 Biome (2.4.16)

[error] 46-46: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

(lint/correctness/noSwitchDeclarations)


[error] 49-49: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

(lint/correctness/noSwitchDeclarations)

@HaneenT HaneenT merged commit bcc463e into develop Jun 2, 2026
1 check passed
@HaneenT HaneenT deleted the devleop branch June 2, 2026 18:13
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