From 953c468b32465985937b787b3319d0890495c119 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Tue, 20 Jan 2026 19:23:31 +0100 Subject: [PATCH] fix(ui): improve force-push layout alignment (#10939) Followup to https://codeberg.org/forgejo/forgejo/pulls/7746 Replaces https://codeberg.org/forgejo/forgejo/pulls/10938 grid layout (desktop): give the Compare button a wrapper with same height as the first text line so it stays aligned to it (and to timeline badge) inline layout (mobile): give the Compare button left margin so there's a gap between it and the text line Initial fix for grid was proposed by luisadame. Co-authored-by: Luis Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10939 Reviewed-by: Beowulf Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org> --- templates/repo/issue/view_content/comments.tmpl | 4 +++- web_src/css/repo.css | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index c3cc94dfb3..bde6a0b5b2 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -580,7 +580,9 @@ }} {{if $.Issue.PullRequest.BaseRepo.Name}} - {{ctx.Locale.Tr "repo.issues.force_push_compare"}} + + {{ctx.Locale.Tr "repo.issues.force_push_compare"}} + {{end}} {{else}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 48705180b2..2ead2b4797 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -887,6 +887,16 @@ citation-information .tab:not(.active) { display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; + span.compare { + /* Same height as .timeline-item .badge for alignment */ + height: 34px; + } + } +} + +@media (max-width: 767.98px) { + .repository.view.issue .comment-list .timeline-item .forced-push span.compare { + margin-inline-start: 1rem; } }