@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 Copy file path button to file header bar in Differential/Diffusion

Summary:
When looking at a commit/revision, allow to copy the path of a file to the clipboard, so you can quickly open that file in your local code checkout from the command line.

Closes T15897

Test Plan:
Open a proposed commit in Differential or a merged commit in Diffusion. Click the "Copy file path" button, paste that clipboard content.
Change the width of the viewport and see that the button is not rendered when in phone mode.
Run `./bin/celerity map` again and no changes.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15897

Differential Revision: https://we.phorge.it/D25757

+43 -9
+6 -6
resources/celerity/map.php
··· 12 12 'core.pkg.css' => 'ac619266', 13 13 'core.pkg.js' => '2eeda9e0', 14 14 'dark-console.pkg.js' => '187792c2', 15 - 'differential.pkg.css' => '6d3700f0', 15 + 'differential.pkg.css' => 'fda9518d', 16 16 'differential.pkg.js' => '46fcb3af', 17 17 'diffusion.pkg.css' => '354279ea', 18 18 'diffusion.pkg.js' => '78c9885d', ··· 63 63 'rsrc/css/application/diff/diff-tree-view.css' => 'e2d3e222', 64 64 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 65 65 'rsrc/css/application/differential/add-comment.css' => '7e5900d9', 66 - 'rsrc/css/application/differential/changeset-view.css' => '1b0476bc', 66 + 'rsrc/css/application/differential/changeset-view.css' => '979e688c', 67 67 'rsrc/css/application/differential/core.css' => '7300a73e', 68 68 'rsrc/css/application/differential/phui-inline-comment.css' => '9863a85e', 69 69 'rsrc/css/application/differential/revision-comment.css' => '7dbc8d1d', ··· 560 560 'conpherence-transaction-css' => '3a3f5e7e', 561 561 'd3' => 'e97b4b78', 562 562 'diff-tree-view-css' => 'e2d3e222', 563 - 'differential-changeset-view-css' => '1b0476bc', 563 + 'differential-changeset-view-css' => '979e688c', 564 564 'differential-core-view-css' => '7300a73e', 565 565 'differential-revision-add-comment-css' => '7e5900d9', 566 566 'differential-revision-comment-css' => '7dbc8d1d', ··· 1056 1056 'javelin-util', 1057 1057 'phabricator-keyboard-shortcut-manager', 1058 1058 ), 1059 - '1b0476bc' => array( 1060 - 'phui-inline-comment-view-css', 1061 - ), 1062 1059 '1b6acc2a' => array( 1063 1060 'javelin-magical-init', 1064 1061 'javelin-util', ··· 1776 1773 'javelin-dom', 1777 1774 'javelin-stratcom', 1778 1775 'phabricator-notification', 1776 + ), 1777 + '979e688c' => array( 1778 + 'phui-inline-comment-view-css', 1779 1779 ), 1780 1780 '98ef467f' => array( 1781 1781 'javelin-behavior',
+27 -2
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 233 233 $show_directory_uri = phutil_string_cast($show_directory_uri); 234 234 } 235 235 236 + Javelin::initBehavior('phabricator-clipboard-copy'); 237 + $path_copy_button = id(new PHUIButtonView()) 238 + ->setTag('a') 239 + ->setColor(PHUIButtonView::GREY) 240 + ->setIcon('fa-clipboard') 241 + ->setHref('#') 242 + ->addSigil('clipboard-copy') 243 + ->addSigil('has-tooltip') 244 + ->setMetadata( 245 + array( 246 + 'tip' => pht('Copy file path'), 247 + 'text' => $display_filename, 248 + 'successMessage' => pht('File path copied.'), 249 + 'errorMessage' => pht('Copy of file path failed.'), 250 + )); 251 + 236 252 return javelin_tag( 237 253 'div', 238 254 array( ··· 278 294 'sigil' => 'changeset-header', 279 295 ), 280 296 array( 281 - $icon, 297 + javelin_tag( 298 + 'span', 299 + array( 300 + 'class' => 'differential-changeset-path-copy-button', 301 + 'meta' => array( 302 + 'selectID' => $display_filename, 303 + 'once' => true, 304 + ), 305 + ), 306 + $path_copy_button), 282 307 javelin_tag( 283 308 'span', 284 309 array( 285 310 'class' => 'differential-changeset-path-name', 286 311 'sigil' => 'changeset-header-path-name', 287 312 ), 288 - $display_filename), 313 + $display_filename), 289 314 )), 290 315 javelin_tag( 291 316 'div',
+10 -1
webroot/rsrc/css/application/differential/changeset-view.css
··· 340 340 341 341 .differential-file-icon-header .phui-icon-view { 342 342 display: inline-block; 343 - margin: 0 6px 2px 0; 343 + margin: 0 0 2px 0; 344 344 vertical-align: middle; 345 345 font-size: 14px; 346 346 } 347 347 348 348 .device-phone .differential-file-icon-header .phui-icon-view { 349 + display: none; 350 + } 351 + 352 + .differential-changeset-path-copy-button { 353 + margin-right: 0; 354 + padding-right: 10px; 355 + } 356 + 357 + .device-phone .differential-changeset-path-copy-button { 349 358 display: none; 350 359 } 351 360