From 9c08df8bc8001fc7cb59633fefc46c43e1c34122 Mon Sep 17 00:00:00 2001 From: Shudhanshu Singh Date: Tue, 14 Jul 2026 23:24:55 +0530 Subject: [PATCH] fix(org): align follow button and wrap description (#38448) ### Description Fixes the organization page header layout issue where: 1. Long organization descriptions did not wrap and instead stretched the header container out of bounds. 2. The "Follow" button floated dynamically adjacent to the description's right edge depending on the description length, instead of remaining at a fixed position aligned with the right edge of the page container. Fixes https://github.com/go-gitea/gitea/issues/38445 ### Cause The flex container `
` lacked `tw-flex-1` (to grow to fill the container) and `tw-min-w-0` (to allow it to shrink below its content's size). Consequently, the flex minimum width defaulted to `min-content`, stretching the container for long unwrapped descriptions. ### Solution Added `tw-flex-1 tw-min-w-0` to the `
` container in `templates/org/header.tmpl`. This restricts the width, enables proper text wrapping, and fixes the "Follow" button to the right edge of the content container. ### Screenshots Before image After image --------- Co-authored-by: wxiaoguang --- templates/devtest/flex-list.tmpl | 16 +++++++++++++--- templates/org/header.tmpl | 4 ++-- web_src/css/shared/flex-list.css | 2 ++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/templates/devtest/flex-list.tmpl b/templates/devtest/flex-list.tmpl index 26df0920c5d..2551941f7ff 100644 --- a/templates/devtest/flex-list.tmpl +++ b/templates/devtest/flex-list.tmpl @@ -1,7 +1,17 @@ {{template "devtest/devtest-header"}}
-

Flex List (standalone)

+

Flex Relaxed List

+
+
+
+ left looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong + right +
+
+
+ +

Flex Divided List (standalone)

@@ -87,7 +97,7 @@
-

Flex List (with "ui segment")

+

Flex Divided List (with "ui segment")

item 1
@@ -101,7 +111,7 @@
item 2
-

Flex List (with "ui segment fitted", items have their own padding)

+

Flex Divided List (with "ui segment fitted", items have their own padding)

item 1
diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl index 4f9e54b6109..58300edc5b6 100644 --- a/templates/org/header.tmpl +++ b/templates/org/header.tmpl @@ -1,6 +1,6 @@ -
+
{{ctx.AvatarUtils.Avatar .Org 100}}
-
+
{{.Org.DisplayName}} diff --git a/web_src/css/shared/flex-list.css b/web_src/css/shared/flex-list.css index 99515c13428..cb6c69957af 100644 --- a/web_src/css/shared/flex-list.css +++ b/web_src/css/shared/flex-list.css @@ -3,6 +3,8 @@ display: flex; flex-direction: column; gap: var(--gap-block); + min-width: 0; /* keep the same style as "flex-text-block" etc, make the text content wrap/ellipse correctly */ + max-width: 100%; } .flex-relaxed-list > .divider {