mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Use bar colors to show revision status in revision lists
Summary: Ref T3772. The original version of D5451 had a very colorful version of this which felt a bit arbitrary, and we moved away from it after discussion, particularly [[ https://secure.phabricator.com/D5451#comment-8 | here (chad) ]] and [[ https://secure.phabricator.com/D5451#comment-14 | here (me) ]] and [[ https://secure.phabricator.com/D5451#comment-19 | here (chad again) ]]. The core of my objection was that status and priority to the viewer aren't the same: a "needs revision" revision that you authored is high priority (you need to revise it), but a "needs revision" revision that someone else authored is low priority (you're waiting on them to revise it). If we color by status, revisions in both high priority and low priority states will be colored red. We can instead color by viewer priority (blocking others = red, needs attention = orange, waiting on others = blue; or something), but that would be redundant (we already group by it, so you'd get big chunks of stuff with the same color and color would have no utility), confusing (in ungrouped views, the colors would not be self-explanatory) and weirdly inconsistent (different users would see objects having different colors). I still think all this holds, but I also thought that "viewer priority" was enormously more important than "state", since I use the former frequently and the latter very rarely. From T3772, it sounds like some users use "state" a lot more than I do (i.e., they want to find "accepted" revisions within a "viewer priority" group like "Action Required"). This is a possible approach to that. I think another issue was the heavy use of the color in the original; this restores a more conservative version of it which doesn't have as much weight. In particular: - Revisions in the "Needs Review" state retain the default color, rather than orange. - Revisions in the "Closed" state have the disabled effect. Test Plan: See screenshot. Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T3772 Differential Revision: https://secure.phabricator.com/D6839
This commit is contained in:
parent
9a95b1e7d1
commit
5a11f08ba4
1 changed files with 17 additions and 0 deletions
|
@ -211,6 +211,23 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
$item->addAttribute(pht('%s: %s', $header, $field));
|
||||
}
|
||||
|
||||
switch ($status) {
|
||||
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
|
||||
break;
|
||||
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
|
||||
$item->setBarColor('red');
|
||||
break;
|
||||
case ArcanistDifferentialRevisionStatus::ACCEPTED:
|
||||
$item->setBarColor('green');
|
||||
break;
|
||||
case ArcanistDifferentialRevisionStatus::CLOSED:
|
||||
$item->setDisabled(true);
|
||||
break;
|
||||
case ArcanistDifferentialRevisionStatus::ABANDONED:
|
||||
$item->setBarColor('black');
|
||||
break;
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue