From de44b43d8ef24a7a27238ef21680ca2eb83b1859 Mon Sep 17 00:00:00 2001 From: Wes Date: Thu, 15 Oct 2026 18:07:46 -0700 Subject: [PATCH] fix(mobile): keep sign-in recovery on the current screen Co-authored-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz> Signed-off-by: Wes --- mobile/lib/hosted_app_gate.dart | 25 +++++++++++++++++++ .../onboarding/hosted_communities_test.dart | 5 +++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/mobile/lib/hosted_app_gate.dart b/mobile/lib/hosted_app_gate.dart index a1b551cd06..ed7e9c9764 100644 --- a/mobile/lib/hosted_app_gate.dart +++ b/mobile/lib/hosted_app_gate.dart @@ -7,6 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'features/channels/deep_link_dispatcher.dart'; import 'features/onboarding/hosted_connect_page.dart'; import 'shared/auth/auth.dart'; +import 'shared/theme/grid.dart'; import 'shared/deeplink/deep_link.dart'; import 'shared/hosted/account_identity_store.dart'; import 'shared/hosted/browser_auth.dart'; @@ -184,6 +185,30 @@ class HostedAppGate extends HookConsumerWidget { fit: StackFit.expand, children: [ child, + if (flow.stage == HostedFlowStage.signIn) + Positioned( + left: Grid.sm, + right: Grid.sm, + bottom: 0, + child: SafeArea( + child: Material( + color: Colors.transparent, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + onPressed: flow.retry, + child: const Text('Start login again'), + ), + TextButton( + onPressed: flow.leave, + child: const Text('Leave setup'), + ), + ], + ), + ), + ), + ), if (visible && !openingSignIn && (!inlineEntry || diff --git a/mobile/test/features/onboarding/hosted_communities_test.dart b/mobile/test/features/onboarding/hosted_communities_test.dart index 4798a2a627..6f0b291f84 100644 --- a/mobile/test/features/onboarding/hosted_communities_test.dart +++ b/mobile/test/features/onboarding/hosted_communities_test.dart @@ -50,8 +50,11 @@ void main() { expect(find.byType(HostedConnectPage), findsNothing); expect(find.text('Signing in…').hitTestable(), findsOneWidget); expect(find.text('Enter a community link'), findsOneWidget); - await f.flow.leave(); + expect(find.text('Start login again').hitTestable(), findsOneWidget); f.expired = false; + await tester.tap(find.text('Leave setup').hitTestable()); + await tester.pumpAndSettle(); + expect(f.flow.stage, HostedFlowStage.idle); await tester.pumpAndSettle(); expect(find.text('Continue with Builderlab'), findsOneWidget); expect(find.byType(HostedConnectPage), findsNothing);