Skip to content

Implement custom sorting for Top Repo column in DevIndex #9308

@tobiu

Description

@tobiu

Problem:
The topRepo column in the DevIndex grid maps to an array ['repoName', count]. Default sorting fails because it compares array references rather than the contribution count.

Proposed Solution:
Leverage "Turbo Mode" soft hydration by adding a topRepoCount virtual field to DevIndex.model.Contributor and intercepting the sort property inside DevIndex.view.home.GridContainer#onSortColumn to sort by this count.

  • apps/devindex/model/Contributor.mjs: Add topRepoCount virtual field using (data.topRepo ?? data.tr)?.[1] || 0.
  • apps/devindex/view/home/GridContainer.mjs: Override onSortColumn to swap topRepo for topRepoCount in sortOpts before passing to the store, preserving the original property for removeSortingCss to keep visual state correct.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions