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

Improve command line prompts in setup issue pages

Summary:
This is a follow-up to D25425, where these improvements to the CLI prompt markers were discussed.

Changes included in this revision:

- Build all prompts the same way
- Remove space after the prompt marker (add it via CSS instead)
- Add server path prefix
- Make the prompt unselectable

Test Plan:
- Visit any of the setup issue pages, e.g. <PHORGE_URL>/config/issue/auth.config-unlocked/ (after ensuring that the corresponding issue is present — in this case, by doing `./bin/auth unlock`)
- For example, Deactivate all PHP extensions to trigger each /config/issue/extension.gd/ etc.
- For example, update at least up to `dc10a7e69ea3` to see the database upgrade tip etc.
- Confirm that the command line prompts now include the path prefix
- Confirm that selecting the command via double-click (or click-and-drag) does not select the prompt

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Tags: #ux, #config

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

+60 -25
+2 -2
resources/celerity/map.php
··· 45 45 'rsrc/css/application/conduit/conduit-api.css' => 'ce2cfc41', 46 46 'rsrc/css/application/config/config-options.css' => '16c920ae', 47 47 'rsrc/css/application/config/config-template.css' => 'e689dbbd', 48 - 'rsrc/css/application/config/setup-issue.css' => '5eed85b2', 48 + 'rsrc/css/application/config/setup-issue.css' => '93231115', 49 49 'rsrc/css/application/config/unhandled-exception.css' => '9ecfc00d', 50 50 'rsrc/css/application/conpherence/color.css' => 'b17746b0', 51 51 'rsrc/css/application/conpherence/durable-column.css' => '2d57072b', ··· 903 903 'project-card-view-css' => 'c1200da7', 904 904 'project-triggers-css' => 'cd9c8bb9', 905 905 'project-view-css' => '2f7caa20', 906 - 'setup-issue-css' => '5eed85b2', 906 + 'setup-issue-css' => '93231115', 907 907 'sprite-login-css' => '07052ee0', 908 908 'sprite-tokens-css' => 'f1896dc5', 909 909 'syntax-default-css' => '055fc231',
+2 -1
src/applications/config/check/PhabricatorAuthSetupCheck.php
··· 74 74 ->addRelatedPhabricatorConfig('auth.lock-config') 75 75 ->addCommand( 76 76 hsprintf( 77 - '<tt>$</tt> ./bin/auth lock')); 77 + '<tt>%s $</tt>./bin/auth lock', 78 + PlatformSymbols::getPlatformServerPath())); 78 79 } 79 80 } 80 81 }
+3 -4
src/applications/config/check/PhabricatorBaseURISetupCheck.php
··· 96 96 ->setMessage($message) 97 97 ->addCommand( 98 98 hsprintf( 99 - '<tt>$</tt> %s', 100 - csprintf( 101 - './bin/config set phabricator.base-uri %s', 102 - $base_uri_guess))); 99 + '<tt>%s $</tt>./bin/config set phabricator.base-uri %s', 100 + PlatformSymbols::getPlatformServerPath(), 101 + $base_uri_guess)); 103 102 } 104 103 }
+8 -2
src/applications/config/check/PhabricatorDaemonsSetupCheck.php
··· 49 49 ->setName(pht('Daemons Are Not Running')) 50 50 ->setSummary($summary) 51 51 ->setMessage($message) 52 - ->addCommand('$ ./bin/phd start'); 52 + ->addCommand( 53 + hsprintf( 54 + '<tt>%s $</tt>./bin/phd start', 55 + PlatformSymbols::getPlatformServerPath())); 53 56 } 54 57 55 58 $expect_user = PhabricatorEnv::getEnvConfig('phd.user'); ··· 90 93 ->setSummary($summary) 91 94 ->setMessage($message) 92 95 ->addPhabricatorConfig('phd.user') 93 - ->addCommand('$ ./bin/phd restart'); 96 + ->addCommand( 97 + hsprintf( 98 + '<tt>%s $</tt>./bin/phd restart', 99 + PlatformSymbols::getPlatformServerPath())); 94 100 95 101 break; 96 102 }
+11 -4
src/applications/config/check/PhabricatorDatabaseSetupCheck.php
··· 35 35 ->addPhabricatorConfig('mysql.port') 36 36 ->addCommand( 37 37 hsprintf( 38 - '<tt>$</tt> ./bin/config set mysql.host %s', 38 + '<tt>%s $</tt>./bin/config set mysql.host %s', 39 + PlatformSymbols::getPlatformServerPath(), 39 40 $host)) 40 41 ->addCommand( 41 42 hsprintf( 42 - '<tt>$</tt> ./bin/config set mysql.port %s', 43 + '<tt>%s $</tt>./bin/config set mysql.port %s', 44 + PlatformSymbols::getPlatformServerPath(), 43 45 $port)); 44 46 } 45 47 ··· 134 136 ->setName(pht('Setup MySQL Schema')) 135 137 ->setMessage($message) 136 138 ->setIsFatal(true) 137 - ->addCommand(hsprintf('<tt>$</tt> ./bin/storage upgrade')); 139 + ->addCommand( 140 + hsprintf( 141 + '<tt>%s $</tt>./bin/storage upgrade', 142 + PlatformSymbols::getPlatformServerPath())); 138 143 139 144 return true; 140 145 } ··· 160 165 ->setIsFatal(true) 161 166 ->setMessage($message) 162 167 ->addCommand( 163 - hsprintf('<tt>$</tt> ./bin/storage upgrade')); 168 + hsprintf( 169 + '<tt>%s $</tt>./bin/storage upgrade', 170 + PlatformSymbols::getPlatformServerPath())); 164 171 165 172 return true; 166 173 }
+8 -2
src/applications/config/check/PhabricatorElasticsearchSetupCheck.php
··· 60 60 $this 61 61 ->newIssue('elastic.missing-index') 62 62 ->setName(pht('Elasticsearch Index Not Found')) 63 - ->addCommand('./bin/search init') 63 + ->addCommand( 64 + hsprintf( 65 + '<tt>%s $</tt>./bin/search init', 66 + PlatformSymbols::getPlatformServerPath())) 64 67 ->setSummary($summary) 65 68 ->setMessage($message); 66 69 ··· 76 79 $this 77 80 ->newIssue('elastic.broken-index') 78 81 ->setName(pht('Elasticsearch Index Schema Mismatch')) 79 - ->addCommand('./bin/search init') 82 + ->addCommand( 83 + hsprintf( 84 + '<tt>%s $</tt>./bin/search init', 85 + PlatformSymbols::getPlatformServerPath())) 80 86 ->setSummary($summary) 81 87 ->setMessage($message); 82 88 }
+10 -4
src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
··· 76 76 $issue->setMessage($message); 77 77 78 78 if ($found_local) { 79 - $command = csprintf('$ ./bin/config delete %s', $key); 79 + $command = hsprintf( 80 + '<tt>%s $</tt>./bin/config delete %s', 81 + PlatformSymbols::getPlatformServerPath(), 82 + $key); 80 83 $issue->addCommand($command); 81 84 } 82 85 ··· 166 169 'target' => '_blank', 167 170 ), 168 171 $doc_name)); 169 - $command = csprintf( 170 - '$ ./bin/config delete --database %R', 171 - $key); 172 + $command = hsprintf( 173 + '<tt>%s $</tt>%s', 174 + PlatformSymbols::getPlatformServerPath(), 175 + csprintf( 176 + './bin/config delete --database %R', 177 + $key)); 172 178 173 179 $this->newIssue('config.locked.'.$key) 174 180 ->setShortName(pht('Deprecated Config Source'))
+5 -4
src/applications/config/view/PhabricatorSetupIssueView.php
··· 83 83 // TODO: We should do a better job of detecting how to install extensions 84 84 // on the current system. 85 85 $install_commands = hsprintf( 86 - "\$ sudo apt-get install php-<em>extname</em> ". 86 + "<tt>$</tt>sudo apt-get install php-<em>extname</em> ". 87 87 "# Debian / Ubuntu\n". 88 - "\$ sudo dnf install php-<em>extname</em> ". 88 + "<tt>$</tt>sudo dnf install php-<em>extname</em> ". 89 89 "# Red Hat / Derivatives\n". 90 - "\$ sudo yum install php-<em>extname</em> ". 90 + "<tt>$</tt>sudo yum install php-<em>extname</em> ". 91 91 "# Older Red Hat versions"); 92 92 93 93 $fallback_info = pht( ··· 286 286 $update = array(); 287 287 foreach ($configs as $key) { 288 288 $update[] = hsprintf( 289 - '<tt>$</tt> ./bin/config set %s <em>value</em>', 289 + '<tt>%s $</tt>./bin/config set %s <em>value</em>', 290 + PlatformSymbols::getPlatformServerPath(), 290 291 $key); 291 292 } 292 293 $update = phutil_tag('pre', array(), phutil_implode_html("\n", $update));
+6 -2
src/applications/uiexample/examples/PhabricatorSetupIssueUIExample.php
··· 24 24 ->setSummary(pht('Summary')) 25 25 ->setMessage(pht('Message')) 26 26 ->setIssueKey('example.key') 27 - ->addCommand('$ # Add Command') 28 - ->addCommand(hsprintf('<tt>$</tt> %s', '$ ls -1 > /dev/null')) 27 + ->addCommand(hsprintf( 28 + '<tt>%s $</tt># Add Command', 29 + PlatformSymbols::getPlatformServerPath())) 30 + ->addCommand(hsprintf( 31 + '<tt>%s $</tt>ls -1 > /dev/null', 32 + PlatformSymbols::getPlatformServerPath())) 29 33 ->addPHPConfig('php.config.example') 30 34 ->addPhabricatorConfig('test.value') 31 35 ->addPHPExtension('libexample');
+5
webroot/rsrc/css/application/config/setup-issue.css
··· 122 122 padding: 12px 0; 123 123 } 124 124 125 + .setup-issue-config > pre > tt { 126 + user-select: none; 127 + margin-right: 0.5em; 128 + } 129 + 125 130 .setup-issue-config + .setup-issue-config { 126 131 padding-top: 0; 127 132 }