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

Align sidebar gears to the right #33721

Merged

Conversation

quentinguidee
Copy link
Contributor

Currently, the issue/pr sidebar is hard to read visually. One of the reason is that the gear icons make reading difficult because they are "in the way" when reading, and not aligned together.

This PR proposes to align them on the right.

Actions are also better highlighted this way.

Screenshots

Issue

Before this PR After this PR
Capture d’écran 2025-02-25 à 19 59 39 Capture d’écran 2025-02-25 à 19 58 56

Pull Request

Before this PR After this PR
Capture d’écran 2025-02-25 à 20 16 12  Capture d’écran 2025-02-25 à 20 15 54

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 25, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 25, 2025
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Feb 25, 2025
@lunny lunny added this to the 1.24.0 milestone Feb 25, 2025
@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Feb 25, 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 Feb 25, 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 Feb 25, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 25, 2025
Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

If it is a general/common layout, it needs a well-defined style, but not copying a lot of duplicate helper classes.

.ui.dropdown.text-flex-grow {
}
.ui.dropdown.text-flex-grow .text {
}

<div class="ui dropdown text-flex-grow">
</div>

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Feb 26, 2025
@lunny lunny removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 26, 2025
@quentinguidee quentinguidee force-pushed the feat/move-sidebar-gear-to-the-right branch from 0fd3d86 to 8e660ac Compare February 26, 2025 08:15
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 26, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Feb 26, 2025
@silverwind
Copy link
Member

silverwind commented Feb 26, 2025

If it is a general/common layout, it needs a well-defined style, but not copying a lot of duplicate helper classes.

.ui.dropdown.text-flex-grow {
}
.ui.dropdown.text-flex-grow .text {
}

<div class="ui dropdown text-flex-grow">
</div>

Hmm, I think I would have preferred justify-content: space-between and two distinct <div> children over another "helper" class.

@wxiaoguang
Copy link
Contributor


Hmm, I think I would have preferred justify-content: space-between and two distinct <div> children over another "helper" class.

Do you mean this 3c0ed69 ? A lot of tw-flex tw-flex-grow tw-justify-between ? Or some better solution?

@wxiaoguang
Copy link
Contributor

GitHub doesn't use the unnecessary inline helpers either.

image

@silverwind
Copy link
Member

silverwind commented Feb 26, 2025

I meant

<a class="text muted tw-flex tw-justify-between">
  <strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>

This will work as long as there exactly 2 child elements, which luckily is the case here.

Another option may be auto margin {{svg "octicon-gear" 16 "tw-ml-auto"}}, but it requires the parent to fill the space.

@silverwind
Copy link
Member

GitHub doesn't use the unnecessary inline helpers either.

Ugh, float, no thanks.

@wxiaoguang
Copy link
Contributor

I meant

<a class="text muted tw-flex tw-justify-between">
  <strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>

This will work as long as there exactly 2 child elements, which luckily is the case here.

Another option may be auto margin {{svg "octicon-gear" 16 "tw-ml-auto"}}, but it requires the parent to fill the space.

No, it doesn't work. You can try to check out the PR and try by yourself.

@quentinguidee
Copy link
Contributor Author

I can confirm this was my first idea too, unfortunately without success

@silverwind
Copy link
Member

Yeah it would need tw-w-100 on .ui.dropdown and tw-flex tw-justify-between tw-flex-1 on the a, but I guess that is arguably more effort than this approach.

@wxiaoguang
Copy link
Contributor

Yeah it would need tw-w-100 on .ui.dropdown and tw-flex tw-justify-between tw-flex-1 on the a, but I guess that is arguably more effort than this approach.

Then it becomes more ugly, right? Dozens of tw-xxx helpers repeat again and again.

Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

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

Yeah this is more elegant.

@lafriks lafriks merged commit 793c0e1 into go-gitea:main Feb 26, 2025
26 checks passed
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 3, 2025
* giteaofficial/main:
  Use pullrequestlist instead of []*pullrequest (go-gitea#33765)
  Upgrade act to 0.261.4 and actions-proto-go to v0.4.1 (go-gitea#33760)
  Webhook add X-Gitea-Hook-Installation-Target-Type Header (go-gitea#33752)
  Fix dynamic content loading init problem (go-gitea#33748)
  [skip ci] Updated translations via Crowdin
  Add composor source field (go-gitea#33502)
  upgrade go-crypto from 1.1.5 to 1.1.6 (go-gitea#33745)
  Disable go license generation as part of `make tidy` (go-gitea#33747)
  Refactor repo-diff.ts (go-gitea#33746)
  Use `git diff-tree` for `DiffFileTree` on diff pages (go-gitea#33514)
  [skip ci] Updated translations via Crowdin
  Improve "generate new access token" form (go-gitea#33730)
  Remove superflous tw-content-center (go-gitea#33741)
  Clone repository with Tea CLI (go-gitea#33725)
  allow filtering /repos/{owner}/{repo}/pulls by target base branch queryparam (go-gitea#33684)
  Show info about maintainers are allowed to edit a PR (go-gitea#33738)
  Improve admin user view page (go-gitea#33735)
  [skip ci] Updated translations via Crowdin
  Align sidebar gears to the right (go-gitea#33721)
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/templates This PR modifies the template files size/S Denotes a PR that changes 10-29 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants