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

Make inline reticle code more general and robust

Summary:
Ref T2009. Currently, the code which draws the reticle is sort of implicitly hard-coded with some of the rules for the 2up view.

Instead, use general rules:

- Start selection at the next `<td />`.
- End selection at the rightmost adjacent `<td />`.

These rules work in all cases.

Test Plan:
- Activated reticle in 1up and 2up views by clicking line numbers and hovering over comments. It now draws correctly.
- Dragged over line ranges in 1up and 2up views, saw accurate reticle.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T2009

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

+38 -21
+14 -14
resources/celerity/map.php
··· 10 10 'core.pkg.css' => '6408f2d3', 11 11 'core.pkg.js' => '5a1c336d', 12 12 'darkconsole.pkg.js' => '8ab24e01', 13 - 'differential.pkg.css' => '6641cdd5', 14 - 'differential.pkg.js' => '3fab5259', 13 + 'differential.pkg.css' => 'df94a9e2', 14 + 'differential.pkg.js' => 'f458a7dc', 15 15 'diffusion.pkg.css' => '591664fa', 16 16 'diffusion.pkg.js' => 'bfc0737b', 17 17 'maniphest.pkg.css' => '68d4dd3d', ··· 55 55 'rsrc/css/application/dashboard/dashboard.css' => '17937d22', 56 56 'rsrc/css/application/diff/inline-comment-summary.css' => 'eb5f8e8c', 57 57 'rsrc/css/application/differential/add-comment.css' => 'c478bcaa', 58 - 'rsrc/css/application/differential/changeset-view.css' => 'bad09138', 58 + 'rsrc/css/application/differential/changeset-view.css' => '88100552', 59 59 'rsrc/css/application/differential/core.css' => '7ac3cabc', 60 60 'rsrc/css/application/differential/results-table.css' => '181aa9d9', 61 61 'rsrc/css/application/differential/revision-comment.css' => '48186045', ··· 367 367 'rsrc/js/application/differential/behavior-comment-preview.js' => '6932def3', 368 368 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 369 369 'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb', 370 - 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => 'ae8e9b44', 370 + 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '33d4c5e2', 371 371 'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492', 372 372 'rsrc/js/application/differential/behavior-populate.js' => '8694b1df', 373 373 'rsrc/js/application/differential/behavior-show-field-details.js' => 'bba9eedf', ··· 518 518 'conpherence-notification-css' => '04a6e10a', 519 519 'conpherence-update-css' => '1099a660', 520 520 'conpherence-widget-pane-css' => '3d575438', 521 - 'differential-changeset-view-css' => 'bad09138', 521 + 'differential-changeset-view-css' => '88100552', 522 522 'differential-core-view-css' => '7ac3cabc', 523 523 'differential-inline-comment-editor' => '41060c54', 524 524 'differential-results-table-css' => '181aa9d9', ··· 569 569 'javelin-behavior-differential-comment-jump' => '4fdb476d', 570 570 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 571 571 'javelin-behavior-differential-dropdown-menus' => '2035b9cb', 572 - 'javelin-behavior-differential-edit-inline-comments' => 'ae8e9b44', 572 + 'javelin-behavior-differential-edit-inline-comments' => '33d4c5e2', 573 573 'javelin-behavior-differential-feedback-preview' => '6932def3', 574 574 'javelin-behavior-differential-keyboard-navigation' => '2c426492', 575 575 'javelin-behavior-differential-populate' => '8694b1df', ··· 1027 1027 '331b1611' => array( 1028 1028 'javelin-install', 1029 1029 ), 1030 + '33d4c5e2' => array( 1031 + 'javelin-behavior', 1032 + 'javelin-stratcom', 1033 + 'javelin-dom', 1034 + 'javelin-util', 1035 + 'javelin-vector', 1036 + 'differential-inline-comment-editor', 1037 + ), 1030 1038 '3ab51e2c' => array( 1031 1039 'javelin-behavior', 1032 1040 'javelin-behavior-device', ··· 1644 1652 'javelin-dom', 1645 1653 'javelin-util', 1646 1654 'phabricator-prefab', 1647 - ), 1648 - 'ae8e9b44' => array( 1649 - 'javelin-behavior', 1650 - 'javelin-stratcom', 1651 - 'javelin-dom', 1652 - 'javelin-util', 1653 - 'javelin-vector', 1654 - 'differential-inline-comment-editor', 1655 1655 ), 1656 1656 'b1f0ccee' => array( 1657 1657 'javelin-install',
+1
webroot/rsrc/css/application/differential/changeset-view.css
··· 268 268 opacity: 0.5; 269 269 top: 0px; 270 270 left: 0px; 271 + box-sizing: border-box; 271 272 } 272 273 273 274 .differential-inline-comment,
+23 -7
webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
··· 31 31 top = bot; 32 32 bot = tmp; 33 33 } 34 - var code = target.nextSibling; 35 34 36 - var pos = JX.$V(top) 37 - .add(JX.Vector.getAggregateScrollForNode(top)) 38 - .add(1 + JX.Vector.getDim(target).x, 0); 39 - var dim = JX.Vector.getDim(code).add(-4, 0); 40 - if (isOnRight(target)) { 41 - dim.x += JX.Vector.getDim(code.nextSibling).x; 35 + // Find the leftmost cell that we're going to highlight: this is the next 36 + // <td /> in the row. In 2up views, it should be directly adjacent. In 37 + // 1up views, we may have to skip over the other line number column. 38 + var l = top; 39 + while (JX.DOM.isType(l, 'th')) { 40 + l = l.nextSibling; 42 41 } 42 + 43 + // Find the rightmost cell that we're going to highlight: this is the 44 + // farthest consecutive, adjacent <td /> in the row. Sometimes the left 45 + // and right nodes are the same (left side of 2up view); sometimes we're 46 + // going to highlight several nodes (copy + code + coverage). 47 + var r = l; 48 + while (r.nextSibling && JX.DOM.isType(r.nextSibling, 'td')) { 49 + r = r.nextSibling; 50 + } 51 + 52 + var pos = JX.$V(l) 53 + .add(JX.Vector.getAggregateScrollForNode(l)); 54 + 55 + var dim = JX.$V(r) 56 + .add(JX.Vector.getAggregateScrollForNode(r)) 57 + .add(-pos.x, -pos.y) 58 + .add(JX.Vector.getDim(r)); 43 59 44 60 var bpos = JX.$V(bot) 45 61 .add(JX.Vector.getAggregateScrollForNode(bot));