Skip to content

Improve labels-list rendering #34846

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

Merged
merged 36 commits into from
Jun 27, 2025
Merged

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Jun 24, 2025

The issue sidebar was using a different gap between labels then other places in the UI. Remove the tailwind class to make this rule take effect:

.labels-list {
  gap: 2.5px;
}

Before:
Screenshot 2025-06-24 at 19 51 05

After:
Screenshot 2025-06-24 at 19 50 54

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 24, 2025
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Jun 24, 2025
@silverwind silverwind added the backport/v1.24 This PR should be backported to Gitea 1.24 label Jun 24, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 24, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 24, 2025
@wxiaoguang
Copy link
Contributor

The larger gap seems more conformable

Should we enlarge the gap in .labels-list?

@silverwind
Copy link
Member Author

Could go to 3px, maybe 4px. GitHub uses 4px.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 25, 2025

Could go to 3px, maybe 4px. GitHub uses 4px.

Or just 0.25em like other inline gaps.

(0.25em seems to be 4px)

@silverwind
Copy link
Member Author

.25rem is consistent because our root unit is 14px.

Did a number of enhancements. Now using margin instead of gap. By using display: contents the list can now wrap in all 3 cases:

Screenshot 2025-06-25 at 07 37 51 Screenshot 2025-06-25 at 07 38 19 Screenshot 2025-06-25 at 07 37 59

@silverwind
Copy link
Member Author

silverwind commented Jun 25, 2025

Found one more bug while testing, I will fix.

image

@wxiaoguang wxiaoguang marked this pull request as draft June 25, 2025 05:59
@silverwind
Copy link
Member Author

silverwind commented Jun 25, 2025

Almost perfect now, one issue remains here, the avatars should not render like that one the second line of the list. Maybe it needs a wrapper element because of display:contents making it behave inline:

image

@silverwind silverwind changed the title Unify gap in issue sidebar labels-list Rework labels-list Jun 25, 2025
@silverwind
Copy link
Member Author

silverwind commented Jun 25, 2025

I guess I may change it to only set display: contents where needed, e.g. in the issue list title and issue history. Will take a break from this, more work later.

@wxiaoguang

This comment was marked as outdated.

@wxiaoguang wxiaoguang marked this pull request as ready for review June 25, 2025 09:02
@silverwind
Copy link
Member Author

I'm not satisfied yet, hold on with merging.

@silverwind silverwind marked this pull request as draft June 25, 2025 09:03
@wxiaoguang wxiaoguang marked this pull request as ready for review June 26, 2025 09:02
@wxiaoguang
Copy link
Contributor

Let's merge?

@silverwind silverwind marked this pull request as draft June 26, 2025 09:25
@silverwind
Copy link
Member Author

Not yet, will do one hopefully final round of review.

@silverwind
Copy link
Member Author

silverwind commented Jun 26, 2025

btw I see a cut-off "g" in your screenshot above. Is it still an issue?

image

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 26, 2025

btw I see a cut-off "g" in your screenshot above. Is it still an issue?

That's an old screenshot. New commits should have fixed the "line-height: 1" problem. See the latest screenshot

image

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 26, 2025

Not yet, will do one hopefully final round of review.

Then 4adf1e3, more changes, more complicated, and no unnecessary "a" wrapper now.

If it doesn't look good, feel free to revert

@silverwind
Copy link
Member Author

silverwind commented Jun 26, 2025

Not yet, will do one hopefully final round of review.

Then 4adf1e3, more changes, more complicated, and no unnecessary "a" wrapper now.

If it doesn't look good, feel free to revert

This change isn't complete, it only affects the labels in the issue history, not the ones in sidebar or issue list. I think we should make all places use the same rendering code or sub-template.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 26, 2025

This change isn't complete, it only affects the labels in the issue history, not the ones in sidebar or issue list. I think we should make all places use the same rendering code or sub-template.

Yes, I know. I intentionally didn't touch unrelated code, the commit only added basic "label with link" support, but didn't rewrite everything (otherwise there will be far more changes). Other changes can be left to the future.

If you don't like, just revert. I can accept either:

  • Keep the current basic "label with link" support, don't introduce more changes
  • Keep old a + label layout, revert/reset new commits

But not introduce more changes in this PR

@silverwind
Copy link
Member Author

There is a EXTRA error on the /issues page:

image

@silverwind
Copy link
Member Author

Yeah lets fix the remaining issues and then merge this. Fully .a.ui.label change can come later for all I care.

@silverwind
Copy link
Member Author

silverwind commented Jun 26, 2025

It does look rather broken here, I assume this is because of the EXTRA errors:

image

@silverwind
Copy link
Member Author

@wxiaoguang care to fix these EXTRAs?

@wxiaoguang
Copy link
Contributor

@wxiaoguang care to fix these EXTRAs?

Already fixed in eb2a642 , and added some more tests in 43e7745

@wxiaoguang wxiaoguang marked this pull request as ready for review June 27, 2025 10:01
@wxiaoguang wxiaoguang merged commit 1e50cec into go-gitea:main Jun 27, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.25.0 milestone Jun 27, 2025
@wxiaoguang wxiaoguang deleted the labels-list-gap branch June 27, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants