@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Colorize lines in blame under DocumentEngine, to show relative age of changes

Summary:
Depends on D19313. Ref T13105. Fixes T13015. We lost the coloration for ages in the switch to Document Engine.

Restore it, and use a wider range of colors to make the information more clear.

Test Plan: Viewed some blame, saw a nice explosion of bright colors. This is a cornerstone of good design.

Maniphest Tasks: T13105, T13015

Differential Revision: https://secure.phabricator.com/D19314

+84 -13
+9 -9
resources/celerity/map.php
··· 119 119 'rsrc/css/font/font-lato.css' => 'c7ccd872', 120 120 'rsrc/css/font/phui-font-icon-base.css' => '870a7360', 121 121 'rsrc/css/layout/phabricator-filetree-view.css' => 'b912ad97', 122 - 'rsrc/css/layout/phabricator-source-code-view.css' => 'af54e277', 122 + 'rsrc/css/layout/phabricator-source-code-view.css' => 'a526a787', 123 123 'rsrc/css/phui/button/phui-button-bar.css' => 'f1ff5494', 124 124 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68', 125 125 'rsrc/css/phui/button/phui-button.css' => '1863cc6e', ··· 390 390 'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'f01586dc', 391 391 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '1db13e70', 392 392 'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef', 393 - 'rsrc/js/application/files/behavior-document-engine.js' => '6760beb4', 393 + 'rsrc/js/application/files/behavior-document-engine.js' => '0333c0b6', 394 394 'rsrc/js/application/files/behavior-icon-composer.js' => '8499b6ab', 395 395 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', 396 396 'rsrc/js/application/harbormaster/behavior-harbormaster-log.js' => '191b4909', ··· 604 604 'javelin-behavior-diffusion-jump-to' => '73d09eef', 605 605 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 606 606 'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc', 607 - 'javelin-behavior-document-engine' => '6760beb4', 607 + 'javelin-behavior-document-engine' => '0333c0b6', 608 608 'javelin-behavior-doorkeeper-tag' => '1db13e70', 609 609 'javelin-behavior-drydock-live-operation-status' => '901935ef', 610 610 'javelin-behavior-durable-column' => '2ae077e1', ··· 780 780 'phabricator-search-results-css' => '505dd8cf', 781 781 'phabricator-shaped-request' => '7cbe244b', 782 782 'phabricator-slowvote-css' => 'a94b7230', 783 - 'phabricator-source-code-view-css' => 'af54e277', 783 + 'phabricator-source-code-view-css' => 'a526a787', 784 784 'phabricator-standard-page-view' => '34ee718b', 785 785 'phabricator-textareautils' => '320810c8', 786 786 'phabricator-title' => '485aaa6c', ··· 909 909 'javelin-behavior', 910 910 'javelin-uri', 911 911 ), 912 + '0333c0b6' => array( 913 + 'javelin-behavior', 914 + 'javelin-dom', 915 + 'javelin-stratcom', 916 + ), 912 917 '040fce04' => array( 913 918 'javelin-behavior', 914 919 'javelin-request', ··· 1397 1402 'multirow-row-manager', 1398 1403 'javelin-json', 1399 1404 'phuix-form-control-view', 1400 - ), 1401 - '6760beb4' => array( 1402 - 'javelin-behavior', 1403 - 'javelin-dom', 1404 - 'javelin-stratcom', 1405 1405 ), 1406 1406 '680ea2c8' => array( 1407 1407 'javelin-install',
+14 -1
src/applications/diffusion/controller/DiffusionBlameController.php
··· 80 80 81 81 $handles = $viewer->loadHandles($handle_phids); 82 82 83 + 83 84 $map = array(); 85 + $epochs = array(); 84 86 foreach ($identifiers as $identifier) { 85 87 $revision_id = idx($revision_map, $identifier); 86 88 if ($revision_id) { ··· 173 175 174 176 $info = array( 175 177 $info, 176 - ' / ', 178 + " \xC2\xB7 ", 177 179 $revision_link, 178 180 ); 179 181 } 180 182 183 + $epoch = $commit->getEpoch(); 184 + $epochs[] = $epoch; 185 + 181 186 $data = array( 182 187 'skip' => $skip_link, 183 188 'info' => hsprintf('%s', $info), 189 + 'epoch' => $epoch, 184 190 ); 185 191 186 192 $map[$identifier] = $data; 187 193 } 188 194 195 + $epoch_min = min($epochs); 196 + $epoch_max = max($epochs); 197 + 189 198 return id(new AphrontAjaxResponse())->setContent( 190 199 array( 191 200 'blame' => $blame, 192 201 'map' => $map, 202 + 'epoch' => array( 203 + 'min' => $epoch_min, 204 + 'max' => $epoch_max, 205 + ), 193 206 )); 194 207 } 195 208
+14 -2
webroot/rsrc/css/layout/phabricator-source-code-view.css
··· 85 85 } 86 86 87 87 .phabricator-source-blame-info { 88 - color: {$lightgreytext}; 89 88 white-space: nowrap; 90 89 min-width: 130px; 91 90 border-right: 1px solid {$paste.border}; 92 91 padding-right: 8px; 92 + 93 + vertical-align: middle; 94 + color: #ffffff; 95 + } 96 + 97 + .phabricator-source-blame-info a { 98 + color: {$darkbluetext}; 99 + text-shadow: 1px 1px rgba(0, 0, 0, 0.111); 93 100 } 94 101 95 102 .phabricator-source-blame-skip a { ··· 98 105 padding: 2px 8px; 99 106 } 100 107 108 + .phabricator-source-blame-skip a .phui-icon-view { 109 + color: {$darkbluetext}; 110 + } 111 + 101 112 .device-desktop .phabricator-source-blame-skip a:hover { 102 113 background: {$bluebackground}; 103 114 } 104 115 105 116 .phabricator-source-blame-author { 106 117 display: inline-block; 118 + vertical-align: middle; 107 119 padding: 0; 108 - margin: 2px 6px -4px 8px; 120 + margin: 0 6px 0 8px; 109 121 width: 16px; 110 122 height: 16px; 111 123 background-size: 100% 100%;
+47 -1
webroot/rsrc/js/application/files/behavior-document-engine.js
··· 293 293 function renderBlame(row, blame) { 294 294 var spec = blame.map[row.commit]; 295 295 296 - 297 296 var info = null; 298 297 var skip = null; 299 298 ··· 309 308 if (row.info) { 310 309 JX.DOM.setContent(row.info, info); 311 310 } 311 + 312 + var epoch_range = (blame.epoch.max - blame.epoch.min); 313 + 314 + var epoch_value; 315 + if (!epoch_range) { 316 + epoch_value = 1; 317 + } else { 318 + epoch_value = (spec.epoch - blame.epoch.min) / epoch_range; 319 + } 320 + 321 + var h_min = 0.04; 322 + var h_max = 0.44; 323 + var h = h_min + ((h_max - h_min) * epoch_value); 324 + 325 + var s = 0.44; 326 + 327 + var v_min = 0.92; 328 + var v_max = 1.00; 329 + var v = v_min + ((v_max - v_min) * epoch_value); 330 + 331 + row.info.style.background = getHSV(h, s, v); 332 + } 333 + 334 + function getHSV(h, s, v) { 335 + var r, g, b, i, f, p, q, t; 336 + 337 + i = Math.floor(h * 6); 338 + f = h * 6 - i; 339 + p = v * (1 - s); 340 + q = v * (1 - f * s); 341 + t = v * (1 - (1 - f) * s); 342 + 343 + switch (i % 6) { 344 + case 0: r = v, g = t, b = p; break; 345 + case 1: r = q, g = v, b = p; break; 346 + case 2: r = p, g = v, b = t; break; 347 + case 3: r = p, g = q, b = v; break; 348 + case 4: r = t, g = p, b = v; break; 349 + case 5: r = v, g = p, b = q; break; 350 + } 351 + 352 + r = Math.round(r * 255); 353 + g = Math.round(g * 255); 354 + b = Math.round(b * 255); 355 + 356 + 357 + return 'rgb(' + r + ', ' + g + ', ' + b + ')'; 312 358 } 313 359 314 360 if (!statics.initialized) {