Skip to content

Commit 29be872

Browse files
committed
minor #1603 [Icon] Console theme: reference the webite + improve icon readability (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Icon] Console theme: reference the webite + improve icon readability Currently: <img width="763" alt="Capture d’écran 2024-03-10 à 05 04 02" src="https://github.com/symfony/ux/assets/1359581/e1032de4-57a2-4f69-a87e-836f6d31d551"> I'd suggest one of those... Open to debate :) <img width="767" alt="Capture d’écran 2024-03-10 à 05 27 26" src="https://github.com/symfony/ux/assets/1359581/d5d742ab-9e34-48ff-9b92-b09a57965c64"> <img width="894" alt="Capture d’écran 2024-03-10 à 05 26 32" src="https://github.com/symfony/ux/assets/1359581/4fe7beb9-8873-4d6d-bf90-dfd0aeb88417"> Commits ------- 3d7b0b5 [Icon] Console theme: reference the webite + improve icon readability
2 parents 9ce315d + 3d7b0b5 commit 29be872

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Icons/src/Command/ImportIconCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Console\Attribute\AsCommand;
1515
use Symfony\Component\Console\Command\Command;
16+
use Symfony\Component\Console\Cursor;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
1819
use Symfony\Component\Console\Output\OutputInterface;
@@ -64,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6465

6566
[$fullName, $prefix, $name] = $matches;
6667

67-
$io->comment(sprintf('Importing <info>%s</info>...', $fullName));
68+
$io->comment(sprintf('Importing %s...', $fullName));
6869

6970
try {
7071
$svg = $this->iconify->fetchSvg($prefix, $name);
@@ -75,13 +76,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7576
continue;
7677
}
7778

79+
$cursor = new Cursor($output);
80+
$cursor->moveUp(2);
81+
7882
$this->registry->add(sprintf('%s/%s', $prefix, $name), $svg);
7983

8084
$license = $this->iconify->metadataFor($prefix)['license'];
8185

8286
$io->text(sprintf(
83-
"Imported <info>%s</info> (License: <href=%s>%s</>), render with <comment>{{ ux_icon('%s') }}</comment>.",
84-
$fullName,
87+
" <fg=bright-green;options=bold>✓</> Imported <fg=bright-white;bg=black>%s:</><fg=bright-magenta;bg=black;options>%s</> (License: <href=%s>%s</>). Render with: <comment>{{ ux_icon('%s') }}</comment>",
88+
$prefix,
89+
$name,
8590
$license['url'],
8691
$license['title'],
8792
$fullName,

src/Icons/tests/Integration/Command/ImportIconCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testCanImportIcon(): void
4646
$this->executeConsoleCommand('ux:icons:import uiw:dashboard')
4747
->assertSuccessful()
4848
->assertOutputContains('Importing uiw:dashboard')
49-
->assertOutputContains("Imported uiw:dashboard (License: MIT), render with {{ ux_icon('uiw:dashboard') }}")
49+
->assertOutputContains("Imported uiw:dashboard (License: MIT). Render with: {{ ux_icon('uiw:dashboard') }}")
5050
;
5151

5252
$this->assertFileExists($expectedFile);

0 commit comments

Comments
 (0)