Issue: Fix default API ordering within releases in viewers
Description
The default viewer display order (by repository → release) shows APIs within each release in incorrect order. When users click column headers to sort alphabetically, the order is correct, but the default view has APIs out of order within releases.
Current Behavior
- ✓ Alphabetical sorting (clicking column headers): Works correctly
- ✗ Default order (by repository → release): APIs within a release appear in wrong order
Example: Within a single release (e.g., SIM-Swap r1.1), the APIs might appear as:
- sim-swap-subscriptions (initial, v0.1.0)
- sim-swap (stable, v1.1.0)
This is backwards - the stable base API should appear before the initial subscriptions variant.
Root Cause
In enrichment.js:334-339, the createFlattenedAPIView function sorts the flattened API list by:
- Repository name
- Canonical API name
This destroys the release grouping structure. APIs from different releases in the same repository get interleaved based on their names, breaking the "by repository then release" order.
Current sorting code:
// Sort by repository and API name for consistent ordering
flatApis.sort((a, b) => {
const repoCompare = a.repository.localeCompare(b.repository);
if (repoCompare !== 0) return repoCompare;
return (a.canonical_name || a.api_name).localeCompare(b.canonical_name || b.api_name);
});
Proposed Solution
Modify the sorting in createFlattenedAPIView to:
- Preserve repository grouping (keep current behavior)
- Preserve release grouping within repositories (fix: don't sort across releases)
- Within each release, sort by:
- Maturity level: stable → initial → rc → alpha → beta
- Then by canonical_name (alphabetically)
Implementation approach:
- Group APIs by
repository + release_tag
- Sort within each group by maturity then name
- Flatten while preserving group order
This ensures stable APIs appear before initial APIs within the same release, making the default view more intuitive for users scanning the API portfolio.
Affected Files
Context
Identified in PR review: #68 (comment)
Priority
Low - UX polish, not blocking functionality. The interactive sorting works correctly, so users can reorder as needed.
Labels
viewer, enhancement, low-priority
Issue: Fix default API ordering within releases in viewers
Description
The default viewer display order (by repository → release) shows APIs within each release in incorrect order. When users click column headers to sort alphabetically, the order is correct, but the default view has APIs out of order within releases.
Current Behavior
Example: Within a single release (e.g., SIM-Swap r1.1), the APIs might appear as:
This is backwards - the stable base API should appear before the initial subscriptions variant.
Root Cause
In
enrichment.js:334-339, thecreateFlattenedAPIViewfunction sorts the flattened API list by:This destroys the release grouping structure. APIs from different releases in the same repository get interleaved based on their names, breaking the "by repository then release" order.
Current sorting code:
Proposed Solution
Modify the sorting in
createFlattenedAPIViewto:Implementation approach:
repository+release_tagThis ensures stable APIs appear before initial APIs within the same release, making the default view more intuitive for users scanning the API portfolio.
Affected Files
workflows/release-collector/scripts/lib/enrichment.js-createFlattenedAPIViewfunction (lines 317-342)Context
Identified in PR review: #68 (comment)
Priority
Low - UX polish, not blocking functionality. The interactive sorting works correctly, so users can reorder as needed.
Labels
viewer,enhancement,low-priority