loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve branch list UI (#27319)

1. Put the `"octicon-shield-lock"` into the flex container, then it
doesn't need a separate flex box
2. Remove some unnecessary `gt-df` helpers
3. Make `btn` button has the same flex behavior as `ui button`


![image](https://github.com/go-gitea/gitea/assets/2114189/60ce75f7-7fac-4157-9c42-91c7dee9300e)



![image](https://github.com/go-gitea/gitea/assets/2114189/ea606baf-6f52-41e1-b964-c4840d3b1529)

authored by

wxiaoguang and committed by
GitHub
7ea2a910 15fa0383

+11 -16
+9 -13
templates/repo/branch/list.tmpl
··· 19 19 <tbody> 20 20 <tr> 21 21 <td> 22 - <div class="gt-df gt-ac"> 23 - {{if .DefaultBranchBranch.IsProtected}} 24 - <span class="gt-df gt-pr-2">{{svg "octicon-shield-lock"}}</span> 25 - {{end}} 22 + <div class="flex-text-block"> 23 + {{if .DefaultBranchBranch.IsProtected}}{{svg "octicon-shield-lock"}}{{end}} 26 24 <a class="gt-ellipsis" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a> 27 - <button class="btn interact-fg gt-df gt-p-3" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 25 + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 28 26 {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} 29 27 </div> 30 28 <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p> ··· 91 89 <tr> 92 90 <td class="eight wide"> 93 91 {{if .DBBranch.IsDeleted}} 94 - <div class="gt-df gt-ac"> 92 + <div class="flex-text-block"> 95 93 <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> 96 - <button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 94 + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 97 95 </div> 98 96 <p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}</p> 99 97 {{else}} 100 - <div class="gt-df gt-ac"> 101 - {{if .IsProtected}} 102 - <span class="gt-df gt-pr-2">{{svg "octicon-shield-lock"}}</span> 103 - {{end}} 98 + <div class="flex-text-block"> 99 + {{if .IsProtected}}{{svg "octicon-shield-lock"}}{{end}} 104 100 <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> 105 - <button class="btn interact-fg gt-df gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 101 + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 106 102 {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} 107 103 </div> 108 - <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> 104 + <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> 109 105 {{end}} 110 106 </td> 111 107 <td class="two wide ui">
-2
templates/repo/commit_status.tmpl
··· 1 1 <!-- make sure this matches the color logic in web_src/js/components/DashboardRepoList.vue --> 2 - <span class="gt-df"> 3 2 {{if eq .State "pending"}} 4 3 {{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}} 5 4 {{end}} ··· 12 11 {{if eq .State "failure"}} 13 12 {{svg "octicon-x" 18 "commit-status icon text red"}} 14 13 {{end}} 15 - </span>
+1
web_src/css/base.css
··· 2242 2242 right: 2em; 2243 2243 } 2244 2244 2245 + .btn, 2245 2246 .ui.ui.button, 2246 2247 .ui.ui.dropdown, 2247 2248 .ui.ui.label,
+1 -1
web_src/css/modules/button.css
··· 30 30 color: var(--color-red); 31 31 } 32 32 33 - /* btn is a plain button without any opinionated styling */ 33 + /* btn is a plain button without any opinionated styling, it only uses flex for vertical alignment like ".ui.button" in base.css */ 34 34 35 35 .btn { 36 36 background: transparent;