From b4701419d09023d40cf7712a805b754e79acec94 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Thu, 12 Nov 2026 03:11:02 +0000 Subject: [PATCH] Update permission card stop assertions Keep the permission-card regression aligned with the redesigned running composer. Verify that the composer stop control is absent and Stop remains available through the More menu while the turn runs. --- app/notes/composer-running-border.md | 15 +++++++++++++++ .../conversation/chat_permission_card_test.dart | 17 ++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/notes/composer-running-border.md b/app/notes/composer-running-border.md index e46c7762..7b5f934c 100644 --- a/app/notes/composer-running-border.md +++ b/app/notes/composer-running-border.md @@ -34,6 +34,21 @@ `tool/analyze.sh` (whole app): clean, exit 0. +## Land-gate fix (visit 2) + +`chat_permission_card_test.dart`: "a turn waiting on a pending card hides the +running indicator but keeps Stop" asserted a `Stop` tooltip on the composer, +which this change removes by design. It now asserts no `chat-composer-stop` +and that Stop is in the More menu, before and after the permission resolves. +Expectations for behaviour this change did not touch are unchanged. + +| Run | Paths | Result | +|---|---|---| +| 3 | `chat_permission_card_test`, `chat_thread_stop_menu_test` | PASS 15/15 | +| 4 | all six focused paths above (escape, spinner, running, stop menu, bar state, permission card) | PASS 44/44 | + +`tool/analyze.sh`: clean, exit 0. + ## Affected states (widget tests) - Running: no `chat-composer-stop`; Send present; border present; no interrupt sent. diff --git a/app/test/features/chat/conversation/chat_permission_card_test.dart b/app/test/features/chat/conversation/chat_permission_card_test.dart index feb04d37..969fa534 100644 --- a/app/test/features/chat/conversation/chat_permission_card_test.dart +++ b/app/test/features/chat/conversation/chat_permission_card_test.dart @@ -38,6 +38,15 @@ JsonMap permission({ if (decision.isNotEmpty) 'decision': decision, }; +Future expectStopInMoreMenu(WidgetTester tester) async { + await tester.tap(find.byTooltip('More actions').hitTestable().first); + await tester.pumpAndSettle(); + expect(find.text('Stop'), findsOneWidget); + await tester.tapAt(const Offset(1, 1)); + await tester.pumpAndSettle(); + expect(find.text('Stop'), findsNothing); +} + void main() { test('recorded action, risk and options survive the card model', () { final card = chatPermissionCard(permission(), '')!; @@ -331,7 +340,8 @@ void main() { await tester.pumpAndSettle(); expect(find.text('Approve bash'), findsOneWidget); - expect(find.byTooltip('Stop'), findsOneWidget); + expect(find.byKey(const Key('chat-composer-stop')), findsNothing); + await expectStopInMoreMenu(tester); gateway.emitRaw({ 'type': 'chat_permission', @@ -339,9 +349,10 @@ void main() { }); await tester.pumpAndSettle(); - // No filler line while the turn runs; Stop is the running signal. + // No filler line while the turn runs; the More menu keeps Stop reachable. expect(find.byKey(const Key('chat-running')), findsNothing); - expect(find.byTooltip('Stop'), findsOneWidget); + expect(find.byKey(const Key('chat-composer-stop')), findsNothing); + await expectStopInMoreMenu(tester); }); testWidgets('consecutive Material cards stay separate surfaces', (