diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -12,7 +12,7 @@ 'core.pkg.css' => 'dd5f04a3', 'core.pkg.js' => '544bc792', 'differential.pkg.css' => 'cb99cd21', - 'differential.pkg.js' => 'b1ef535d', + 'differential.pkg.js' => '6c315e3f', 'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.js' => 'a98c0bf7', 'maniphest.pkg.css' => '35995d6d', @@ -59,7 +59,7 @@ 'rsrc/css/application/countdown/timer.css' => 'bff8012f', 'rsrc/css/application/daemon/bulk-job.css' => '73af99f5', 'rsrc/css/application/dashboard/dashboard.css' => '5a205b9d', - 'rsrc/css/application/diff/diff-tree-view.css' => 'bd83417c', + 'rsrc/css/application/diff/diff-tree-view.css' => '26fb4a0d', 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 'rsrc/css/application/differential/add-comment.css' => '7e5900d9', 'rsrc/css/application/differential/changeset-view.css' => '489b6995', @@ -378,11 +378,11 @@ 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => 'a2ab19be', 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', - 'rsrc/js/application/diff/DiffChangeset.js' => 'd089ffb1', + 'rsrc/js/application/diff/DiffChangeset.js' => 'a1a5dc46', 'rsrc/js/application/diff/DiffChangesetList.js' => '57035863', 'rsrc/js/application/diff/DiffInline.js' => '16e97ebc', - 'rsrc/js/application/diff/DiffPathView.js' => '5f70ad12', - 'rsrc/js/application/diff/DiffTreeView.js' => 'ccf691f3', + 'rsrc/js/application/diff/DiffPathView.js' => 'ceb66010', + 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 'rsrc/js/application/diff/behavior-preview-link.js' => 'f51e9c17', 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', 'rsrc/js/application/differential/behavior-populate.js' => 'b86ef6c2', @@ -558,7 +558,7 @@ 'conpherence-thread-manager' => 'aec8e38c', 'conpherence-transaction-css' => '3a3f5e7e', 'd3' => '9d068042', - 'diff-tree-view-css' => 'bd83417c', + 'diff-tree-view-css' => '26fb4a0d', 'differential-changeset-view-css' => '489b6995', 'differential-core-view-css' => '7300a73e', 'differential-revision-add-comment-css' => '7e5900d9', @@ -775,11 +775,11 @@ 'phabricator-darklog' => '3b869402', 'phabricator-darkmessage' => '26cd4b73', 'phabricator-dashboard-css' => '5a205b9d', - 'phabricator-diff-changeset' => 'd089ffb1', + 'phabricator-diff-changeset' => 'a1a5dc46', 'phabricator-diff-changeset-list' => '57035863', 'phabricator-diff-inline' => '16e97ebc', - 'phabricator-diff-path-view' => '5f70ad12', - 'phabricator-diff-tree-view' => 'ccf691f3', + 'phabricator-diff-path-view' => 'ceb66010', + 'phabricator-diff-tree-view' => '5d83623b', 'phabricator-drag-and-drop-file-upload' => '4370900d', 'phabricator-draggable-list' => '0169e425', 'phabricator-fatal-config-template-css' => '20babf50', @@ -1505,7 +1505,7 @@ 'javelin-dom', 'phuix-dropdown-menu', ), - '5f70ad12' => array( + '5d83623b' => array( 'javelin-dom', ), '5faf27b9' => array( @@ -1829,6 +1829,18 @@ 'javelin-dom', 'javelin-workflow', ), + 'a1a5dc46' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + 'javelin-workflow', + 'javelin-router', + 'javelin-behavior-device', + 'javelin-vector', + 'phabricator-diff-inline', + 'phabricator-diff-path-view', + ), 'a241536a' => array( 'javelin-install', ), @@ -2067,7 +2079,7 @@ 'phuix-icon-view', 'phabricator-busy', ), - 'ccf691f3' => array( + 'ceb66010' => array( 'javelin-dom', ), 'cef53b3e' => array( @@ -2081,18 +2093,6 @@ 'javelin-dom', 'javelin-stratcom', ), - 'd089ffb1' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-workflow', - 'javelin-router', - 'javelin-behavior-device', - 'javelin-vector', - 'phabricator-diff-inline', - 'phabricator-diff-path-view', - ), 'd12d214f' => array( 'javelin-install', 'javelin-dom', diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -384,7 +384,6 @@ ->setTitle(pht('Diff %s', $target->getID())) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY); - $revision_id = $revision->getID(); $inline_list_uri = "/revision/inlines/{$revision_id}/"; $inline_list_uri = $this->getApplicationURI($inline_list_uri); @@ -456,6 +455,15 @@ $reviewer_changesets = $this->getPackageChangesets($reviewer_phid); $reviewer->attachChangesets($reviewer_changesets); } + + $authority_packages = $this->getAuthorityPackages(); + foreach ($changesets as $changeset) { + $changeset_packages = $this->getChangesetPackages($changeset); + + $changeset + ->setAuthorityPackages($authority_packages) + ->setChangesetPackages($changeset_packages); + } } $tab_group = new PHUITabGroupView(); @@ -476,7 +484,6 @@ $filetree = id(new DifferentialFileTreeEngine()) ->setViewer($viewer); - $filetree_collapsed = !$filetree->getIsVisible(); // See PHI811. If the viewer has the file tree on, the files tab with the diff --git a/src/applications/differential/engine/DifferentialFileTreeEngine.php b/src/applications/differential/engine/DifferentialFileTreeEngine.php --- a/src/applications/differential/engine/DifferentialFileTreeEngine.php +++ b/src/applications/differential/engine/DifferentialFileTreeEngine.php @@ -6,6 +6,7 @@ private $viewer; private $changesets; private $disabled; + private $ownedChangesets; public function setViewer($viewer) { $this->viewer = $viewer; diff --git a/src/applications/differential/mail/DifferentialInlineCommentMailView.php b/src/applications/differential/mail/DifferentialInlineCommentMailView.php --- a/src/applications/differential/mail/DifferentialInlineCommentMailView.php +++ b/src/applications/differential/mail/DifferentialInlineCommentMailView.php @@ -350,9 +350,12 @@ // comments on diffs with long recipient lists. $cache_key = $changeset->getID(); + $viewstate = new PhabricatorChangesetViewState(); + $parser = id(new DifferentialChangesetParser()) ->setRenderCacheKey($cache_key) - ->setUser($viewer) + ->setViewer($viewer) + ->setViewstate($viewstate) ->setChangeset($changeset) ->setOffsetMode($offset_mode) ->setMarkupEngine($engine); diff --git a/src/applications/differential/storage/DifferentialChangeset.php b/src/applications/differential/storage/DifferentialChangeset.php --- a/src/applications/differential/storage/DifferentialChangeset.php +++ b/src/applications/differential/storage/DifferentialChangeset.php @@ -22,6 +22,9 @@ private $hunks = self::ATTACHABLE; private $diff = self::ATTACHABLE; + private $authorityPackages; + private $changesetPackages; + const TABLE_CACHE = 'differential_changeset_parse_cache'; const METADATA_TRUSTED_ATTRIBUTES = 'attributes.trusted'; @@ -110,6 +113,24 @@ return $this; } + public function setAuthorityPackages(array $authority_packages) { + $this->authorityPackages = mpull($authority_packages, null, 'getPHID'); + return $this; + } + + public function getAuthorityPackages() { + return $this->authorityPackages; + } + + public function setChangesetPackages($changeset_packages) { + $this->changesetPackages = mpull($changeset_packages, null, 'getPHID'); + return $this; + } + + public function getChangesetPackages() { + return $this->changesetPackages; + } + public function save() { $this->openTransaction(); $ret = parent::save(); @@ -266,6 +287,37 @@ ->setIcon("{$icon} {$color}"); } + public function getIsOwnedChangeset() { + $authority_packages = $this->getAuthorityPackages(); + $changeset_packages = $this->getChangesetPackages(); + + if (!$authority_packages || !$changeset_packages) { + return false; + } + + return (bool)array_intersect_key($authority_packages, $changeset_packages); + } + + public function getIsLowImportanceChangeset() { + $change_type = $this->getChangeType(); + + $change_map = array( + DifferentialChangeType::TYPE_DELETE => true, + DifferentialChangeType::TYPE_MOVE_AWAY => true, + DifferentialChangeType::TYPE_MULTICOPY => true, + ); + + if (isset($change_map[$change_type])) { + return $change_map[$change_type]; + } + + if ($this->isGeneratedChangeset()) { + return true; + } + + return false; + } + public function getPathIconIcon() { return idx($this->getPathIconDetails(), 'icon'); } diff --git a/src/applications/differential/view/DifferentialChangesetDetailView.php b/src/applications/differential/view/DifferentialChangesetDetailView.php --- a/src/applications/differential/view/DifferentialChangesetDetailView.php +++ b/src/applications/differential/view/DifferentialChangesetDetailView.php @@ -197,6 +197,8 @@ 'pathIconIcon' => $changeset->getPathIconIcon(), 'pathIconColor' => $changeset->getPathIconColor(), + 'isLowImportance' => $changeset->getIsLowImportanceChangeset(), + 'isOwned' => $changeset->getIsOwnedChangeset(), 'editorURI' => $this->getEditorURI(), 'editorConfigureURI' => $this->getEditorConfigureURI(), diff --git a/webroot/rsrc/css/application/diff/diff-tree-view.css b/webroot/rsrc/css/application/diff/diff-tree-view.css --- a/webroot/rsrc/css/application/diff/diff-tree-view.css +++ b/webroot/rsrc/css/application/diff/diff-tree-view.css @@ -10,6 +10,7 @@ height: 20px; line-height: 20px; color: {$greytext}; + border-left: 4px solid transparent; } .diff-tree-path-indent { @@ -44,15 +45,25 @@ background: {$darkgreybackground}; } -.diff-tree-path-selected { - background: {$yellow}; -} - .device-desktop .diff-tree-path-changeset:hover { background: {$lightblueborder}; transition: 0.1s; } +.diff-tree-view .diff-tree-path-changeset.diff-tree-path-selected { + /* Rule is intentionally more specific than "hover". */ + background: {$yellow}; +} + +.diff-tree-path-low-importance .diff-tree-path-name { + opacity: 0.5; +} + +.diff-tree-path-owned { + border-left-color: {$orange}; + box-shadow: inset 2px 0 {$lightorange}; +} + .diff-tree-path-inlines { display: none; position: absolute; diff --git a/webroot/rsrc/js/application/diff/DiffChangeset.js b/webroot/rsrc/js/application/diff/DiffChangeset.js --- a/webroot/rsrc/js/application/diff/DiffChangeset.js +++ b/webroot/rsrc/js/application/diff/DiffChangeset.js @@ -37,6 +37,8 @@ this._pathIconIcon = data.pathIconIcon; this._pathIconColor = data.pathIconColor; + this._isLowImportance = data.isLowImportance; + this._isOwned = data.isOwned; this._inlines = []; @@ -77,6 +79,8 @@ _pathIconIcon: null, _pathIconColor: null, + _isLowImportance: null, + _isOwned: null, getEditorURI: function() { return this._editorURI; @@ -900,7 +904,9 @@ if (!this._pathView) { var view = new JX.DiffPathView() .setChangeset(this) - .setPath(this._pathParts); + .setPath(this._pathParts) + .setIsLowImportance(this._isLowImportance) + .setIsOwned(this._isOwned); view.getIcon() .setIcon(this._pathIconIcon) diff --git a/webroot/rsrc/js/application/diff/DiffPathView.js b/webroot/rsrc/js/application/diff/DiffPathView.js --- a/webroot/rsrc/js/application/diff/DiffPathView.js +++ b/webroot/rsrc/js/application/diff/DiffPathView.js @@ -23,6 +23,8 @@ _inlineNode: null, _isDirectory: false, _displayPath: null, + _isOwned: false, + _isLowImportance: false, getNode: function() { if (!this._node) { @@ -119,6 +121,27 @@ return this; }, + setIsLowImportance: function(low_importance) { + this._isLowImportance = low_importance; + + var node = this.getNode(); + JX.DOM.alterClass( + node, + 'diff-tree-path-low-importance', + this._isLowImportance); + + return this; + }, + + setIsOwned: function(owned) { + this._isOwned = owned; + + var node = this.getNode(); + JX.DOM.alterClass(node, 'diff-tree-path-owned', this._isOwned); + + return this; + }, + _onclick: function(e) { if (!e.isNormalClick()) { return; diff --git a/webroot/rsrc/js/application/diff/DiffTreeView.js b/webroot/rsrc/js/application/diff/DiffTreeView.js --- a/webroot/rsrc/js/application/diff/DiffTreeView.js +++ b/webroot/rsrc/js/application/diff/DiffTreeView.js @@ -106,7 +106,8 @@ .setPath(tree.parts); path.getIcon() - .setIcon('fa-folder-open-o'); + .setIcon('fa-folder-open-o') + .setColor('grey'); tree.pathObject = path; }