Skip to content

Commit 68329b3

Browse files
Improved output info
1 parent bec9aa5 commit 68329b3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/Data/NotificationData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class NotificationData extends Data
2020

2121
public string $title;
2222

23-
public function __construct(array $data)
23+
public function __construct(array $data, int $index)
2424
{
2525
$this->id = (int) $this->get($data, 'id');
2626
$this->issueId = $this->issueId($data);
@@ -31,7 +31,7 @@ public function __construct(array $data)
3131
$this->organization = $this->get($data, 'repository.owner.login');
3232
$this->repository = $this->get($data, 'repository.name');
3333

34-
$this->title = sprintf('%s: %s #%d', $this->fullName, $this->type, $this->issueId);
34+
$this->title = sprintf('%d. %s: <fg=gray>%s #%d</>', $index, $this->fullName, $this->type, $this->issueId);
3535
}
3636

3737
protected function issueId(array $data): int

app/Services/GitHub.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class GitHub
2323

2424
protected bool $withOpen = false;
2525

26+
protected int $index = 0;
27+
2628
public function __construct(
2729
protected Factory $output,
2830
protected Client $github,
@@ -70,13 +72,13 @@ public function markAll(): void
7072
public function mark(): void
7173
{
7274
if (! $items = $this->paginated()) {
73-
$this->output->info('Nothing to mark');
75+
$this->output->info('No unread notifications');
7476

7577
return;
7678
}
7779

7880
foreach ($items as $data) {
79-
$notification = new NotificationData($data);
81+
$notification = new NotificationData($data, ++$this->index);
8082

8183
$item = new ItemData($this->requestByType($notification));
8284

0 commit comments

Comments
 (0)