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

Remove hidden zero-width spaces affecting copy behavior

Summary:
Ref T13161. Ref T12822. Today, we use invisible Zero-Width Spaces to try to improve copy/paste behavior from Differential.

After D20188, we no longer need ZWS characters to avoid copying line numbers. Get rid of these secret invisible semantic ZWS characters completely.

This means that both the left-hand and right-hand side of diffs become copyable, which isn't desired. I'll fix that with a hundred thousand lines of Javascript in the next change: this is a step toward everything working better, but doesn't fix everything yet.

Test Plan:
- Grepped for `zws`, `grep -i zero | grep -i width`.
- Copied text out of Differential: got both sides of the diff (not ideal).

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13161, T12822

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

+16 -34
+15 -15
resources/celerity/map.php
··· 11 11 'conpherence.pkg.js' => '020aebcf', 12 12 'core.pkg.css' => '261ee8cf', 13 13 'core.pkg.js' => '5ace8a1e', 14 - 'differential.pkg.css' => '801c5653', 15 - 'differential.pkg.js' => '1f211736', 14 + 'differential.pkg.css' => 'fcc82bc0', 15 + 'differential.pkg.js' => '0e2b0e2c', 16 16 'diffusion.pkg.css' => '42c75c37', 17 17 'diffusion.pkg.js' => '91192d85', 18 18 'maniphest.pkg.css' => '35995d6d', ··· 61 61 'rsrc/css/application/dashboard/dashboard.css' => '4267d6c6', 62 62 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 63 63 'rsrc/css/application/differential/add-comment.css' => '7e5900d9', 64 - 'rsrc/css/application/differential/changeset-view.css' => '8a997ed9', 64 + 'rsrc/css/application/differential/changeset-view.css' => '58236820', 65 65 'rsrc/css/application/differential/core.css' => 'bdb93065', 66 66 'rsrc/css/application/differential/phui-inline-comment.css' => '48acce5b', 67 67 'rsrc/css/application/differential/revision-comment.css' => '7dbc8d1d', ··· 420 420 'rsrc/js/application/releeph/releeph-preview-branch.js' => '75184d68', 421 421 'rsrc/js/application/releeph/releeph-request-state-change.js' => '9f081f05', 422 422 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'aa3a100c', 423 - 'rsrc/js/application/repository/repository-crossreference.js' => 'db0c0214', 423 + 'rsrc/js/application/repository/repository-crossreference.js' => 'c15122b4', 424 424 'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e5bdb730', 425 425 'rsrc/js/application/search/behavior-reorder-queries.js' => 'b86f297f', 426 426 'rsrc/js/application/transactions/behavior-comment-actions.js' => '4dffaeb2', ··· 541 541 'conpherence-thread-manager' => 'aec8e38c', 542 542 'conpherence-transaction-css' => '3a3f5e7e', 543 543 'd3' => 'd67475f5', 544 - 'differential-changeset-view-css' => '8a997ed9', 544 + 'differential-changeset-view-css' => '58236820', 545 545 'differential-core-view-css' => 'bdb93065', 546 546 'differential-revision-add-comment-css' => '7e5900d9', 547 547 'differential-revision-comment-css' => '7dbc8d1d', ··· 671 671 'javelin-behavior-reorder-applications' => 'aa371860', 672 672 'javelin-behavior-reorder-columns' => '8ac32fd9', 673 673 'javelin-behavior-reorder-profile-menu-items' => 'e5bdb730', 674 - 'javelin-behavior-repository-crossreference' => 'db0c0214', 674 + 'javelin-behavior-repository-crossreference' => 'c15122b4', 675 675 'javelin-behavior-scrollbar' => '92388bae', 676 676 'javelin-behavior-search-reorder-queries' => 'b86f297f', 677 677 'javelin-behavior-select-content' => 'e8240b50', ··· 1379 1379 'javelin-stratcom', 1380 1380 'javelin-vector', 1381 1381 'javelin-typeahead-static-source', 1382 + ), 1383 + 58236820 => array( 1384 + 'phui-inline-comment-view-css', 1382 1385 ), 1383 1386 '5902260c' => array( 1384 1387 'javelin-util', ··· 1587 1590 '8a16f91b' => array( 1588 1591 'syntax-default-css', 1589 1592 ), 1590 - '8a997ed9' => array( 1591 - 'phui-inline-comment-view-css', 1592 - ), 1593 1593 '8ac32fd9' => array( 1594 1594 'javelin-behavior', 1595 1595 'javelin-stratcom', ··· 1912 1912 'c03f2fb4' => array( 1913 1913 'javelin-install', 1914 1914 ), 1915 + 'c15122b4' => array( 1916 + 'javelin-behavior', 1917 + 'javelin-dom', 1918 + 'javelin-stratcom', 1919 + 'javelin-uri', 1920 + ), 1915 1921 'c2c500a7' => array( 1916 1922 'javelin-install', 1917 1923 'javelin-dom', ··· 2007 2013 'javelin-behavior', 2008 2014 'javelin-uri', 2009 2015 'phabricator-notification', 2010 - ), 2011 - 'db0c0214' => array( 2012 - 'javelin-behavior', 2013 - 'javelin-dom', 2014 - 'javelin-stratcom', 2015 - 'javelin-uri', 2016 2016 ), 2017 2017 'dfa1d313' => array( 2018 2018 'javelin-behavior',
+1 -9
src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
··· 301 301 } 302 302 } 303 303 304 - // NOTE: This is a unicode zero-width space, which we use as a hint when 305 - // intercepting 'copy' events to make sure sensible text ends up on the 306 - // clipboard. See the 'phabricator-oncopy' behavior. 307 - $zero_space = "\xE2\x80\x8B"; 308 - 309 304 $old_number = phutil_tag( 310 305 'td', 311 306 array( ··· 330 325 phutil_tag( 331 326 'td', 332 327 array('class' => $n_classes, 'colspan' => $n_colspan), 333 - array( 334 - phutil_tag('span', array('class' => 'zwsp'), $zero_space), 335 - $n_text, 336 - )), 328 + $n_text), 337 329 $n_cov, 338 330 )); 339 331
-5
webroot/rsrc/css/application/differential/changeset-view.css
··· 67 67 padding: 1px 4px; 68 68 } 69 69 70 - .differential-diff td .zwsp { 71 - position: absolute; 72 - width: 0; 73 - } 74 - 75 70 .prose-diff { 76 71 padding: 12px 0; 77 72 white-space: pre-wrap;
-5
webroot/rsrc/js/application/repository/repository-crossreference.js
··· 237 237 } 238 238 239 239 var content = '' + node.textContent; 240 - 241 - // Strip off any ZWS characters. These are marker characters used to 242 - // improve copy/paste behavior. 243 - content = content.replace(/\u200B/g, ''); 244 - 245 240 char += content.length; 246 241 } 247 242