From b4519526403f0df6949673296f327af605cce975 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 17 May 2026 09:07:07 +0300 Subject: [PATCH] tree: rearrange repo header layout Move star/watch buttons into the top-right of the title bar, place the settings link directly after the Public/Private tag, and group Code and + on the right of the branch row so they align with the language bar edge. Swap + before Code and shrink the branch select max-width from 200px to 150px. --- static/css/tree.scss | 30 ++++++++++- templates/layout/repo_menu.html | 11 ++-- templates/tree.html | 90 ++++++++++++++++++--------------- 3 files changed, 82 insertions(+), 49 deletions(-) diff --git a/static/css/tree.scss b/static/css/tree.scss index c3922cf..822807a 100644 --- a/static/css/tree.scss +++ b/static/css/tree.scss @@ -22,7 +22,17 @@ .repo-settings-link { font-size: 14px; line-height: 1; - margin-left: auto; +} + +.repo-header-area { + position: relative; + + .repo-actions { + position: absolute; + top: 11px; + right: 0; + z-index: 5; + } } /* 1. The repo stats panel */ @@ -85,11 +95,23 @@ a.repo-stat-item:hover { gap: 10px; } +.repo-wrapper--with-sidebar { + padding-right: 184px; +} + .branch-specific-container { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; + width: 100%; +} + +.branch-right-actions { + display: flex; + align-items: center; + gap: 10px; + margin-left: auto; } .add-file-btn { @@ -126,7 +148,7 @@ a.repo-stat-item:hover { font-size: 14px; font-weight: 500; line-height: 20px; - max-width: 200px; + max-width: 150px; padding: 5px 35px 5px 12px; text-overflow: ellipsis; white-space: nowrap; @@ -504,6 +526,10 @@ a.repo-mode-link:hover { .repo-layout { grid-template-columns: minmax(0, 1fr); } + + .repo-wrapper--with-sidebar { + padding-right: 0; + } } /* Common style for Star/Watch buttons */ diff --git a/templates/layout/repo_menu.html b/templates/layout/repo_menu.html index 981dd37..a85ea22 100644 --- a/templates/layout/repo_menu.html +++ b/templates/layout/repo_menu.html @@ -18,12 +18,11 @@ @else Private @end - @end - - @if repo.user_id == ctx.user.id - - Settings - + @if repo.user_id == ctx.user.id + + Settings + + @end @end diff --git a/templates/tree.html b/templates/tree.html index d6425b8..e9c2ecb 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -19,47 +19,8 @@
- @include 'layout/repo_menu.html' - -
- - - - - - @repo.format_nr_branches(ctx.lang) - - -
- @if is_top_files_mode - Tree - Top files - @else - Tree - Top files - @end -
- -
-
Code
- -
- Clone with HTTPS: -
- - -
-
-
- - @if repo.user_id == ctx.user.id - + - @end -
+
+ @include 'layout/repo_menu.html' @if is_top_directory
@@ -90,6 +51,53 @@ @end
+ @if is_top_directory +
+ @else +
+ @end + + + + + + @repo.format_nr_branches(ctx.lang) + + +
+ @if is_top_files_mode + Tree + Top files + @else + Tree + Top files + @end +
+ +
+ @if repo.user_id == ctx.user.id + + + @end + +
+
Code
+ +
+ Clone with HTTPS: +
+ + +
+
+
+
+
+
+ @if is_top_directory
-- 2.39.5