Page MenuHomePhabricator

D18748.id44998.diff
No OneTemporary

D18748.id44998.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -73,7 +73,7 @@
'rsrc/css/application/diffusion/diffusion-icons.css' => '0c15255e',
'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6',
'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec',
- 'rsrc/css/application/diffusion/diffusion-source.css' => '69ac9399',
+ 'rsrc/css/application/diffusion/diffusion-source.css' => '3a1056d8',
'rsrc/css/application/diffusion/diffusion.css' => '45727264',
'rsrc/css/application/feed/feed.css' => 'ecd4ec57',
'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948',
@@ -572,7 +572,7 @@
'diffusion-icons-css' => '0c15255e',
'diffusion-readme-css' => '419dd5b6',
'diffusion-repository-css' => 'ee6f20ec',
- 'diffusion-source-css' => '69ac9399',
+ 'diffusion-source-css' => '3a1056d8',
'diviner-shared-css' => '896f1d43',
'font-fontawesome' => 'e838e088',
'font-lato' => 'c7ccd872',
diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseController.php
@@ -1127,6 +1127,10 @@
));
}
+ $skip_text = pht('Skip Past This Commit');
+ $skip_icon = id(new PHUIIconView())
+ ->setIcon('fa-caret-square-o-left');
+
foreach ($display as $line_index => $line) {
$row = array();
@@ -1142,14 +1146,12 @@
$revision_link = null;
$commit_link = null;
$before_link = null;
- $commit_date = null;
- $style = 'border-right: 3px solid '.$line['color'].';';
+ $style = 'background: '.$line['color'].';';
if ($identifier && !$line['duplicate']) {
if (isset($commit_links[$identifier])) {
- $commit_link = $commit_links[$identifier]['link'];
- $commit_date = $commit_links[$identifier]['date'];
+ $commit_link = $commit_links[$identifier];
}
if (isset($revision_map[$identifier])) {
@@ -1160,10 +1162,6 @@
}
$skip_href = $line_href.'?before='.$identifier.'&view=blame';
- $skip_text = pht('Skip Past This Commit');
- $icon = id(new PHUIIconView())
- ->setIcon('fa-caret-square-o-left');
-
$before_link = javelin_tag(
'a',
array(
@@ -1175,7 +1173,7 @@
'size' => 300,
),
),
- $icon);
+ $skip_icon);
}
if ($show_blame) {
@@ -1186,41 +1184,33 @@
),
$before_link);
- $row[] = phutil_tag(
- 'th',
- array(
- 'class' => 'diffusion-rev-link',
- ),
- $commit_link);
-
- if ($revision_map) {
- $row[] = phutil_tag(
- 'th',
- array(
- 'class' => 'diffusion-blame-revision',
- ),
- $revision_link);
+ $object_links = array();
+ $object_links[] = $commit_link;
+ if ($revision_link) {
+ $object_links[] = phutil_tag('span', array(), '/');
+ $object_links[] = $revision_link;
}
$row[] = phutil_tag(
'th',
array(
- 'class' => 'diffusion-blame-date',
+ 'class' => 'diffusion-rev-link',
),
- $commit_date);
+ $object_links);
}
$line_link = phutil_tag(
'a',
array(
'href' => $line_href,
+ 'style' => $style,
),
$line_number);
$row[] = javelin_tag(
'th',
array(
- 'class' => 'diffusion-line-link ',
+ 'class' => 'diffusion-line-link',
'sigil' => 'phabricator-source-line',
'style' => $style,
),
@@ -1536,6 +1526,33 @@
return head($parents);
}
+ private function renderRevisionTooltip(
+ DifferentialRevision $revision,
+ $handles) {
+ $viewer = $this->getRequest()->getUser();
+
+ $date = phabricator_date($revision->getDateModified(), $viewer);
+ $id = $revision->getID();
+ $title = $revision->getTitle();
+ $header = "D{$id} {$title}";
+
+ $author = $handles[$revision->getAuthorPHID()]->getName();
+
+ return "{$header}\n{$date} \xC2\xB7 {$author}";
+ }
+
+ private function renderCommitTooltip(
+ PhabricatorRepositoryCommit $commit,
+ $author) {
+
+ $viewer = $this->getRequest()->getUser();
+
+ $date = phabricator_date($commit->getEpoch(), $viewer);
+ $summary = trim($commit->getSummary());
+
+ return "{$summary}\n{$date} \xC2\xB7 {$author}";
+ }
+
protected function markupText($text) {
$engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine();
$engine->setConfig('viewer', $this->getRequest()->getUser());
@@ -1743,6 +1760,9 @@
->setViewer($viewer)
->withRepository($repository)
->withIdentifiers($identifiers)
+ // TODO: We only fetch this to improve author display behavior, but
+ // shouldn't really need to?
+ ->needCommitData(true)
->execute();
$commits = mpull($commits, null, 'getCommitIdentifier');
} else {
@@ -1754,27 +1774,25 @@
private function renderCommitLinks(array $commits, $handles) {
$links = array();
- $viewer = $this->getViewer();
foreach ($commits as $identifier => $commit) {
- $date = phabricator_date($commit->getEpoch(), $viewer);
- $summary = trim($commit->getSummary());
-
- $commit_link = phutil_tag(
- 'a',
- array(
- 'href' => $commit->getURI(),
- ),
- $summary);
+ $tooltip = $this->renderCommitTooltip(
+ $commit,
+ $commit->renderAuthorShortName($handles));
- $commit_date = phutil_tag(
+ $commit_link = javelin_tag(
'a',
array(
'href' => $commit->getURI(),
+ 'sigil' => 'has-tooltip',
+ 'meta' => array(
+ 'tip' => $tooltip,
+ 'align' => 'E',
+ 'size' => 600,
+ ),
),
- $date);
+ $commit->getLocalName());
- $links[$identifier]['link'] = $commit_link;
- $links[$identifier]['date'] = $commit_date;
+ $links[$identifier] = $commit_link;
}
return $links;
@@ -1785,10 +1803,19 @@
foreach ($revisions as $revision) {
$revision_id = $revision->getID();
- $revision_link = phutil_tag(
+
+ $tooltip = $this->renderRevisionTooltip($revision, $handles);
+
+ $revision_link = javelin_tag(
'a',
array(
'href' => '/'.$revision->getMonogram(),
+ 'sigil' => 'has-tooltip',
+ 'meta' => array(
+ 'tip' => $tooltip,
+ 'align' => 'E',
+ 'size' => 600,
+ ),
),
$revision->getMonogram());
diff --git a/webroot/rsrc/css/application/diffusion/diffusion-source.css b/webroot/rsrc/css/application/diffusion/diffusion-source.css
--- a/webroot/rsrc/css/application/diffusion/diffusion-source.css
+++ b/webroot/rsrc/css/application/diffusion/diffusion-source.css
@@ -13,22 +13,24 @@
-webkit-overflow-scrolling: touch;
}
-.diffusion-source tr.phabricator-source-highlight th,
-.diffusion-source tr.phabricator-source-highlight td {
- background: {$gentle.highlight};
+.diffusion-source tr.phabricator-source-highlight {
+ background: {$sh-yellowbackground};
}
.diffusion-source th {
text-align: right;
vertical-align: top;
- color: {$darkbluetext};
+ background: {$lightgreybackground};
+ color: {$bluetext};
border-right: 1px solid {$thinblueborder};
}
.diffusion-source td {
vertical-align: top;
white-space: pre-wrap;
- padding: 3px 12px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ padding-left: 8px;
width: 100%;
word-break: break-all;
}
@@ -43,18 +45,12 @@
}
.diffusion-blame-link,
-.diffusion-rev-link,
-.diffusion-blame-date {
+.diffusion-rev-link {
white-space: nowrap;
}
-.diffusion-blame-date,
-.diffusion-blame-link,
-.diffusion-blame-revision,
-.diffusion-rev-link {
- background: {$lightgreybackground};
- font: {$basefont};
- font-size: {$smallerfontsize};
+.diffusion-blame-link {
+ min-width: 28px;
}
.diffusion-source th.diffusion-rev-link {
@@ -62,23 +58,16 @@
min-width: 130px;
}
-.diffusion-source a {
+.diffusion-blame-link a,
+.diffusion-rev-link a,
+.diffusion-line-link a {
color: {$darkbluetext};
}
-.diffusion-rev-link a {
- max-width: 300px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- margin: 3px 8px;
- display: block;
-}
-
-.diffusion-blame-date a,
-.diffusion-blame-revision a {
- float: right;
- margin: 3px 8px;
+.diffusion-rev-link a,
+.diffusion-rev-link span {
+ margin: 2px 8px 0;
+ display: inline-block;
}
.diffusion-rev-link span {
@@ -91,19 +80,7 @@
.diffusion-line-link a {
/* Give the user a larger click target. */
display: block;
- padding: 4px 8px 3px;
-}
-
-.diffusion-line-link a {
- color: {$lightgreytext};
-}
-
-.diffusion-blame-link a .phui-icon-view {
- color: {$bluetext};
-}
-
-.diffusion-blame-link a:hover .phui-icon-view {
- color: {$sky};
+ padding: 2px 8px;
}
.diffusion-line-link {

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 1, 12:56 PM (4 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7726012
Default Alt Text
D18748.id44998.diff (9 KB)

Event Timeline