Skip to content

Commit cfe4fdd

Browse files
simonhampclaude
andcommitted
Drop the toast after committing or replying
The new commit already shows up at the top of the log, and a reply at the end of the thread, with a pending pill when it needs approval. The toast only repeated that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b1f90b3 commit cfe4fdd

4 files changed

Lines changed: 6 additions & 15 deletions

File tree

‎app/NativeComponents/CommitDetail.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ public function sendReply(): void
162162

163163
$this->reply = '';
164164
$this->replies = [...$this->replies, $reply];
165-
166-
Dialog::toast($reply->isPending()
167-
? "[reply {$reply->shortHash()}] pending: only you can see it until it's approved."
168-
: "[reply {$reply->shortHash()}] {$reply->body}", 'short');
169165
}
170166

171167
public function confirmDelete(): void

‎app/NativeComponents/Log.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Native\Mobile\Edge\Layouts\Builders\NavAction;
1919
use Native\Mobile\Edge\Layouts\Builders\NavBarOptions;
2020
use Native\Mobile\Edge\NativeComponent;
21-
use Native\Mobile\Facades\Dialog;
2221

2322
/**
2423
* The log: commits from you and the people you follow, or from everyone, under
@@ -216,10 +215,6 @@ public function commit(): void
216215
$this->focusComposer = false;
217216
$this->composerKey++;
218217
$this->commits = [$commit, ...$this->commits];
219-
220-
Dialog::toast($commit->isPending()
221-
? "[log {$commit->shortHash()}] pending: only you can see it until it's approved."
222-
: "[log {$commit->shortHash()}] {$commit->body}");
223218
}
224219

225220
public function openCommit(string $id): void

‎tests/Feature/Screens/CommitDetailTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ function fakeThread(array $commit = [], array $replies = [], array $extra = []):
5656
->tap('send-reply')
5757
->assertSet('reply', '')
5858
->assertSee('A fresh reply')
59-
->assertNativeCalled('Dialog.Toast', fn (array $params): bool => $params['message'] === '[reply r9] A fresh reply');
59+
->assertNativeNotCalled('Dialog.Toast');
6060

6161
Http::assertSent(fn (Request $request): bool => $request->method() === 'POST'
6262
&& $request->body() === '{"body":"A fresh reply","parent_id":"c2"}');
6363
});
6464

65-
it('says when a reply is waiting for approval', function () {
65+
it('marks a reply waiting for approval as pending on its row', function () {
6666
fakeThread(extra: ['POST /api/v1/commits' => [['data' => commitJson(['id' => 'r9', 'status' => 'pending', 'body' => 'Hold on'])], 201]]);
6767

6868
Native::visit('/log/commits/c2')
6969
->input('reply-input', 'Hold on')
7070
->tap('send-reply')
7171
->assertSee('pending')
72-
->assertNativeCalled('Dialog.Toast', fn (array $params): bool => $params['message'] === "[reply r9] pending: only you can see it until it's approved.");
72+
->assertNativeNotCalled('Dialog.Toast');
7373
});
7474

7575
it('shows validation messages from the server', function () {

‎tests/Feature/Screens/ComposerTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function composerField(TestableComponent $screen): array
118118

119119
$screen->tap('commit')
120120
->assertNoNavigation()
121-
->assertNativeCalled('Dialog.Toast', fn (array $params): bool => $params['message'] === '[log 000beef] Shipped the mobile app.')
121+
->assertNativeNotCalled('Dialog.Toast')
122122
->assertSet('body', '')
123123
->assertSet('composing', false)
124124
->assertSee('Shipped the mobile app.')
@@ -136,7 +136,7 @@ function composerField(TestableComponent $screen): array
136136
Http::assertSent(fn (Request $request): bool => $request->method() === 'POST' && $request->body() === '{"body":"Shipped the mobile app."}');
137137
});
138138

139-
it('says so when the commit is pending', function () {
139+
it('marks the new commit as pending on its row', function () {
140140
fakeApi([
141141
'GET /api/v1/log/following' => [pageJson([])],
142142
'POST /api/v1/commits' => [['data' => commitJson(['id' => 'abc1234', 'body' => 'Needs a look first', 'status' => 'pending'])], 201],
@@ -145,7 +145,7 @@ function composerField(TestableComponent $screen): array
145145
Native::visit('/log')
146146
->input('body', 'Needs a look first')
147147
->tap('commit')
148-
->assertNativeCalled('Dialog.Toast', fn (array $params): bool => $params['message'] === "[log abc1234] pending: only you can see it until it's approved.")
148+
->assertNativeNotCalled('Dialog.Toast')
149149
->assertNoNavigation()
150150
->assertSee('Needs a look first')
151151
->assertSee('pending');

0 commit comments

Comments
 (0)