From 18e71bbda1e4e8418a590a3a9490ccdaec7deba0 Mon Sep 17 00:00:00 2001 From: Rito Rhymes Date: Mon, 16 Feb 2026 15:53:27 +0000 Subject: [PATCH 1/5] gitweb: add viewport meta tag for mobile devices Without a viewport meta tag, phone browsers render gitweb at desktop width and scale the whole page down to fit the screen. Add a viewport meta tag so the layout viewport tracks device width. This is the baseline needed for mobile CSS fixes in follow-up commits. Signed-off-by: Rito Rhymes Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 1 + 1 file changed, 1 insertion(+) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index b5490dfecf..fde804593b 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -4214,6 +4214,7 @@ sub git_header_html { + $title EOF # the stylesheet, favicon etc urls won't work correctly with path_info From 5be380d865972652a2cfd3f1f8d090c87489d904 Mon Sep 17 00:00:00 2001 From: Rito Rhymes Date: Mon, 16 Feb 2026 15:53:28 +0000 Subject: [PATCH 2/5] gitweb: prevent project search bar from overflowing on mobile On narrow screens, the project search input can exceed the available width and force page-wide horizontal scrolling. Add a mobile media query and apply side padding to the search container, then cap the input width to its container with border-box sizing so the form stays within the viewport. Signed-off-by: Rito Rhymes Signed-off-by: Junio C Hamano --- gitweb/static/gitweb.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 48d2e51015..0b63acc0e2 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -684,3 +684,15 @@ div.remote { .kwb { color:#830000; } .kwc { color:#000000; font-weight:bold; } .kwd { color:#010181; } + +@media (max-width: 768px) { + div.projsearch { + padding: 0 8px; + box-sizing: border-box; + } + + div.projsearch input[type="text"] { + max-width: 100%; + box-sizing: border-box; + } +} From fd10720357f01baa8a07ff6fa8e22de198424fd3 Mon Sep 17 00:00:00 2001 From: Rito Rhymes Date: Mon, 16 Feb 2026 15:53:29 +0000 Subject: [PATCH 3/5] gitweb: fix mobile page overflow across log/commit/blob/diff views On mobile-sized viewports, gitweb pages in log/commit/blob/diff views can overflow horizontally due to desktop-oriented paddings and fixed-width preformatted content. Extend the existing mobile media query to rebalance those layouts: reduce or clear paddings in log/commit sections, and allow horizontal scrolling for preformatted blob/diff content instead of forcing page-wide overflow. All layout adjustments in this patch are mobile-scoped, except one global safeguard: set overflow-wrap:anywhere on div.log_body. Log content can contain escaped or non-breaking text that behaves like a single long token and can overflow at any viewport width, including desktop. Signed-off-by: Rito Rhymes Signed-off-by: Junio C Hamano --- gitweb/static/gitweb.css | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 0b63acc0e2..135590b64c 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -123,6 +123,7 @@ div.title_text { div.log_body { padding: 8px 8px 8px 150px; + overflow-wrap: anywhere; } span.age { @@ -686,6 +687,15 @@ div.remote { .kwd { color:#010181; } @media (max-width: 768px) { + div.page_body { + overflow-x: auto; + -webkit-overflow-scrolling: touch; + } + + div.page_body div.pre { + min-width: max-content; + } + div.projsearch { padding: 0 8px; box-sizing: border-box; @@ -695,4 +705,46 @@ div.remote { max-width: 100%; box-sizing: border-box; } + + div.title_text { + overflow-x: auto; + -webkit-overflow-scrolling: touch; + padding-left: 4px; + padding-right: 4px; + box-sizing: border-box; + } + + div.title_text table.object_header { + width: max-content; + } + + div.log_body { + padding: 8px; + clear: left; + } + + div.patchset div.patch { + width: max-content; + min-width: 100%; + } + + div.diff.header { + padding: 4px 8px 2px 8px; + white-space: nowrap; + overflow-wrap: normal; + } + + div.diff.extended_header { + padding: 2px 8px; + white-space: nowrap; + overflow-wrap: normal; + } + + div.diff.ctx, + div.diff.add, + div.diff.rem, + div.diff.chunk_header { + padding: 0 8px; + white-space: pre; + } } From 34108d7fa3b91ca52f9f99f646c0f1ba4111d357 Mon Sep 17 00:00:00 2001 From: Rito Rhymes Date: Mon, 16 Feb 2026 15:53:30 +0000 Subject: [PATCH 4/5] gitweb: fix mobile footer overflow by wrapping text and clearing floats On narrow screens, footer text can wrap, but the fixed 22px footer height and floated footer blocks can cause overflow. Switch to min-height and add a clearfix on the footer container so it grows to contain wrapped float content cleanly. Signed-off-by: Rito Rhymes Signed-off-by: Junio C Hamano --- gitweb/static/gitweb.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 135590b64c..8247646063 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -73,11 +73,17 @@ div.page_path { } div.page_footer { - height: 22px; + min-height: 22px; padding: 4px 8px; background-color: #d9d8d1; } +div.page_footer::after { + content: ""; + display: table; + clear: both; +} + div.page_footer_text { line-height: 22px; float: left; From f4e63fd83e5b33f0113cb7e2231d013c515f0a8b Mon Sep 17 00:00:00 2001 From: Rito Rhymes Date: Mon, 16 Feb 2026 15:53:31 +0000 Subject: [PATCH 5/5] gitweb: let page header grow on mobile for long wrapped project names On mobile, long project names in the page header can wrap to multiple lines, but the fixed 25px header height does not grow with wrapped content. Switch the header from fixed height to min-height so it expands as needed while keeping the same baseline height for single-line titles. Signed-off-by: Rito Rhymes Signed-off-by: Junio C Hamano --- gitweb/static/gitweb.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 8247646063..e2e6dd96a2 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -42,7 +42,7 @@ a.list img.avatar { } div.page_header { - height: 25px; + min-height: 25px; padding: 8px; font-size: 150%; font-weight: bold;