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

Fix an issue with symbol lookup identifying path names in Diffusion

Summary:
Depends on D18939. Ref T13047. Symbol lookup can be activated from a diff (in Differential or Diffusion) or from the static view of a file at a particular commit.

In the latter case, we need to figure out the path a little differently. The character and line number approaches still work as written.

Test Plan:
- Command-clicked symbols in the Diffusion browse view with blame on and off; saw path, line and char populate properly.
- Command-clicked symbols in Differential diff view to check I didn't break anything.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13047

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

+34 -13
+9 -9
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '4c79d74f', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '45951e9e', 16 - 'differential.pkg.js' => 'b69ae3ec', 16 + 'differential.pkg.js' => '19ee9979', 17 17 'diffusion.pkg.css' => 'a2d17c7d', 18 18 'diffusion.pkg.js' => '6134c5a1', 19 19 'favicon.ico' => '30672e08', ··· 443 443 'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf', 444 444 'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8', 445 445 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f', 446 - 'rsrc/js/application/repository/repository-crossreference.js' => 'fc2d8ffd', 446 + 'rsrc/js/application/repository/repository-crossreference.js' => '2ab10a76', 447 447 'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e2e0a072', 448 448 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 449 449 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', ··· 692 692 'javelin-behavior-reorder-applications' => '76b9fc3e', 693 693 'javelin-behavior-reorder-columns' => 'e1d25dfb', 694 694 'javelin-behavior-reorder-profile-menu-items' => 'e2e0a072', 695 - 'javelin-behavior-repository-crossreference' => 'fc2d8ffd', 695 + 'javelin-behavior-repository-crossreference' => '2ab10a76', 696 696 'javelin-behavior-scrollbar' => '834a1173', 697 697 'javelin-behavior-search-reorder-queries' => 'e9581f08', 698 698 'javelin-behavior-select-content' => 'bf5374ef', ··· 1088 1088 'javelin-install', 1089 1089 'javelin-util', 1090 1090 ), 1091 + '2ab10a76' => array( 1092 + 'javelin-behavior', 1093 + 'javelin-dom', 1094 + 'javelin-stratcom', 1095 + 'javelin-uri', 1096 + ), 1091 1097 '2ae077e1' => array( 1092 1098 'javelin-behavior', 1093 1099 'javelin-dom', ··· 2158 2164 'javelin-view', 2159 2165 'javelin-install', 2160 2166 'javelin-dom', 2161 - ), 2162 - 'fc2d8ffd' => array( 2163 - 'javelin-behavior', 2164 - 'javelin-dom', 2165 - 'javelin-stratcom', 2166 - 'javelin-uri', 2167 2167 ), 2168 2168 'fc91ab6c' => array( 2169 2169 'javelin-behavior',
+5
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 658 658 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 659 659 ->appendChild($corpus) 660 660 ->addClass('diffusion-mobile-view') 661 + ->addSigil('diffusion-file-content-view') 662 + ->setMetadata( 663 + array( 664 + 'path' => $this->getDiffusionRequest()->getPath(), 665 + )) 661 666 ->setCollapsed(true); 662 667 663 668 $messages = array();
+20 -4
webroot/rsrc/js/application/repository/repository-crossreference.js
··· 94 94 }; 95 95 var c = target.className; 96 96 c = c.replace(classHighlight, '').trim(); 97 + 97 98 if (class_map[c]) { 98 99 query.type = class_map[c]; 99 100 } 101 + 100 102 if (target.hasAttribute('data-symbol-context')) { 101 103 query.context = target.getAttribute('data-symbol-context'); 102 104 } 105 + 103 106 if (target.hasAttribute('data-symbol-name')) { 104 107 symbol = target.getAttribute('data-symbol-name'); 105 108 } ··· 176 179 } 177 180 178 181 function getPath(target) { 179 - var changeset = JX.DOM.findAbove(target, 'div', 'differential-changeset'); 182 + // This method works in Differential, when browsing a changset. 183 + var changeset; 184 + try { 185 + changeset = JX.DOM.findAbove(target, 'div', 'differential-changeset'); 186 + return JX.Stratcom.getData(changeset).path; 187 + } catch (ex) { 188 + // Ignore. 189 + } 180 190 181 - if (!changeset) { 182 - return null; 191 + // This method works in Diffusion, when viewing the content of a file at 192 + // a particular commit. 193 + var file; 194 + try { 195 + file = JX.DOM.findAbove(target, 'div', 'diffusion-file-content-view'); 196 + return JX.Stratcom.getData(file).path; 197 + } catch (ex) { 198 + // Ignore. 183 199 } 184 200 185 - return JX.Stratcom.getData(changeset).path; 201 + return null; 186 202 } 187 203 188 204 function getChar(target) {