Skip to content

fix(issues): sort scoped labels by exclusive order in dropdowns - #38893

Open
HsukqiLee wants to merge 1 commit into
go-gitea:mainfrom
TsinbeiLabs:fix/38872-scoped-label-display-order
Open

fix(issues): sort scoped labels by exclusive order in dropdowns#38893
HsukqiLee wants to merge 1 commit into
go-gitea:mainfrom
TsinbeiLabs:fix/38872-scoped-label-display-order

Conversation

@HsukqiLee

Copy link
Copy Markdown

Closes #38872

Labels in the label selection dropdown (issue/PR sidebar, new issue form) were always listed alphabetically, so a scoped set like the default Priority labels showed up as Critical, High, Low, Medium even though each label carries an exclusive order.

This adds CompareLabelForDisplay/SortLabelsForDisplay in models/issues: labels are grouped by their exclusive scope and sorted by exclusive order within a scope (unordered ones last), falling back to name order. The sorting is applied to the issue page sidebar data and the shared label filter data, so the filter dropdown on the issue list gets the same ordering.

Unscoped labels are unaffected and still sort by name. Includes a unit test covering the default Priority label set.

Copilot AI lite review requested due to automatic review settings August 12, 2026 15:02
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@HsukqiLee
HsukqiLee force-pushed the fix/38872-scoped-label-display-order branch from 844d579 to 6d21b99 Compare August 12, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/issues type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sort labels by sort order instead of alphabetically in issue view

3 participants