@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 filetree for adds, moves, and deletes

Summary: See PHI356. Makes it easier to pick out change types in the filetree view in Differential.

Test Plan: Created a diff with adds, copies, moves, deletions, and binary files. Viewed in Differential, had an easier time picking stuff out.

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

+67 -6
+3 -3
resources/celerity/map.php
··· 12 12 'core.pkg.css' => 'ce8c2a58', 13 13 'core.pkg.js' => '4c79d74f', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 - 'differential.pkg.css' => '45951e9e', 15 + 'differential.pkg.css' => '1522c3ad', 16 16 'differential.pkg.js' => '19ee9979', 17 17 'diffusion.pkg.css' => 'a2d17c7d', 18 18 'diffusion.pkg.js' => '6134c5a1', ··· 121 121 'rsrc/css/font/font-awesome.css' => 'e838e088', 122 122 'rsrc/css/font/font-lato.css' => 'c7ccd872', 123 123 'rsrc/css/font/phui-font-icon-base.css' => '870a7360', 124 - 'rsrc/css/layout/phabricator-filetree-view.css' => 'fccf9f82', 124 + 'rsrc/css/layout/phabricator-filetree-view.css' => 'ea5b30a9', 125 125 'rsrc/css/layout/phabricator-source-code-view.css' => 'aea41829', 126 126 'rsrc/css/phui/button/phui-button-bar.css' => 'f1ff5494', 127 127 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68', ··· 784 784 'phabricator-favicon' => '1fe2510c', 785 785 'phabricator-feed-css' => 'ecd4ec57', 786 786 'phabricator-file-upload' => '680ea2c8', 787 - 'phabricator-filetree-view-css' => 'fccf9f82', 787 + 'phabricator-filetree-view-css' => 'ea5b30a9', 788 788 'phabricator-flag-css' => 'bba8f811', 789 789 'phabricator-keyboard-shortcut' => '1ae869f2', 790 790 'phabricator-keyboard-shortcut-manager' => 'c19dd9b9',
+45
src/applications/differential/storage/DifferentialChangeset.php
··· 221 221 return $this->assertAttached($this->diff); 222 222 } 223 223 224 + public function newFileTreeIcon() { 225 + $file_type = $this->getFileType(); 226 + $change_type = $this->getChangeType(); 227 + 228 + $change_icons = array( 229 + DifferentialChangeType::TYPE_DELETE => 'fa-file-o', 230 + ); 231 + 232 + if (isset($change_icons[$change_type])) { 233 + $icon = $change_icons[$change_type]; 234 + } else { 235 + $icon = DifferentialChangeType::getIconForFileType($file_type); 236 + } 237 + 238 + $change_colors = array( 239 + DifferentialChangeType::TYPE_ADD => 'green', 240 + DifferentialChangeType::TYPE_DELETE => 'red', 241 + DifferentialChangeType::TYPE_MOVE_AWAY => 'orange', 242 + DifferentialChangeType::TYPE_MOVE_HERE => 'orange', 243 + DifferentialChangeType::TYPE_COPY_HERE => 'orange', 244 + DifferentialChangeType::TYPE_MULTICOPY => 'orange', 245 + ); 246 + 247 + $color = idx($change_colors, $change_type, 'bluetext'); 248 + 249 + return id(new PHUIIconView()) 250 + ->setIcon($icon.' '.$color); 251 + } 252 + 253 + public function getFileTreeClass() { 254 + switch ($this->getChangeType()) { 255 + case DifferentialChangeType::TYPE_ADD: 256 + return 'filetree-added'; 257 + case DifferentialChangeType::TYPE_DELETE: 258 + return 'filetree-deleted'; 259 + case DifferentialChangeType::TYPE_MOVE_AWAY: 260 + case DifferentialChangeType::TYPE_MOVE_HERE: 261 + case DifferentialChangeType::TYPE_COPY_HERE: 262 + case DifferentialChangeType::TYPE_MULTICOPY: 263 + return 'filetree-movecopy'; 264 + } 265 + 266 + return null; 267 + } 268 + 224 269 225 270 /* -( PhabricatorPolicyInterface )----------------------------------------- */ 226 271
+7 -3
src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
··· 83 83 while (($path = $path->getNextNode())) { 84 84 $data = $path->getData(); 85 85 86 + $classes = array(); 87 + $classes[] = 'phabricator-filetree-item'; 88 + 86 89 $name = $path->getName(); 87 90 $style = 'padding-left: '.(2 + (3 * $path->getDepth())).'px'; 88 91 ··· 90 93 if ($data) { 91 94 $href = '#'.$data->getAnchorName(); 92 95 $title = $name; 93 - $icon = id(new PHUIIconView()) 94 - ->setIcon('fa-file-text-o bluetext'); 96 + 97 + $icon = $data->newFileTreeIcon(); 98 + $classes[] = $data->getFileTreeClass(); 95 99 } else { 96 100 $name .= '/'; 97 101 $title = $path->getFullPath().'/'; ··· 112 116 'href' => $href, 113 117 'style' => $style, 114 118 'title' => $title, 115 - 'class' => 'phabricator-filetree-item', 119 + 'class' => implode(' ', $classes), 116 120 ), 117 121 array($icon, $name_element)); 118 122 }
+12
webroot/rsrc/css/layout/phabricator-filetree-view.css
··· 54 54 background-color: {$hovergrey}; 55 55 border-left: 4px solid {$sky}; 56 56 } 57 + 58 + .phabricator-filetree .filetree-added { 59 + background: {$sh-greenbackground}; 60 + } 61 + 62 + .phabricator-filetree .filetree-deleted { 63 + background: {$sh-redbackground}; 64 + } 65 + 66 + .phabricator-filetree .filetree-movecopy { 67 + background: {$sh-orangebackground}; 68 + }