Move change id and status to left side of ChangeScreen2
Some users have reported missing the subject line and only reading
the commit message body on ChangeScreen2. The subject is bold and on
a "trimColor" (e.g. grey) background while the message body is on the
page background color (e.g. white). This coloring makes the subject
appear to be unrelated to the message, and reviewers find themselves
missing important context when trying to understand the commit.
Move the subject line down into the commit message body area and
slide the change number and status into the left 1/3rd of header
line bar.
Change-Id: I61c3143c636e234776189d545def9ff528eaa2bf
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
index 8ebfb38..49f1922 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
@@ -81,7 +81,6 @@
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.globalkey.client.KeyCommand;
import com.google.gwtexpui.globalkey.client.KeyCommandSet;
-import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
import com.google.gwtorm.client.KeyUtil;
import java.sql.Timestamp;
@@ -133,7 +132,6 @@
@UiField HTMLPanel headerLine;
@UiField Style style;
- @UiField Element commitSubjectText;
@UiField ToggleButton star;
@UiField Anchor permalink;
@@ -773,7 +771,6 @@
statusText.setInnerText(Util.toLongString(info.status()));
}
- renderCommitSubject(info);
renderOwner(info);
renderActionTextDate(info);
renderDiffBaseListBox(info);
@@ -823,13 +820,6 @@
setWindowTitle(sb.toString());
}
- private void renderCommitSubject(ChangeInfo info) {
- RevisionInfo rev = info.revision(revision);
- String sub = rev.commit().subject();
- commitSubjectText.setInnerSafeHtml(commentLinkProcessor.apply(
- new SafeHtmlBuilder().append(sub).linkify()));
- }
-
private void renderOwner(ChangeInfo info) {
// TODO info card hover
String name = info.owner().name() != null
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml
index c41160d..8dce1b8 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml
@@ -47,7 +47,6 @@
background-color: trimColor;
color: textColor;
font-family: sans-serif;
- font-weight: bold;
}
.subjectText {
width: 460px;
@@ -99,10 +98,6 @@
outline: none;
}
.changeId {
- display: block;
- position: absolute;
- top: 0;
- left: 22px;
width: 300px;
white-space: nowrap;
line-height: HEADER_HEIGHT;
@@ -198,11 +193,6 @@
.commitColumn { width: COMMIT_WIDTH; }
.relatedColumn { width: 375px; }
- .commitSubjectText {
- font-family: monospace;
- white-space: pre;
- }
-
.labels {
border-spacing: 0;
padding: 0;
@@ -317,7 +307,13 @@
<g:HTMLPanel styleName='{style.cs2}'>
<g:HTMLPanel styleName='{style.headerLine}' ui:field='headerLine'>
<div class='{style.subjectLine}'>
- <div class='{style.subjectText}' ui:field='commitSubjectText'/>
+ <div class='{style.idAndStatus}'>
+ <span class='{style.changeId}'>
+ <ui:msg>Change <g:Anchor ui:field='permalink' title='Reload the change (Shortcut: R)'>
+ <ui:attribute name='title'/>
+ </g:Anchor> - <span ui:field='statusText' class='{style.statusText}'/></ui:msg>
+ </span>
+ </div>
<div class='{style.subjectButtons} {style.headerButtons}'>
<g:Button ui:field='editMessage'
styleName=''
@@ -343,13 +339,6 @@
<ui:attribute name='title'/>
</c:QuickApprove>
</div>
- <div class='{style.idAndStatus}'>
- <span class='{style.changeId}'>
- <ui:msg>Change <g:Anchor ui:field='permalink' title='Reload the change (Shortcut: R)'>
- <ui:attribute name='title'/>
- </g:Anchor> - <span ui:field='statusText' class='{style.statusText}'/></ui:msg>
- </span>
- </div>
</div>
<div class='{style.statusRight}'>
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/CommitBox.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/CommitBox.java
index 52b988f..931a94b 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/CommitBox.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/CommitBox.java
@@ -90,14 +90,6 @@
String revision) {
RevisionInfo revInfo = change.revision(revision);
CommitInfo commit = revInfo.commit();
- String sub = commit.subject();
- String msg = commit.message();
- if (msg.startsWith(sub)) {
- msg = msg.substring(sub.length());
- if (msg.length() > 0 && msg.charAt(0) == '\n') {
- msg = msg.substring(1);
- }
- }
commitName.setText(revision);
idText.setText("Change-Id: " + change.change_id());
@@ -107,7 +99,7 @@
formatLink(commit.committer(), committerNameEmail,
committerDate, change.status());
text.setHTML(commentLinkProcessor.apply(
- new SafeHtmlBuilder().append(msg).linkify()));
+ new SafeHtmlBuilder().append(commit.message()).linkify()));
GitwebLink gw = Gerrit.getGitwebLink();
if (gw != null && gw.canLink(revInfo)) {