From acf455a9b694031f3830d029888f022e76446e62 Mon Sep 17 00:00:00 2001 From: Becky Siegel Date: Fri, 9 Dec 2016 11:45:40 -0800 Subject: [PATCH] Make file list more useful on mobile Previously, the file path was truncated and often the file name was cut off completely, which had made it hard to tell what files were actually changed. With this change, the text appearing on the file list just show ellipsis and the file name (ex: '.../filename.txt'). Additionally, for both mobile and larger screens, the full filename appears (line wrapped if needed) when the file list item is expanded. This way, if enough content is cut off that it's still not useful, there is a way to see the path in it's entirety. Bug: Issue 4609 Change-Id: Ic4aaf45bafbc3c5b31add8f7c43b18c9d2b2913b --- .../change/gr-file-list/gr-file-list.html | 23 +++++++++++++++++-- .../change/gr-file-list/gr-file-list.js | 9 ++++++++ .../gr-file-list/gr-file-list_test.html | 15 ++++++++++++ .../diff/gr-diff-view/gr-diff-view.js | 12 +--------- .../diff/gr-diff-view/gr-diff-view_test.html | 6 ++--- polygerrit-ui/app/scripts/util.js | 20 ++++++++++++++++ 6 files changed, 69 insertions(+), 16 deletions(-) diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html index 6425acb7a6..61bc20ba43 100644 --- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html +++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html @@ -145,6 +145,12 @@ limitations under the License. .patchSetSelect { max-width: 8em; } + .truncatedFileName { + display: none; + } + .expanded .fullFileName { + white-space: normal; + } @media screen and (max-width: 50em) { .row.selected { background-color: transparent; @@ -159,6 +165,14 @@ limitations under the License. .comments { min-width: initial; } + .expanded .fullFileName, + .truncatedFileName { + display: block; + } + .expanded .truncatedFileName, + .fullFileName { + display: none; + } }
@@ -217,11 +231,16 @@ limitations under the License.
[[_computeFileStatus(file.status)]]
- -
+
[[_computeFileDisplayName(file.__path)]]
+
+ [[_computeTruncatedFileDisplayName(file.__path)]] +