Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add sorting by exclusive label. #33206

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

telackey
Copy link

@telackey telackey commented Jan 10, 2025

This PR adds a new sort option for exclusive labels.

While this has been looked at before (see the first comment below for a list), the goal of this particular approach was to do it in the most lightweight and flexible way possible, by making use of the existing exclusive label system. No changes are made to the Issue model.

For exclusive labels, a new property is exposed called "order", while in the UI options are populated automatically in the Sort column (see screenshot below) for each exclusive label scope.

This doesn't impose any particular scheme for prioritization, labeling, etc.; that's all up to the user.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 10, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 10, 2025
@github-actions github-actions bot added modifies/translation modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend labels Jan 10, 2025
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 10, 2025
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 10, 2025
@telackey telackey changed the title DRAFT: Add sorting of exclusive labels. DRAFT: Add sorting by exclusive labels. Jan 10, 2025
@telackey telackey changed the title DRAFT: Add sorting by exclusive labels. DRAFT: Add sorting by exclusive label. Jan 10, 2025
@wxiaoguang
Copy link
Contributor

There are different PRs for this problem and they conflict with each other (and the problem is pending for long time)

@dboreham
Copy link

Screen shot showing the feature:

image

@techknowlogick
Copy link
Member

pinging @lafriks as this is likely relevant to your interests

@dboreham
Copy link

Proposed fix for #2616

@telackey telackey marked this pull request as ready for review February 17, 2025 20:11
@telackey telackey changed the title DRAFT: Add sorting by exclusive label. Add sorting by exclusive label (fix for #2616) Feb 17, 2025
@telackey telackey changed the title Add sorting by exclusive label (fix for #2616) Add sorting by exclusive label. Feb 17, 2025
@telackey
Copy link
Author

telackey commented Feb 17, 2025

There are different PRs for this problem and they conflict with each other (and the problem is pending for long time)

Yes, it has been a popular feature. I think this new approach has some merit though. To answer in order:

#11669 main focus is on the prioritization of issues and sets a specific prioritization scheme. While it is similar in that it used labels to accomplish its goal, the aim is a little different. This PR is directed toward sorting by label in general, and while sorting by a priority label would be pretty common use case, it is not the exclusive use.

#32086 is a more involved project management enhancement intended for prioritizing work based on an estimated time and effort. This PR is focused on leveraging the existing label system by adding sort functionality to exclusive labels, not creating a completely new prioritization scheme.

#4823 is similar to #11669 in that its goal is focused on prioritization, but in that case it extends the Issue model directly rather than using labels. An argument can be made for including priority directly on the Issue but that is a separate concern. This PR takes a lighter but more generic approach, by making use of user-defined labels. Users can certainly define priority-related labels, but this mechanism would support sorting by any other labels they create as well.

While #2616 represents one of the dominate use cases for this feature, but they are different in approach, as that one is again extending the Issue model to create a new priority/severity scheme (somewhat similar to #4823). Sorting is only secondary to the addition of the severity property.

By contrast, this PR doesn't impose any particular scheme of prioritization, severity, etc. It simply enhances the existing label system slightly to allow the user to take whatever exclusive labels they already have (or would like to create), and sort them in the UI in a user-defined order. It can certainly be used to answer some of the same problems that the earlier PRs were also addressing, but it does so in a very general and user-customizable way.

@telackey
Copy link
Author

telackey commented Feb 17, 2025

Screenshot of the Label edit UI (using the included Advanced label set):

image

Sort Order is only shown if the Exclusive box is checked:

image

@telackey telackey requested a review from lunny February 17, 2025 23:02
@lafriks
Copy link
Member

lafriks commented Feb 18, 2025

pinging @lafriks as this is likely relevant to your interests

I will look into it this weekend but from the first look it does cover some use cases but could have it's downsides

@telackey telackey changed the title Add sorting by exclusive label. feat: Add sorting by exclusive label. Feb 19, 2025
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. modifies/frontend modifies/go Pull requests that update Go code modifies/migrations modifies/templates This PR modifies the template files modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants