Clip very long branch names to avoid overflow Repository indexes with huge branch names can see the branch name overlap with recent commit history or README.md file contents. This is caused by the ref list using a "float: left" with a fixed width specification of 200px. Reduce the left side padding to 15px to get more space for the actual branch/tag names while still showing some level of indent below the Branches and Tags headers. Request overflow hidden with ellipsis for truncation in the browser. Expand the lists on the /+refs page to show 500px for each of the Branches and Tags columns, allowing names clipped on the repository index page a better chance to be presented without any clipping after following the "More..." link. Change-Id: I13a833452b7298ac5d45dc63958f8921649cd464
diff --git a/gitiles-servlet/src/main/resources/com/google/gitiles/static/gitiles.css b/gitiles-servlet/src/main/resources/com/google/gitiles/static/gitiles.css index 37e3dca..26130ae 100644 --- a/gitiles-servlet/src/main/resources/com/google/gitiles/static/gitiles.css +++ b/gitiles-servlet/src/main/resources/com/google/gitiles/static/gitiles.css
@@ -156,6 +156,18 @@ float: left; width: 200px; } +.refs-detail { + width: 500px; +} +.ref-list { + padding-left: 15px; + padding-right: 5px; +} +.ref-list li { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .ref-list li.head-ref { font-weight: bold; }
diff --git a/gitiles-servlet/src/main/resources/com/google/gitiles/templates/RefList.soy b/gitiles-servlet/src/main/resources/com/google/gitiles/templates/RefList.soy index e42ee7e..57b1111 100644 --- a/gitiles-servlet/src/main/resources/com/google/gitiles/templates/RefList.soy +++ b/gitiles-servlet/src/main/resources/com/google/gitiles/templates/RefList.soy
@@ -34,7 +34,7 @@ {/call} {if length($branches)} - <div class="refs-branches"> + <div class="refs-branches refs-detail"> {call .refList} {param type: 'Branches' /} {param refs: $branches /} @@ -43,7 +43,7 @@ {/if} {if length($tags)} - <div class="refs-tags"> + <div class="refs-tags refs-detail"> {call .refList} {param type: 'Tags' /} {param refs: $tags /}