From 98f893d4c30326ebd8ede330176a2742a829be26 Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Mon, 17 Mar 2025 06:37:29 +0000 Subject: [PATCH 1/5] Optimize Layout Styles of Filelist --- web_src/css/repo/home-file-list.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web_src/css/repo/home-file-list.css b/web_src/css/repo/home-file-list.css index 189b6406d402b..293941667a376 100644 --- a/web_src/css/repo/home-file-list.css +++ b/web_src/css/repo/home-file-list.css @@ -14,10 +14,6 @@ } } -#repo-files-table .repo-file-cell.name .svg { - margin-right: 2px; -} - #repo-files-table .svg.octicon-file-directory-fill, #repo-files-table .svg.octicon-file-submodule { color: var(--color-primary); @@ -70,6 +66,9 @@ } #repo-files-table .repo-file-cell.name { + display: flex; + align-items: center; + gap: 0.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; From a7d095d5881bbe2ca38568955c2b24936109b011 Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Tue, 18 Mar 2025 01:25:39 +0000 Subject: [PATCH 2/5] fix --- templates/repo/view_list.tmpl | 4 ++-- web_src/css/repo/home-file-list.css | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index b4d27fb1e355a..dc0af38a3489a 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -19,9 +19,9 @@ {{if $entry.IsSubModule}} {{$submoduleLink := $submoduleFile.SubmoduleWebLink ctx}} {{if $submoduleLink}} - {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} + {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} {{else}} - {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} + {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} {{end}} {{else}} {{if $entry.IsDir}} diff --git a/web_src/css/repo/home-file-list.css b/web_src/css/repo/home-file-list.css index 293941667a376..baf4655167bdc 100644 --- a/web_src/css/repo/home-file-list.css +++ b/web_src/css/repo/home-file-list.css @@ -69,11 +69,20 @@ display: flex; align-items: center; gap: 0.5em; + overflow: hidden; +} + +#repo-files-table .repo-file-cell.name >* { + flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +#repo-files-table .repo-file-cell.name .muted { + flex-shrink: 1; +} + @media (max-width: 767.98px) { #repo-files-table .repo-file-cell.name { max-width: 35vw; From 28ab1cf5f790e556f3edcb331742f8388e615b8f Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Tue, 18 Mar 2025 12:55:08 +0000 Subject: [PATCH 3/5] fix --- templates/repo/view_list.tmpl | 8 ++++---- web_src/css/repo/home-file-list.css | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index dc0af38a3489a..001d56d5dab09 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -19,14 +19,14 @@ {{if $entry.IsSubModule}} {{$submoduleLink := $submoduleFile.SubmoduleWebLink ctx}} {{if $submoduleLink}} - {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} + {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} {{else}} - {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} + {{$entry.Name}} @ {{ShortSha $submoduleFile.RefID}} {{end}} {{else}} {{if $entry.IsDir}} {{$subJumpablePathName := $entry.GetSubJumpablePathName}} - + {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}} {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}} {{if eq $subJumpablePathFieldLast 0}} @@ -37,7 +37,7 @@ {{end}} {{else}} - {{$entry.Name}} + {{$entry.Name}} {{end}} {{end}} diff --git a/web_src/css/repo/home-file-list.css b/web_src/css/repo/home-file-list.css index baf4655167bdc..fc13cf5b402ed 100644 --- a/web_src/css/repo/home-file-list.css +++ b/web_src/css/repo/home-file-list.css @@ -72,15 +72,18 @@ overflow: hidden; } -#repo-files-table .repo-file-cell.name >* { +#repo-files-table .repo-file-cell.name > a, +#repo-files-table .repo-file-cell.name > svg, +#repo-files-table .repo-file-cell.name > span { flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -#repo-files-table .repo-file-cell.name .muted { +#repo-files-table .repo-file-cell.name .name { flex-shrink: 1; + min-width: 3em; } @media (max-width: 767.98px) { From 4591de1c38f2e9cd2bd9da75ce5ada15cb2e5584 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 18 Mar 2025 21:40:47 +0800 Subject: [PATCH 4/5] fix styles --- templates/repo/view_list.tmpl | 14 +++++++++----- web_src/css/repo/home-file-list.css | 3 +-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 001d56d5dab09..691202060efac 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -14,19 +14,23 @@ {{$entry := $item.Entry}} {{$commit := $item.Commit}} {{$submoduleFile := $item.SubmoduleFile}} -
+ diff --git a/web_src/css/repo/home-file-list.css b/web_src/css/repo/home-file-list.css index fc13cf5b402ed..46128457ede6a 100644 --- a/web_src/css/repo/home-file-list.css +++ b/web_src/css/repo/home-file-list.css @@ -73,7 +73,6 @@ } #repo-files-table .repo-file-cell.name > a, -#repo-files-table .repo-file-cell.name > svg, #repo-files-table .repo-file-cell.name > span { flex-shrink: 0; white-space: nowrap; @@ -81,7 +80,7 @@ text-overflow: ellipsis; } -#repo-files-table .repo-file-cell.name .name { +#repo-files-table .repo-file-cell.name .entry-name { flex-shrink: 1; min-width: 3em; } From 675dc88c0d42b5de6e916e6c8fd5f87c8a05a9f2 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 18 Mar 2025 21:46:37 +0800 Subject: [PATCH 5/5] fix styles --- templates/repo/view_list.tmpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 691202060efac..4745110dd2176 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -20,12 +20,10 @@ {{$submoduleLink := $submoduleFile.SubmoduleWebLink ctx}} {{if $submoduleLink}} {{$entry.Name}} - @ - {{ShortSha $submoduleFile.RefID}} + @ {{ShortSha $submoduleFile.RefID}} {{else}} {{$entry.Name}} - @ - {{ShortSha $submoduleFile.RefID}} + @ {{ShortSha $submoduleFile.RefID}} {{end}} {{else}} {{if $entry.IsDir}}