@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.

Add coverage tooltips in Diffusion file browse mode

Summary: Fixes T10816. The way these work is a little unusual since these chunks of file-rendering code are unusuall performance-sensitive, so the Differential version doesn't adapt directly to Diffusion. Both can possibly be unified at some point in the future, although they do slightly different things.

Test Plan: {F1220170}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10816

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

+68 -1
+8
resources/celerity/map.php
··· 393 393 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', 394 394 'rsrc/js/application/diffusion/behavior-commit-branches.js' => 'bdaf4d04', 395 395 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '5a0b1a64', 396 + 'rsrc/js/application/diffusion/behavior-diffusion-browse-file.js' => '054a0f0b', 396 397 'rsrc/js/application/diffusion/behavior-jump-to.js' => '73d09eef', 397 398 'rsrc/js/application/diffusion/behavior-load-blame.js' => '42126667', 398 399 'rsrc/js/application/diffusion/behavior-locate-file.js' => '6d3e1947', ··· 606 607 'javelin-behavior-differential-populate' => '8694b1df', 607 608 'javelin-behavior-differential-toggle-files' => 'ca3f91eb', 608 609 'javelin-behavior-differential-user-select' => 'a8d8459d', 610 + 'javelin-behavior-diffusion-browse-file' => '054a0f0b', 609 611 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', 610 612 'javelin-behavior-diffusion-commit-graph' => '5a0b1a64', 611 613 'javelin-behavior-diffusion-jump-to' => '73d09eef', ··· 917 919 '05270951' => array( 918 920 'javelin-util', 919 921 'javelin-magical-init', 922 + ), 923 + '054a0f0b' => array( 924 + 'javelin-behavior', 925 + 'javelin-dom', 926 + 'javelin-util', 927 + 'phabricator-tooltip', 920 928 ), 921 929 '056da01b' => array( 922 930 'aphront-typeahead-control-css',
+13 -1
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 1187 1187 $commit_links = $this->renderCommitLinks($blame_commits, $handles); 1188 1188 $revision_links = $this->renderRevisionLinks($revisions, $handles); 1189 1189 1190 + if ($this->coverage) { 1191 + require_celerity_resource('differential-changeset-view-css'); 1192 + Javelin::initBehavior( 1193 + 'diffusion-browse-file', 1194 + array( 1195 + 'labels' => array( 1196 + 'cov-C' => pht('Covered'), 1197 + 'cov-N' => pht('Not Covered'), 1198 + 'cov-U' => pht('Not Executable'), 1199 + ), 1200 + )); 1201 + } 1202 + 1190 1203 $skip_text = pht('Skip Past This Commit'); 1191 1204 foreach ($display as $line_index => $line) { 1192 1205 $row = array(); ··· 1304 1317 )); 1305 1318 1306 1319 if ($this->coverage) { 1307 - require_celerity_resource('differential-changeset-view-css'); 1308 1320 $cov_index = $line_index; 1309 1321 1310 1322 if (isset($this->coverage[$cov_index])) {
+47
webroot/rsrc/js/application/diffusion/behavior-diffusion-browse-file.js
··· 1 + /** 2 + * @provides javelin-behavior-diffusion-browse-file 3 + * @requires javelin-behavior 4 + * javelin-dom 5 + * javelin-util 6 + * phabricator-tooltip 7 + */ 8 + 9 + JX.behavior('diffusion-browse-file', function(config, statics) { 10 + if (statics.installed) { 11 + return; 12 + } 13 + statics.installed = true; 14 + 15 + var map = config.labels; 16 + 17 + JX.Stratcom.listen( 18 + ['mouseover', 'mouseout'], 19 + ['phabricator-source', 'tag:td'], 20 + function(e) { 21 + var target = e.getTarget(); 22 + 23 + // NOTE: We're using raw classnames instead of sigils and metadata here 24 + // because these elements are unusual: there are a lot of them on the 25 + // page, and rendering all the extra metadata to do this in a normal way 26 + // would be needlessly expensive. This is an unusual case. 27 + 28 + if (!target.className.match(/cov-/)) { 29 + return; 30 + } 31 + 32 + if (e.getType() == 'mouseout') { 33 + JX.Tooltip.hide(); 34 + return; 35 + } 36 + 37 + for (var k in map) { 38 + if (!target.className.match(k)) { 39 + continue; 40 + } 41 + 42 + var label = map[k]; 43 + JX.Tooltip.show(target, 300, 'E', label); 44 + break; 45 + } 46 + }); 47 + });