Change default comment visibility to expand all recent comments

Users had a hard time following change discussions, when all but the
most recent comment were collapsed on the change screen per
default. So we change the default to expand all comments that are not
older than a week.

Change-Id: Id2fc7c18e928331e66ac82c02d25b0483e1cd64f
This commit is contained in:
Christian Aistleitner
2013-04-04 10:45:53 +02:00
parent a3cf7138cb
commit 614675be0d
3 changed files with 8 additions and 8 deletions

View File

@@ -218,7 +218,7 @@ public class MyPreferencesScreen extends SettingsScreen {
p.getTimeFormat());
relativeDateInChangeTable.setValue(p.isRelativeDateInChangeTable());
setListBox(commentVisibilityStrategy,
AccountGeneralPreferences.CommentVisibilityStrategy.EXPAND_MOST_RECENT,
AccountGeneralPreferences.CommentVisibilityStrategy.EXPAND_RECENT,
p.getCommentVisibilityStrategy());
}
@@ -285,7 +285,7 @@ public class MyPreferencesScreen extends SettingsScreen {
AccountGeneralPreferences.TimeFormat.values()));
p.setRelativeDateInChangeTable(relativeDateInChangeTable.getValue());
p.setCommentVisibilityStrategy(getListBox(commentVisibilityStrategy,
CommentVisibilityStrategy.EXPAND_MOST_RECENT,
CommentVisibilityStrategy.EXPAND_RECENT,
CommentVisibilityStrategy.values()));
enable(false);

View File

@@ -387,7 +387,7 @@ public class ChangeScreen extends Screen
final Timestamp aged = new Timestamp(System.currentTimeMillis() - AGE);
CommentVisibilityStrategy commentVisibilityStrategy =
CommentVisibilityStrategy.EXPAND_MOST_RECENT;
CommentVisibilityStrategy.EXPAND_RECENT;
if (Gerrit.isSignedIn()) {
commentVisibilityStrategy = Gerrit.getUserAccount()
.getGeneralPreferences().getCommentVisibilityStrategy();
@@ -422,16 +422,16 @@ public class ChangeScreen extends Screen
switch (commentVisibilityStrategy) {
case COLLAPSE_ALL:
break;
case EXPAND_RECENT:
isOpen = isRecent;
break;
case EXPAND_ALL:
isOpen = true;
break;
case EXPAND_MOST_RECENT:
default:
isOpen = i == msgList.size() - 1;
break;
case EXPAND_RECENT:
default:
isOpen = isRecent;
break;
}
cp.setOpen(isOpen);
comments.add(cp);

View File

@@ -249,7 +249,7 @@ public final class AccountGeneralPreferences {
public CommentVisibilityStrategy getCommentVisibilityStrategy() {
if (commentVisibilityStrategy == null) {
return CommentVisibilityStrategy.EXPAND_MOST_RECENT;
return CommentVisibilityStrategy.EXPAND_RECENT;
}
return CommentVisibilityStrategy.valueOf(commentVisibilityStrategy);
}