From 355b6b9914cc54b163e5ea280fac235488d3b57f Mon Sep 17 00:00:00 2001 From: Kasper Nilsson Date: Fri, 22 Sep 2017 16:17:55 -0700 Subject: [PATCH] Swap 'expand inline' and 'reviewed' controls In the file list, the 'expand inline' and 'reviewed' controls should be swapped. Contextually, it makes more sense for the 'expand' control to appear first, as one needs no information about the file in order to want to expand it -- in the case of the reviewed checkbox, the user is expected to have viewed the file before toggling the checkbox state. In addition, some work was done to migrate the reviewed checkbox to the new button-like styling designed by Arnab. Bug: Issue 7275 Change-Id: I5a052da8fdce79523709e9c98b01466cb26eb242 --- .../change/gr-file-list/gr-file-list.html | 71 +++++++++++++------ .../change/gr-file-list/gr-file-list.js | 22 ++++-- .../gr-file-list/gr-file-list_test.html | 28 +++++--- 3 files changed, 86 insertions(+), 35 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 3464fea25e..10f4b27b07 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 @@ -37,6 +37,7 @@ limitations under the License. display: block; } .row { + align-items: center; border-top: 1px solid #eee; display: flex; padding: .1em .25em; @@ -44,6 +45,9 @@ limitations under the License. :host(.loading) .row { opacity: .5; }; + :host(.editLoaded) .hideOnEdit { + display: none; + } .reviewed, .status { align-items: center; @@ -107,14 +111,13 @@ limitations under the License. font-family: var(--font-family-bold); } .show-hide { - margin-left: .4em; + width: 1em; } .fileListButton { margin: .5em; } .totalChanges { justify-content: flex-end; - padding-right: 2.6em; text-align: right; } .warning { @@ -129,7 +132,6 @@ limitations under the License. display: block; font-size: .8em; min-width: 2em; - margin-top: .1em; } gr-diff { box-shadow: 0 1px 3px rgba(0, 0, 0, .3); @@ -147,12 +149,39 @@ limitations under the License. .mobile { display: none; } - #container.editLoaded .hideOnEdit { - display: none; - } .expandInline { padding-right: .25em; } + .reviewed { + margin-left: 2em; + width: 15em; + } + .reviewed label { + color: #2A66D9; + opacity: 0; + justify-content: flex-end; + width: 100%; + } + .reviewed label:hover { + cursor: pointer; + opacity: 100; + } + .row:hover .reviewed label, + .row:focus .reviewed label { + opacity: 100; + } + .reviewed input { + display: none; + } + .reviewedLabel { + color: rgba(0, 0, 0, .54); + margin-right: 1em; + opacity: 0; + } + .reviewedLabel.isReviewed { + display: initial; + opacity: 100; + } @media screen and (max-width: 50em) { .desktop { display: none; @@ -185,7 +214,6 @@ limitations under the License.