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/optimize span svg layout #34185

Merged
merged 2 commits into from
Apr 13, 2025

Conversation

kerwin612
Copy link
Member

before:
image

after:
image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 12, 2025
@silverwind
Copy link
Member

silverwind commented Apr 12, 2025

I agree, this seems to be too prone to false-positives.

I still think the best course of actions is to make Vue not output the wrapper in first place:

https://stackoverflow.com/a/69354385/808699

@wxiaoguang
Copy link
Contributor

I still think the best course of actions is to make Vue not output the wrapper in first place:

The screenshots are not from Vue ......

@kerwin612
Copy link
Member Author

I still think the best course of actions is to make Vue not output the wrapper in first place:

The screenshots are not from Vue ......

yes, screenshots from

<span aria-label="{{ctx.Locale.Tr "repo.forks"}}">{{svg "octicon-git-branch" 16}}</span>

There is a lot of legacy code in the system, such as <some-container><span><svg/></span>text</some-container> or <some-container><span><svg/>text</span></some-container>. In the default scenario, the SVG and the subsequent text are vertically arranged.

The goal of this PR is to make the SVG and the subsequent text vertically centered in all such scenarios across the entire system.

@wxiaoguang
Copy link
Contributor

The goal of this PR is to make the SVG and the subsequent text vertically centered in all such scenarios across the entire system.

See #34185 (comment), it won't work in all scenarios, instead, it introduces more different cases.

The root problem is that you can't assume the parent has "flex" layout.

@wxiaoguang wxiaoguang marked this pull request as draft April 12, 2025 12:18
@kerwin612 kerwin612 force-pushed the feat/optimize-span-svg-layout branch from 946fb78 to 2beacc5 Compare April 12, 2025 13:51
@github-actions github-actions bot added modifies/templates This PR modifies the template files and removed modifies/frontend labels Apr 12, 2025
@kerwin612
Copy link
Member Author

I did a global search, and it turns out the situation is much more complicated than I thought. I believe there might not be a universal solution. It seems that we really have no other choice but to address each issue as it arises.

@kerwin612 kerwin612 marked this pull request as ready for review April 13, 2025 00:11
@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 Apr 13, 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 Apr 13, 2025
@lunny lunny added topic/ui Change the appearance of the Gitea UI reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Apr 13, 2025
@wxiaoguang wxiaoguang merged commit d0688cb into go-gitea:main Apr 13, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.25.0 milestone Apr 13, 2025
@wxiaoguang wxiaoguang deleted the feat/optimize-span-svg-layout branch April 13, 2025 04:45
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 13, 2025
@lunny lunny modified the milestones: 1.25.0, 1.24.0 Apr 13, 2025
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/templates This PR modifies the template files topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants