allow grouped "track hub" style menu configuration from json#346
allow grouped "track hub" style menu configuration from json#346
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request refactors the track configuration system to support grouped "track hub" style menu configuration from JSON files. The primary change is renaming the "sections" terminology to "groups" throughout the codebase to better align with track hub conventions, along with adding a sample JSON configuration file demonstrating the new grouped structure.
Key Changes
- Renamed "sections" to "groups" across all track configuration code for consistency with track hub terminology
- Added backwards compatibility in
prepRegistryConfigto handle registries with or without explicit groups - Created a new sample JSON configuration file (
mm10_sample.json) demonstrating grouped track organization
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
resources/tracks/mm10_sample.json |
New sample track configuration demonstrating grouped track hub format with genes and regulation categories |
js/widgets/trackWidgets.js |
Refactored annotateTracks parameter and references from "sections" to "groups"; updated prepRegistryConfig to support grouped format with fallback |
js/widgets/trackSelectionModal.js |
Renamed function parameter and all internal references from "sections" to "groups"; updated recursive rendering logic |
js/widgets/trackSelectionListModal.js |
Renamed function parameter and flattening logic from "sections" to "groups" for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "label": "Genes and Gene Predictions", | ||
| "tracks": [ | ||
| { | ||
| "id": "HLTOGAannotvHg38v1", |
There was a problem hiding this comment.
The track ID "HLTOGAannotvHg38v1" has inconsistent casing compared to the URL which contains "HLTOGAannotVsHg38v1" (note the capital "V" in "Vs"). Consider using consistent casing, such as "HLTOGAannotVsHg38v1" to match the URL filename.
| "id": "HLTOGAannotvHg38v1", | |
| "id": "HLTOGAannotVsHg38v1", |
| <div class="bg-light text-center py-2 d-flex justify-content-between align-items-center" role="button" data-bs-toggle="collapse" data-bs-target="#collapseSection${index}" aria-expanded="true" aria-controls="collapseSection${index}"> | ||
| <span style="font-size: 1.2rem;">${section.label}</span> | ||
| <span style="font-size: 1.2rem;">${group.label}</span> | ||
| <span id="collapseIcon${index}" class="bi bi-dash"></span> | ||
| </div>` : ''} | ||
|
|
||
| ${level === 0 ? | ||
| `<div class="collapse show mt-3" id="collapseSection${index}">` : |
There was a problem hiding this comment.
[nitpick] For consistency with the refactoring from "sections" to "groups", consider renaming the HTML element IDs from collapseSection${index} to collapseGroup${index} to match the new terminology throughout the codebase.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.