Skip to content

Fix: Hide divider when labels are hidden #27668

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

Closed
wants to merge 2 commits into from

Conversation

neel1996
Copy link
Contributor

Summary

Empty dividers are shown with no enclosed labels when the archived labels are hidden from list

Before fix

The dividers will show on the list even if the enclosed labels are hidden

with_bug

After the fix

The divider has been conditionally hidden when the label is not shown in the list

  • With archived labels hidden
fixed_view
  • With archived labels shown
showing archived

Fixed #27466

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 17, 2023
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Oct 17, 2023
@delvh delvh added the backport/v1.21 This PR should be backported to Gitea 1.21 label Oct 17, 2023
@@ -38,7 +38,9 @@
{{range .Labels}}
{{$exclusiveScope := .ExclusiveScope}}
{{if and (ne $previousExclusiveScope $exclusiveScope)}}
<div class="divider"></div>
{{if or (not .IsArchived) (and .IsArchived $.ShowArchivedLabels)}}
Copy link
Member

Choose a reason for hiding this comment

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

This is only a partial fix as it will be buggy when you have a scope with an archived label and an active label, and the checkbox is not selected.
In that case, the divider will be missing even though it shouldn't.

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 17, 2023
@puni9869
Copy link
Member

puni9869 commented Oct 17, 2023

quickest solution As of now lets remove all the divider tags.

I am working on something similar,
Keeping all the checked or ticked label on to top in the label drop down list.

My fix will take lil more time, mean while we can fix it via this

@neel1996

@delvh
Copy link
Member

delvh commented Oct 18, 2023

lets remove all the divider tags.

Erm… This sounds even worse?

@puni9869
Copy link
Member

puni9869 commented Oct 23, 2023

lets remove all the divider tags.

Erm… This sounds even worse?

Quickfix
regression #27747

@neel1996 I have fix this problem in the above Pr, If you get time you can review.

@wxiaoguang
Copy link
Contributor

It should have been fixed in 1.23?

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Dec 8, 2024
@wxiaoguang
Copy link
Contributor

Not fixed, and it is not an easy problem.

The problem is that tw-hidden doesn't work with the dropdown divider. It can't be fixed by template patches.

Frontend dropdown needs to "filter" the list. So it also needs to handle such case:

item1
divider
item2 (not matched the input and will be hidden by frontend)
divider (this will also be hidden)
item3

Actually the dropdown could already handles such case, but it is unable to mix these 2 different usages if item2 is hidden by other methods but not by the filter.

@wxiaoguang
Copy link
Contributor

It could be fixed like this: Fix duplicate dropdown dividers #32760

@wxiaoguang wxiaoguang closed this Dec 8, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Mar 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/v1.21 This PR should be backported to Gitea 1.21 issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged modifies/templates This PR modifies the template files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Archived label visual bug in labels select
5 participants