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

Mark "low importance" and "owned" changes in the filetree

Summary: Ref T13516. Mark low-importance changes (generated code, deleted files) and owned-with-authority changes in the filetree.

Test Plan: {F7375327}

Maniphest Tasks: T13516

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

+138 -32
+23 -23
resources/celerity/map.php
··· 12 12 'core.pkg.css' => 'dd5f04a3', 13 13 'core.pkg.js' => '544bc792', 14 14 'differential.pkg.css' => 'cb99cd21', 15 - 'differential.pkg.js' => 'b1ef535d', 15 + 'differential.pkg.js' => '6c315e3f', 16 16 'diffusion.pkg.css' => '42c75c37', 17 17 'diffusion.pkg.js' => 'a98c0bf7', 18 18 'maniphest.pkg.css' => '35995d6d', ··· 59 59 'rsrc/css/application/countdown/timer.css' => 'bff8012f', 60 60 'rsrc/css/application/daemon/bulk-job.css' => '73af99f5', 61 61 'rsrc/css/application/dashboard/dashboard.css' => '5a205b9d', 62 - 'rsrc/css/application/diff/diff-tree-view.css' => 'bd83417c', 62 + 'rsrc/css/application/diff/diff-tree-view.css' => '26fb4a0d', 63 63 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 64 64 'rsrc/css/application/differential/add-comment.css' => '7e5900d9', 65 65 'rsrc/css/application/differential/changeset-view.css' => '489b6995', ··· 378 378 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => 'a2ab19be', 379 379 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9', 380 380 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 381 - 'rsrc/js/application/diff/DiffChangeset.js' => 'd089ffb1', 381 + 'rsrc/js/application/diff/DiffChangeset.js' => 'a1a5dc46', 382 382 'rsrc/js/application/diff/DiffChangesetList.js' => '57035863', 383 383 'rsrc/js/application/diff/DiffInline.js' => '16e97ebc', 384 - 'rsrc/js/application/diff/DiffPathView.js' => '5f70ad12', 385 - 'rsrc/js/application/diff/DiffTreeView.js' => 'ccf691f3', 384 + 'rsrc/js/application/diff/DiffPathView.js' => 'ceb66010', 385 + 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 386 386 'rsrc/js/application/diff/behavior-preview-link.js' => 'f51e9c17', 387 387 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', 388 388 'rsrc/js/application/differential/behavior-populate.js' => 'b86ef6c2', ··· 558 558 'conpherence-thread-manager' => 'aec8e38c', 559 559 'conpherence-transaction-css' => '3a3f5e7e', 560 560 'd3' => '9d068042', 561 - 'diff-tree-view-css' => 'bd83417c', 561 + 'diff-tree-view-css' => '26fb4a0d', 562 562 'differential-changeset-view-css' => '489b6995', 563 563 'differential-core-view-css' => '7300a73e', 564 564 'differential-revision-add-comment-css' => '7e5900d9', ··· 775 775 'phabricator-darklog' => '3b869402', 776 776 'phabricator-darkmessage' => '26cd4b73', 777 777 'phabricator-dashboard-css' => '5a205b9d', 778 - 'phabricator-diff-changeset' => 'd089ffb1', 778 + 'phabricator-diff-changeset' => 'a1a5dc46', 779 779 'phabricator-diff-changeset-list' => '57035863', 780 780 'phabricator-diff-inline' => '16e97ebc', 781 - 'phabricator-diff-path-view' => '5f70ad12', 782 - 'phabricator-diff-tree-view' => 'ccf691f3', 781 + 'phabricator-diff-path-view' => 'ceb66010', 782 + 'phabricator-diff-tree-view' => '5d83623b', 783 783 'phabricator-drag-and-drop-file-upload' => '4370900d', 784 784 'phabricator-draggable-list' => '0169e425', 785 785 'phabricator-fatal-config-template-css' => '20babf50', ··· 1505 1505 'javelin-dom', 1506 1506 'phuix-dropdown-menu', 1507 1507 ), 1508 - '5f70ad12' => array( 1508 + '5d83623b' => array( 1509 1509 'javelin-dom', 1510 1510 ), 1511 1511 '5faf27b9' => array( ··· 1829 1829 'javelin-dom', 1830 1830 'javelin-workflow', 1831 1831 ), 1832 + 'a1a5dc46' => array( 1833 + 'javelin-dom', 1834 + 'javelin-util', 1835 + 'javelin-stratcom', 1836 + 'javelin-install', 1837 + 'javelin-workflow', 1838 + 'javelin-router', 1839 + 'javelin-behavior-device', 1840 + 'javelin-vector', 1841 + 'phabricator-diff-inline', 1842 + 'phabricator-diff-path-view', 1843 + ), 1832 1844 'a241536a' => array( 1833 1845 'javelin-install', 1834 1846 ), ··· 2067 2079 'phuix-icon-view', 2068 2080 'phabricator-busy', 2069 2081 ), 2070 - 'ccf691f3' => array( 2082 + 'ceb66010' => array( 2071 2083 'javelin-dom', 2072 2084 ), 2073 2085 'cef53b3e' => array( ··· 2080 2092 'javelin-behavior', 2081 2093 'javelin-dom', 2082 2094 'javelin-stratcom', 2083 - ), 2084 - 'd089ffb1' => array( 2085 - 'javelin-dom', 2086 - 'javelin-util', 2087 - 'javelin-stratcom', 2088 - 'javelin-install', 2089 - 'javelin-workflow', 2090 - 'javelin-router', 2091 - 'javelin-behavior-device', 2092 - 'javelin-vector', 2093 - 'phabricator-diff-inline', 2094 - 'phabricator-diff-path-view', 2095 2095 ), 2096 2096 'd12d214f' => array( 2097 2097 'javelin-install',
+9 -2
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 384 384 ->setTitle(pht('Diff %s', $target->getID())) 385 385 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY); 386 386 387 - 388 387 $revision_id = $revision->getID(); 389 388 $inline_list_uri = "/revision/inlines/{$revision_id}/"; 390 389 $inline_list_uri = $this->getApplicationURI($inline_list_uri); ··· 456 455 $reviewer_changesets = $this->getPackageChangesets($reviewer_phid); 457 456 $reviewer->attachChangesets($reviewer_changesets); 458 457 } 458 + 459 + $authority_packages = $this->getAuthorityPackages(); 460 + foreach ($changesets as $changeset) { 461 + $changeset_packages = $this->getChangesetPackages($changeset); 462 + 463 + $changeset 464 + ->setAuthorityPackages($authority_packages) 465 + ->setChangesetPackages($changeset_packages); 466 + } 459 467 } 460 468 461 469 $tab_group = new PHUITabGroupView(); ··· 476 484 477 485 $filetree = id(new DifferentialFileTreeEngine()) 478 486 ->setViewer($viewer); 479 - 480 487 $filetree_collapsed = !$filetree->getIsVisible(); 481 488 482 489 // See PHI811. If the viewer has the file tree on, the files tab with the
+1
src/applications/differential/engine/DifferentialFileTreeEngine.php
··· 6 6 private $viewer; 7 7 private $changesets; 8 8 private $disabled; 9 + private $ownedChangesets; 9 10 10 11 public function setViewer($viewer) { 11 12 $this->viewer = $viewer;
+4 -1
src/applications/differential/mail/DifferentialInlineCommentMailView.php
··· 350 350 // comments on diffs with long recipient lists. 351 351 $cache_key = $changeset->getID(); 352 352 353 + $viewstate = new PhabricatorChangesetViewState(); 354 + 353 355 $parser = id(new DifferentialChangesetParser()) 354 356 ->setRenderCacheKey($cache_key) 355 - ->setUser($viewer) 357 + ->setViewer($viewer) 358 + ->setViewstate($viewstate) 356 359 ->setChangeset($changeset) 357 360 ->setOffsetMode($offset_mode) 358 361 ->setMarkupEngine($engine);
+52
src/applications/differential/storage/DifferentialChangeset.php
··· 22 22 private $hunks = self::ATTACHABLE; 23 23 private $diff = self::ATTACHABLE; 24 24 25 + private $authorityPackages; 26 + private $changesetPackages; 27 + 25 28 const TABLE_CACHE = 'differential_changeset_parse_cache'; 26 29 27 30 const METADATA_TRUSTED_ATTRIBUTES = 'attributes.trusted'; ··· 108 111 $this->hunks[] = $hunk; 109 112 $this->unsavedHunks[] = $hunk; 110 113 return $this; 114 + } 115 + 116 + public function setAuthorityPackages(array $authority_packages) { 117 + $this->authorityPackages = mpull($authority_packages, null, 'getPHID'); 118 + return $this; 119 + } 120 + 121 + public function getAuthorityPackages() { 122 + return $this->authorityPackages; 123 + } 124 + 125 + public function setChangesetPackages($changeset_packages) { 126 + $this->changesetPackages = mpull($changeset_packages, null, 'getPHID'); 127 + return $this; 128 + } 129 + 130 + public function getChangesetPackages() { 131 + return $this->changesetPackages; 111 132 } 112 133 113 134 public function save() { ··· 264 285 265 286 return id(new PHUIIconView()) 266 287 ->setIcon("{$icon} {$color}"); 288 + } 289 + 290 + public function getIsOwnedChangeset() { 291 + $authority_packages = $this->getAuthorityPackages(); 292 + $changeset_packages = $this->getChangesetPackages(); 293 + 294 + if (!$authority_packages || !$changeset_packages) { 295 + return false; 296 + } 297 + 298 + return (bool)array_intersect_key($authority_packages, $changeset_packages); 299 + } 300 + 301 + public function getIsLowImportanceChangeset() { 302 + $change_type = $this->getChangeType(); 303 + 304 + $change_map = array( 305 + DifferentialChangeType::TYPE_DELETE => true, 306 + DifferentialChangeType::TYPE_MOVE_AWAY => true, 307 + DifferentialChangeType::TYPE_MULTICOPY => true, 308 + ); 309 + 310 + if (isset($change_map[$change_type])) { 311 + return $change_map[$change_type]; 312 + } 313 + 314 + if ($this->isGeneratedChangeset()) { 315 + return true; 316 + } 317 + 318 + return false; 267 319 } 268 320 269 321 public function getPathIconIcon() {
+2
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 197 197 198 198 'pathIconIcon' => $changeset->getPathIconIcon(), 199 199 'pathIconColor' => $changeset->getPathIconColor(), 200 + 'isLowImportance' => $changeset->getIsLowImportanceChangeset(), 201 + 'isOwned' => $changeset->getIsOwnedChangeset(), 200 202 201 203 'editorURI' => $this->getEditorURI(), 202 204 'editorConfigureURI' => $this->getEditorConfigureURI(),
+15 -4
webroot/rsrc/css/application/diff/diff-tree-view.css
··· 10 10 height: 20px; 11 11 line-height: 20px; 12 12 color: {$greytext}; 13 + border-left: 4px solid transparent; 13 14 } 14 15 15 16 .diff-tree-path-indent { ··· 44 45 background: {$darkgreybackground}; 45 46 } 46 47 47 - .diff-tree-path-selected { 48 - background: {$yellow}; 49 - } 50 - 51 48 .device-desktop .diff-tree-path-changeset:hover { 52 49 background: {$lightblueborder}; 53 50 transition: 0.1s; 51 + } 52 + 53 + .diff-tree-view .diff-tree-path-changeset.diff-tree-path-selected { 54 + /* Rule is intentionally more specific than "hover". */ 55 + background: {$yellow}; 56 + } 57 + 58 + .diff-tree-path-low-importance .diff-tree-path-name { 59 + opacity: 0.5; 60 + } 61 + 62 + .diff-tree-path-owned { 63 + border-left-color: {$orange}; 64 + box-shadow: inset 2px 0 {$lightorange}; 54 65 } 55 66 56 67 .diff-tree-path-inlines {
+7 -1
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 37 37 38 38 this._pathIconIcon = data.pathIconIcon; 39 39 this._pathIconColor = data.pathIconColor; 40 + this._isLowImportance = data.isLowImportance; 41 + this._isOwned = data.isOwned; 40 42 41 43 this._inlines = []; 42 44 ··· 77 79 78 80 _pathIconIcon: null, 79 81 _pathIconColor: null, 82 + _isLowImportance: null, 83 + _isOwned: null, 80 84 81 85 getEditorURI: function() { 82 86 return this._editorURI; ··· 900 904 if (!this._pathView) { 901 905 var view = new JX.DiffPathView() 902 906 .setChangeset(this) 903 - .setPath(this._pathParts); 907 + .setPath(this._pathParts) 908 + .setIsLowImportance(this._isLowImportance) 909 + .setIsOwned(this._isOwned); 904 910 905 911 view.getIcon() 906 912 .setIcon(this._pathIconIcon)
+23
webroot/rsrc/js/application/diff/DiffPathView.js
··· 23 23 _inlineNode: null, 24 24 _isDirectory: false, 25 25 _displayPath: null, 26 + _isOwned: false, 27 + _isLowImportance: false, 26 28 27 29 getNode: function() { 28 30 if (!this._node) { ··· 115 117 116 118 var node = this.getNode(); 117 119 JX.DOM.alterClass(node, 'diff-tree-path-focused', this._focused); 120 + 121 + return this; 122 + }, 123 + 124 + setIsLowImportance: function(low_importance) { 125 + this._isLowImportance = low_importance; 126 + 127 + var node = this.getNode(); 128 + JX.DOM.alterClass( 129 + node, 130 + 'diff-tree-path-low-importance', 131 + this._isLowImportance); 132 + 133 + return this; 134 + }, 135 + 136 + setIsOwned: function(owned) { 137 + this._isOwned = owned; 138 + 139 + var node = this.getNode(); 140 + JX.DOM.alterClass(node, 'diff-tree-path-owned', this._isOwned); 118 141 119 142 return this; 120 143 },
+2 -1
webroot/rsrc/js/application/diff/DiffTreeView.js
··· 106 106 .setPath(tree.parts); 107 107 108 108 path.getIcon() 109 - .setIcon('fa-folder-open-o'); 109 + .setIcon('fa-folder-open-o') 110 + .setColor('grey'); 110 111 111 112 tree.pathObject = path; 112 113 }