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

Optimize profile layout to enhance visual experience #31278

Merged
merged 11 commits into from
Jun 12, 2024
12 changes: 2 additions & 10 deletions templates/shared/user/profile_big_avatar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,8 @@
<li>
{{svg "octicon-mail"}}
<a class="tw-flex-1" href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
<a href="{{AppSubUrl}}/user/settings#privacy-user-settings">
{{if .ShowUserEmail}}
<i data-tooltip-content="{{ctx.Locale.Tr "user.email_visibility.limited"}}">
{{svg "octicon-unlock"}}
</i>
{{else}}
<i data-tooltip-content="{{ctx.Locale.Tr "user.email_visibility.private"}}">
{{svg "octicon-lock"}}
</i>
{{end}}
<a class="flex-text-inline" href="{{AppSubUrl}}/user/settings#privacy-user-settings" data-tooltip-content="{{ctx.Locale.Tr (Iif .ShowUserEmail "user.email_visibility.limited" "user.email_visibility.private")}}">
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, it looks like an abuse.

The flex and align items should be on the parent element <li> to align the svg mail / mailto / svg private.

No idea why it is only on the svg private .....

Copy link
Member Author

Choose a reason for hiding this comment

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

image
As in the screenshot, the li element has already been styled appropriately. The current Pull Request resolves the issue where the svg element inside the a element is not centered.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I agree flex-text-inline is likely not ideal, but it's aiming at this specific alignment problem that for some reason only shows on Windows, it does not reproduce on any MacOS browser for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the root problem is the "spaces" between elements, which make the height different.

I guess using {{- svg ... -}} would make the height correct and no need to use "flex" on "a". Just a guess and using "flex" is still acceptable.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, likely it is whitespace-related because the display: flex removes the whitespace rendering.

{{svg (Iif .ShowUserEmail "octicon-unlock" "octicon-lock")}}
</a>
</li>
{{else}}
Expand Down