Skip to content

Commit b903e2b

Browse files
GiteaBotsilverwind
andauthored
Prevent tab shifting, remove extra margin on fluid pages (#31090) (#31099)
Backport #31090 by @silverwind 1. Extend concept of #29831 to all tabular menus, there were only three left that weren't already `<overflow-menu>`. <img width="634" alt="Screenshot 2024-05-27 at 00 42 16" src="https://github.com/go-gitea/gitea/assets/115237/d9a7e219-d05e-40a1-9e93-777f9a8a90dd"> <img width="965" alt="Screenshot 2024-05-27 at 00 29 32" src="https://github.com/go-gitea/gitea/assets/115237/e6ed71b1-11fb-4a74-9adb-af4524286cff"> 2. Remove extra padding on `fluid padded` container like for example PR diff view. The page margin is already correctly sized via `.ui.container`, so this was just extraneous padding that looked ugly. Before: <img width="1351" alt="Screenshot 2024-05-27 at 00 45 11" src="https://github.com/go-gitea/gitea/assets/115237/4b45fd11-b1b2-4fbb-a618-26eb22be9472"> After: <img width="1344" alt="Screenshot 2024-05-27 at 00 45 22" src="https://github.com/go-gitea/gitea/assets/115237/d09593eb-6c7f-45e7-85b6-f0050047004b"> 3. Replace `gt-word-break` with `tw-break-anywhere` in issue-title, fixing overflow. Before: <img width="1333" alt="Screenshot 2024-05-27 at 00 50 14" src="https://github.com/go-gitea/gitea/assets/115237/64d15d04-b456-401e-a972-df636965f0eb"> After: <img width="1316" alt="Screenshot 2024-05-27 at 00 50 26" src="https://github.com/go-gitea/gitea/assets/115237/ed1ce830-1408-414b-8263-eeaf773f52c8"> Co-authored-by: silverwind <me@silverwind.io>
1 parent 0e70f73 commit b903e2b

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

templates/repo/issue/view_title.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="issue-title-header">
77
{{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
88
<div class="issue-title" id="issue-title-display">
9-
<h1 class="gt-word-break">
9+
<h1 class="tw-break-anywhere">
1010
{{RenderIssueTitle $.Context .Issue.Title ($.Repository.ComposeMetas ctx) | RenderCodeBlock}}
1111
<span class="index">#{{.Issue.Index}}</span>
1212
</h1>

templates/repo/pulls/tab_menu.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<div class="ui top attached pull tabular menu">
33
<a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.Issue.Link}}">
44
{{svg "octicon-comment-discussion"}}
5-
{{ctx.Locale.Tr "repo.pulls.tab_conversation"}}
5+
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.pulls.tab_conversation")}}
66
<span class="ui small label">{{.Issue.NumComments}}</span>
77
</a>
88
<a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}>
99
{{svg "octicon-git-commit"}}
10-
{{ctx.Locale.Tr "repo.pulls.tab_commits"}}
10+
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.pulls.tab_commits")}}
1111
<span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}-{{end}}</span>
1212
</a>
1313
<a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.Issue.Link}}/files">
1414
{{svg "octicon-diff"}}
15-
{{ctx.Locale.Tr "repo.pulls.tab_files"}}
15+
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.pulls.tab_files")}}
1616
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
1717
</a>
1818
{{if or .Diff.TotalAddition .Diff.TotalDeletion}}

templates/repo/settings/webhook/history.tmpl

+6-4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434
</div>
3535
<div class="info tw-hidden" id="info-{{.ID}}">
3636
<div class="ui top attached tabular menu">
37-
<a class="item active" data-tab="request-{{.ID}}">{{ctx.Locale.Tr "repo.settings.webhook.request"}}</a>
37+
<a class="item active" data-tab="request-{{.ID}}">
38+
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.settings.webhook.request")}}
39+
</a>
3840
<a class="item" data-tab="response-{{.ID}}">
39-
{{ctx.Locale.Tr "repo.settings.webhook.response"}}
41+
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.settings.webhook.response")}}
4042
{{if .ResponseInfo}}
4143
{{if .IsSucceed}}
4244
<span class="ui green label">{{.ResponseInfo.Status}}</span>
@@ -49,10 +51,10 @@
4951
</a>
5052
{{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin $.PageIsUserSettings}}
5153
<div class="right menu">
52-
<form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post">
54+
<form class="tw-py-2" action="{{$.Link}}/replay/{{.UUID}}" method="post">
5355
{{$.CsrfTokenHtml}}
5456
<span data-tooltip-content="{{if $.Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}">
55-
<button class="ui tiny button{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button>
57+
<button class="ui tiny button tw-mr-0{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button>
5658
</span>
5759
</form>
5860
</div>

templates/shared/combomarkdowneditor.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Template Attributes:
1414
<div {{if .ContainerId}}id="{{.ContainerId}}"{{end}} class="combo-markdown-editor {{.ContainerClasses}}" data-dropzone-parent-container="{{.DropzoneParentContainer}}">
1515
{{if .MarkdownPreviewUrl}}
1616
<div class="ui top tabular menu">
17-
<a class="active item" data-tab-for="markdown-writer">{{ctx.Locale.Tr "write"}}</a>
18-
<a class="item" data-tab-for="markdown-previewer" data-preview-url="{{.MarkdownPreviewUrl}}" data-preview-context="{{.MarkdownPreviewContext}}">{{ctx.Locale.Tr "preview"}}</a>
17+
<a class="active item" data-tab-for="markdown-writer">{{template "shared/misc/tabtitle" (ctx.Locale.Tr "write")}}</a>
18+
<a class="item" data-tab-for="markdown-previewer" data-preview-url="{{.MarkdownPreviewUrl}}" data-preview-context="{{.MarkdownPreviewContext}}">{{template "shared/misc/tabtitle" (ctx.Locale.Tr "preview")}}</a>
1919
</div>
2020
{{end}}
2121
<div class="ui tab active" data-tab-panel="markdown-writer">

templates/shared/misc/tabtitle.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span class="resize-for-semibold" data-text="{{.}}">{{.}}</span>

web_src/css/modules/container.css

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
width: 100%;
1313
}
1414

15-
.ui.container.fluid.padded {
16-
padding: 0 var(--page-margin-x);
17-
}
18-
1915
.ui[class*="center aligned"].container {
2016
text-align: center;
2117
}

0 commit comments

Comments
 (0)