@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 inline comment counts to the filetree view

Summary: See PHI356. Adds inline comment and done counts to the filetree. Also makes the filetree wider by default.

Test Plan: Fiddled with filetrees in different browsers on different revisions. Added inlines, marked them done/undone.

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

+164 -49
+39 -39
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => 'e68cf1fa', 11 11 'conpherence.pkg.js' => '15191c65', 12 - 'core.pkg.css' => 'ce8c2a58', 13 - 'core.pkg.js' => '4c79d74f', 12 + 'core.pkg.css' => 'e4f098a5', 13 + 'core.pkg.js' => '3ac6e174', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 - 'differential.pkg.css' => '1522c3ad', 16 - 'differential.pkg.js' => '19ee9979', 15 + 'differential.pkg.css' => '113e692c', 16 + 'differential.pkg.js' => '5d53d5ce', 17 17 'diffusion.pkg.css' => 'a2d17c7d', 18 18 'diffusion.pkg.js' => '6134c5a1', 19 19 'favicon.ico' => '30672e08', ··· 31 31 'rsrc/css/aphront/multi-column.css' => '84cc6640', 32 32 'rsrc/css/aphront/notification.css' => '457861ec', 33 33 'rsrc/css/aphront/panel-view.css' => '8427b78d', 34 - 'rsrc/css/aphront/phabricator-nav-view.css' => 'faf6a6fc', 34 + 'rsrc/css/aphront/phabricator-nav-view.css' => '028126f6', 35 35 'rsrc/css/aphront/table-view.css' => '8c9bbafe', 36 36 'rsrc/css/aphront/tokenizer.css' => '15d5ff71', 37 37 'rsrc/css/aphront/tooltip.css' => '173b9431', ··· 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' => 'ea5b30a9', 124 + 'rsrc/css/layout/phabricator-filetree-view.css' => 'b912ad97', 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', ··· 395 395 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 396 396 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 397 397 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 398 - 'rsrc/js/application/diff/DiffChangeset.js' => '99abf4cd', 399 - 'rsrc/js/application/diff/DiffChangesetList.js' => '3b77efdd', 398 + 'rsrc/js/application/diff/DiffChangeset.js' => 'b49b59d6', 399 + 'rsrc/js/application/diff/DiffChangesetList.js' => '1f2e5265', 400 400 'rsrc/js/application/diff/DiffInline.js' => 'e83d28f3', 401 401 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 402 402 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', ··· 498 498 'rsrc/js/core/behavior-more.js' => 'a80d0378', 499 499 'rsrc/js/core/behavior-object-selector.js' => '77c1f0b0', 500 500 'rsrc/js/core/behavior-oncopy.js' => '2926fff2', 501 - 'rsrc/js/core/behavior-phabricator-nav.js' => '947753e0', 501 + 'rsrc/js/core/behavior-phabricator-nav.js' => '81144dfa', 502 502 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'acd29eee', 503 503 'rsrc/js/core/behavior-read-only-warning.js' => 'ba158207', 504 504 'rsrc/js/core/behavior-refresh-csrf.js' => 'ab2f381b', ··· 657 657 'javelin-behavior-phabricator-keyboard-pager' => 'a8da01f0', 658 658 'javelin-behavior-phabricator-keyboard-shortcuts' => '01fca1f0', 659 659 'javelin-behavior-phabricator-line-linker' => '1499a8cb', 660 - 'javelin-behavior-phabricator-nav' => '947753e0', 660 + 'javelin-behavior-phabricator-nav' => '81144dfa', 661 661 'javelin-behavior-phabricator-notification-example' => '8ce821c5', 662 662 'javelin-behavior-phabricator-object-selector' => '77c1f0b0', 663 663 'javelin-behavior-phabricator-oncopy' => '2926fff2', ··· 775 775 'phabricator-darklog' => 'c8e1ffe3', 776 776 'phabricator-darkmessage' => 'c48cccdd', 777 777 'phabricator-dashboard-css' => 'fe5b1869', 778 - 'phabricator-diff-changeset' => '99abf4cd', 779 - 'phabricator-diff-changeset-list' => '3b77efdd', 778 + 'phabricator-diff-changeset' => 'b49b59d6', 779 + 'phabricator-diff-changeset-list' => '1f2e5265', 780 780 'phabricator-diff-inline' => 'e83d28f3', 781 781 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 782 782 'phabricator-draggable-list' => 'bea6e7f4', ··· 784 784 'phabricator-favicon' => '1fe2510c', 785 785 'phabricator-feed-css' => 'ecd4ec57', 786 786 'phabricator-file-upload' => '680ea2c8', 787 - 'phabricator-filetree-view-css' => 'ea5b30a9', 787 + 'phabricator-filetree-view-css' => 'b912ad97', 788 788 'phabricator-flag-css' => 'bba8f811', 789 789 'phabricator-keyboard-shortcut' => '1ae869f2', 790 790 'phabricator-keyboard-shortcut-manager' => 'c19dd9b9', 791 791 'phabricator-main-menu-view' => '1802a242', 792 - 'phabricator-nav-view-css' => 'faf6a6fc', 792 + 'phabricator-nav-view-css' => '028126f6', 793 793 'phabricator-notification' => '008faf9c', 794 794 'phabricator-notification-css' => '457861ec', 795 795 'phabricator-notification-menu-css' => '10685bd4', ··· 1044 1044 'javelin-uri', 1045 1045 'javelin-routable', 1046 1046 ), 1047 + '1f2e5265' => array( 1048 + 'javelin-install', 1049 + 'phuix-button-view', 1050 + ), 1047 1051 '1f6794f6' => array( 1048 1052 'javelin-behavior', 1049 1053 'javelin-stratcom', ··· 1142 1146 'javelin-vector', 1143 1147 'javelin-dom', 1144 1148 'javelin-magical-init', 1145 - ), 1146 - '3b77efdd' => array( 1147 - 'javelin-install', 1148 - 'phuix-button-view', 1149 1149 ), 1150 1150 '3cb0b2fc' => array( 1151 1151 'javelin-behavior', ··· 1561 1561 '7f243deb' => array( 1562 1562 'javelin-install', 1563 1563 ), 1564 + '81144dfa' => array( 1565 + 'javelin-behavior', 1566 + 'javelin-behavior-device', 1567 + 'javelin-stratcom', 1568 + 'javelin-dom', 1569 + 'javelin-magical-init', 1570 + 'javelin-vector', 1571 + 'javelin-request', 1572 + 'javelin-util', 1573 + ), 1564 1574 '834a1173' => array( 1565 1575 'javelin-behavior', 1566 1576 'javelin-scrollbar', ··· 1648 1658 'javelin-workflow', 1649 1659 'javelin-dom', 1650 1660 ), 1651 - '947753e0' => array( 1652 - 'javelin-behavior', 1653 - 'javelin-behavior-device', 1654 - 'javelin-stratcom', 1655 - 'javelin-dom', 1656 - 'javelin-magical-init', 1657 - 'javelin-vector', 1658 - 'javelin-request', 1659 - 'javelin-util', 1660 - ), 1661 1661 '949c0fe5' => array( 1662 1662 'javelin-install', 1663 1663 ), ··· 1677 1677 'javelin-uri', 1678 1678 'javelin-mask', 1679 1679 'phabricator-drag-and-drop-file-upload', 1680 - ), 1681 - '99abf4cd' => array( 1682 - 'javelin-dom', 1683 - 'javelin-util', 1684 - 'javelin-stratcom', 1685 - 'javelin-install', 1686 - 'javelin-workflow', 1687 - 'javelin-router', 1688 - 'javelin-behavior-device', 1689 - 'javelin-vector', 1690 - 'phabricator-diff-inline', 1691 1680 ), 1692 1681 '9a6dd75c' => array( 1693 1682 'javelin-behavior', ··· 1836 1825 ), 1837 1826 'b3e7d692' => array( 1838 1827 'javelin-install', 1828 + ), 1829 + 'b49b59d6' => array( 1830 + 'javelin-dom', 1831 + 'javelin-util', 1832 + 'javelin-stratcom', 1833 + 'javelin-install', 1834 + 'javelin-workflow', 1835 + 'javelin-router', 1836 + 'javelin-behavior-device', 1837 + 'javelin-vector', 1838 + 'phabricator-diff-inline', 1839 1839 ), 1840 1840 'b59e1e96' => array( 1841 1841 'javelin-behavior',
+1
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 206 206 'displayPath' => hsprintf('%s', $display_parts), 207 207 'path' => $display_filename, 208 208 'icon' => $display_icon, 209 + 'treeNodeID' => 'tree-node-'.$changeset->getAnchorName(), 209 210 ), 210 211 'class' => $class, 211 212 'id' => $id,
+11 -1
src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
··· 96 96 97 97 $icon = $data->newFileTreeIcon(); 98 98 $classes[] = $data->getFileTreeClass(); 99 + 100 + $count = phutil_tag( 101 + 'span', 102 + array( 103 + 'class' => 'filetree-progress-hint', 104 + 'id' => 'tree-node-'.$data->getAnchorName(), 105 + )); 99 106 } else { 100 107 $name .= '/'; 101 108 $title = $path->getFullPath().'/'; 102 109 $icon = id(new PHUIIconView()) 103 110 ->setIcon('fa-folder-open blue'); 111 + 112 + $count = null; 104 113 } 105 114 106 115 $name_element = phutil_tag( ··· 110 119 ), 111 120 $name); 112 121 122 + 113 123 $filetree[] = javelin_tag( 114 124 $href ? 'a' : 'span', 115 125 array( ··· 118 128 'title' => $title, 119 129 'class' => implode(' ', $classes), 120 130 ), 121 - array($icon, $name_element)); 131 + array($count, $icon, $name_element)); 122 132 } 123 133 $tree->destroy(); 124 134
+3 -3
webroot/rsrc/css/aphront/phabricator-nav-view.css
··· 44 44 position: fixed; 45 45 top: 0; 46 46 bottom: 0; 47 - left: 205px; 47 + left: 410px; 48 48 width: 7px; 49 49 50 50 cursor: col-resize; ··· 66 66 67 67 .device-desktop .phabricator-standard-page-body .has-drag-nav 68 68 .phabricator-nav-content { 69 - margin-left: 212px; 69 + margin-left: 417px; 70 70 } 71 71 72 72 .device-desktop .phabricator-standard-page-body .has-drag-nav ··· 81 81 } 82 82 83 83 .device-desktop .phui-navigation-shell .has-drag-nav .phabricator-nav-local { 84 - width: 205px; 84 + width: 410px; 85 85 padding: 0; 86 86 background: transparent; 87 87 }
+28 -5
webroot/rsrc/css/layout/phabricator-filetree-view.css
··· 50 50 background-color: {$hovergrey}; 51 51 } 52 52 53 - .phabricator-filetree .phabricator-active-nav-focus { 54 - background-color: {$hovergrey}; 55 - border-left: 4px solid {$sky}; 56 - } 57 - 58 53 .phabricator-filetree .filetree-added { 59 54 background: {$sh-greenbackground}; 60 55 } ··· 66 61 .phabricator-filetree .filetree-movecopy { 67 62 background: {$sh-orangebackground}; 68 63 } 64 + 65 + .phabricator-filetree .phabricator-active-nav-focus { 66 + background-color: {$hovergrey}; 67 + border-left: 4px solid {$sky}; 68 + } 69 + 70 + .phabricator-filetree .filetree-progress-hint { 71 + width: 24px; 72 + margin-right: 6px; 73 + display: inline-block; 74 + padding: 0 4px; 75 + border-radius: 4px; 76 + font-size: smaller; 77 + background: {$greybackground}; 78 + text-align: center; 79 + opacity: 0.5; 80 + } 81 + 82 + .phabricator-filetree .filetree-comments-visible { 83 + background: {$lightblue}; 84 + opacity: 0.75; 85 + color: {$darkgreytext}; 86 + } 87 + 88 + .phabricator-filetree .filetree-comments-completed { 89 + background: {$darkgreybackground}; 90 + color: {$greytext}; 91 + }
+73 -1
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 27 27 this._highlight = data.highlight; 28 28 this._encoding = data.encoding; 29 29 this._loaded = data.loaded; 30 + this._treeNodeID = data.treeNodeID; 30 31 31 32 this._leftID = data.left; 32 33 this._rightID = data.right; ··· 62 63 63 64 _changesetList: null, 64 65 _icon: null, 66 + _treeNodeID: null, 65 67 66 68 getLeftChangesetID: function() { 67 69 return this._leftID; ··· 737 739 738 740 _rebuildAllInlines: function() { 739 741 var rows = JX.DOM.scry(this._node, 'tr'); 740 - for (var ii = 0; ii < rows.length; ii++) { 742 + var ii; 743 + for (ii = 0; ii < rows.length; ii++) { 741 744 var row = rows[ii]; 742 745 if (this._getRowType(row) != 'comment') { 743 746 continue; ··· 747 750 // them to this Changeset's list of inlines. 748 751 this.getInlineForRow(row); 749 752 } 753 + }, 754 + 755 + redrawFileTree: function() { 756 + var tree; 757 + try { 758 + tree = JX.$(this._treeNodeID); 759 + } catch (e) { 760 + return; 761 + } 762 + 763 + var inlines = this._inlines; 764 + var done = []; 765 + var undone = []; 766 + var inline; 767 + 768 + for (var ii = 0; ii < inlines.length; ii++) { 769 + inline = inlines[ii]; 770 + 771 + if (inline.isDeleted()) { 772 + continue; 773 + } 774 + 775 + if (inline.isSynthetic()) { 776 + continue; 777 + } 778 + 779 + if (inline.isEditing()) { 780 + continue; 781 + } 782 + 783 + if (!inline.getID()) { 784 + // These are new comments which have been cancelled, and do not 785 + // count as anything. 786 + continue; 787 + } 788 + 789 + if (inline.isDraft()) { 790 + continue; 791 + } 792 + 793 + if (!inline.isDone()) { 794 + undone.push(inline); 795 + } else { 796 + done.push(inline); 797 + } 798 + } 799 + 800 + var total = done.length + undone.length; 801 + 802 + var hint; 803 + var is_visible; 804 + var is_completed; 805 + if (total) { 806 + if (done.length) { 807 + hint = [done.length, '/', total]; 808 + } else { 809 + hint = total; 810 + } 811 + is_visible = true; 812 + is_completed = (done.length == total); 813 + } else { 814 + hint = '-'; 815 + is_visible = false; 816 + is_completed = false; 817 + } 818 + 819 + JX.DOM.setContent(tree, hint); 820 + JX.DOM.alterClass(tree, 'filetree-comments-visible', is_visible); 821 + JX.DOM.alterClass(tree, 'filetree-comments-completed', is_completed); 750 822 }, 751 823 752 824 toggleVisibility: function() {
+5
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 915 915 this._bannerChangeset = null; 916 916 917 917 this._redrawBanner(); 918 + 919 + var changesets = this._changesets; 920 + for (var ii = 0; ii < changesets.length; ii++) { 921 + changesets[ii].redrawFileTree(); 922 + } 918 923 }, 919 924 920 925 _onscroll: function() {
+4
webroot/rsrc/js/core/behavior-phabricator-nav.js
··· 28 28 JX.enableDispatch(document.body, 'mousemove'); 29 29 30 30 JX.DOM.listen(drag, 'mousedown', null, function(e) { 31 + if (!e.isNormalMouseEvent()) { 32 + return; 33 + } 34 + 31 35 dragging = JX.$V(e); 32 36 33 37 // Show the "col-resize" cursor on the whole document while we're