Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

feat(mobile): simplify welcome sign-in options

tonyd5496d2ca9c2
diff --git a/mobile/lib/app_shell.dart b/mobile/lib/app_shell.dart
index 23ff1b668..2cf6c0a82 100644
--- a/mobile/lib/app_shell.dart
+++ b/mobile/lib/app_shell.dart
@@ -288,11 +288,17 @@ class RootShell extends ConsumerWidget {
}
return Column(
children: [
- Expanded(child: screen),
- SafeArea(
- top: false,
- child: SetupUsageChoice(measurement: app.productMeasurement),
+ // The choice under it keeps the home indicator's inset; the screen's own SafeArea
+ // would keep it a second time, an empty band between its foot and the choice.
+ Expanded(
+ child: MediaQuery.removePadding(
+ context: context,
+ removeBottom: true,
+ child: screen,
+ ),
),
+ // Keeps the home indicator's inset itself, its ground painted under it.
+ SetupUsageChoice(measurement: app.productMeasurement),
],
);
},
diff --git a/mobile/lib/measurement/setup_usage_choice.dart b/mobile/lib/measurement/setup_usage_choice.dart
index 064e20cbc..b08755b5b 100644
--- a/mobile/lib/measurement/setup_usage_choice.dart
+++ b/mobile/lib/measurement/setup_usage_choice.dart
@@ -1,32 +1,147 @@
import 'dart:async';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:lucide_icons_flutter/lucide_icons.dart';
+import '../phone/tty.dart';
+import '../phone/tty_controls.dart';
import 'product_measurement.dart';
/// Visible before any optional signed-out report. It never blocks setup or sign-in.
+///
+/// One quiet line under every signed-out screen, in the onboarding's face: the box, its words, and
+/// ⓘ for what is shared. The detail is a tooltip over the line, not a second line under it, so the
+/// screen above — the welcome's picture — never moves for it.
class SetupUsageChoice extends StatelessWidget {
const SetupUsageChoice({super.key, required this.measurement});
final ProductMeasurement measurement;
+ static const title = 'Share setup and sign-in counts';
+ static const detail =
+ 'Optional for this app session. Help us find setup problems without sharing account details, prompts, or files.';
+
@override
Widget build(BuildContext context) => ListenableBuilder(
listenable: measurement,
- builder: (context, _) => Material(
- color: Theme.of(context).colorScheme.surface,
- child: CheckboxListTile(
- dense: true,
- controlAffinity: ListTileControlAffinity.leading,
- value: measurement.signedOutSharing,
- onChanged: measurement.choiceLoaded
- ? (value) =>
- unawaited(measurement.setSignedOutSharing(value == true))
- : null,
- title: const Text('Share setup and sign-in counts'),
- subtitle: const Text(
- 'Optional for this app session. Help us find setup problems without sharing account details, prompts, or files.',
+ builder: (context, _) {
+ final tty = Tty.of(context);
+ final checked = measurement.signedOutSharing;
+ final onTap = measurement.choiceLoaded
+ ? () => unawaited(measurement.setSignedOutSharing(!checked))
+ : null;
+ // Material for the text's default style — outside a Scaffold, without it, Flutter marks
+ // every line with its yellow "no style" underline — and the ground painted down through the
+ // home indicator's inset, which this keeps itself.
+ return Material(
+ color: tty.ground,
+ child: SafeArea(
+ top: false,
+ minimum: const EdgeInsets.symmetric(horizontal: 16),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Flexible(
+ child: _Choice(checked: checked, onTap: onTap),
+ ),
+ Tooltip(
+ message: detail,
+ triggerMode: TooltipTriggerMode.tap,
+ showDuration: const Duration(seconds: 8),
+ // Over the line: under it is the edge of the screen.
+ preferBelow: false,
+ margin: const EdgeInsets.symmetric(horizontal: 24),
+ padding: const EdgeInsets.symmetric(
+ horizontal: 12,
+ vertical: 10,
+ ),
+ decoration: BoxDecoration(
+ color: ttyRaised(tty),
+ border: Border.all(color: tty.dim),
+ borderRadius: BorderRadius.circular(8),
+ ),
+ textStyle: tty
+ .style(size: TtySize.meta, color: tty.text)
+ .copyWith(height: 1.45),
+ child: SizedBox.square(
+ dimension: 44,
+ child: Icon(LucideIcons.info300, size: 15, color: tty.faint),
+ ),
+ ),
+ ],
+ ),
),
- ),
- ),
+ );
+ },
);
}
+
+/// The box and its words — the whole of it one tap target, at least 44pt tall. Checked, the box is
+/// the terminal's green with a tick in its ink; not loaded yet, it steps back.
+class _Choice extends StatelessWidget {
+ const _Choice({required this.checked, required this.onTap});
+
+ final bool checked;
+ final VoidCallback? onTap;
+
+ @override
+ Widget build(BuildContext context) {
+ final tty = Tty.of(context);
+ return Semantics(
+ container: true,
+ checked: checked,
+ enabled: onTap != null,
+ label: SetupUsageChoice.title,
+ onTap: onTap,
+ excludeSemantics: true,
+ child: Opacity(
+ opacity: onTap == null ? .5 : 1,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: onTap == null
+ ? null
+ : () {
+ HapticFeedback.selectionClick();
+ onTap!();
+ },
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(minHeight: 44),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Container(
+ width: 16,
+ height: 16,
+ decoration: BoxDecoration(
+ color: checked ? tty.green : null,
+ border: Border.all(
+ color: checked ? tty.green : tty.dim,
+ width: 1.5,
+ ),
+ borderRadius: BorderRadius.circular(4),
+ ),
+ child: checked
+ ? Icon(
+ LucideIcons.check,
+ size: 12,
+ color: tty.onFill(tty.theme.black),
+ )
+ : null,
+ ),
+ const SizedBox(width: 9),
+ Flexible(
+ child: Text(
+ SetupUsageChoice.title,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ style: tty.style(size: TtySize.meta, color: tty.faint),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/mobile/lib/phone/welcome/onboarding_copy.dart b/mobile/lib/phone/welcome/onboarding_copy.dart
index 63197791d..aa88838d9 100644
--- a/mobile/lib/phone/welcome/onboarding_copy.dart
+++ b/mobile/lib/phone/welcome/onboarding_copy.dart
@@ -3,9 +3,9 @@
///
/// ```
/// ① Welcome Manage all your agents on all your computers from your phone.
-/// [Scan QR from computer] [Continue with Google] [Continue with Apple]
-/// Scan QR from computer → the camera: How to get the QR code, its steps,
-/// Use email instead
+/// [Continue with Google] [Continue with Apple]
+/// under them, as words: Continue with email · QR code
+/// QR code → the camera: How to get the QR code, its steps
/// ② Your computer On your computer, go to [autonomous.ai/go ⇪]
/// under the picture: Looking for your computer▌
/// under the link: (1) Install Harness (2) Sign in, Use you@…
@@ -30,12 +30,15 @@ abstract final class OnboardingCopy {
static const welcome =
'Manage all your agents on all your computers from your phone.';
- /// ① The first of the three ways in: the camera, for the code a signed-in computer's Add Phone
- /// shows, which signs this phone in to that computer's account with nothing to type.
+ /// ① Under the accounts, in their quiet line after Continue with email (owner, 2026-10-14): the
+ /// camera, for the code a signed-in computer's Add Phone shows, which signs this phone in to that
+ /// computer's account with nothing to type. The line says [qrCode]; a screen reader hears
+ /// [scanQrCode].
+ static const qrCode = 'QR code';
static const scanQrCode = 'Scan QR from computer';
- /// An emailed code. Not on the welcome any more (owner, 2026-10-12: three ways in, nothing else);
- /// the camera's "Use email instead" leads to it.
+ /// ① Under the accounts, first in their quiet line (owner, 2026-10-14): an emailed code — the
+ /// desktop login's words for it.
static const continueWithEmail = 'Continue with email';
/// ① Under the picture, when the camera read a computer's own sign-in code (its "Scan with your
diff --git a/mobile/lib/phone/welcome/onboarding_frame.dart b/mobile/lib/phone/welcome/onboarding_frame.dart
index da6e8c171..72a138bed 100644
--- a/mobile/lib/phone/welcome/onboarding_frame.dart
+++ b/mobile/lib/phone/welcome/onboarding_frame.dart
@@ -11,8 +11,8 @@ import 'set_up_computer.dart' show StepsTimeline, goToSteps;
/// which every screen after signing in shares (its wait, and the computer joining), so the picture
/// stays put from one to the next.
enum OnboardingLayout {
- /// ① A headline of up to three lines; Scan QR from computer, the two accounts and the quiet line
- /// at the foot.
+ /// ① A headline of up to three lines; the two accounts and, under them, one quiet line — Continue
+ /// with email · QR code, or Cancel in their place — at the foot.
welcome,
/// ② The headline, the link and the steps on the computer under it — "Not you? Sign out" under
@@ -35,9 +35,9 @@ enum OnboardingLayout {
/// └──────────────────┘
/// Looking for your computer▌ status
///
-/// [ Scan QR from computer ] actions, at the foot
-/// [ Continue with Google ]
+/// [ Continue with Google ] actions, at the foot
/// [ Continue with Apple ]
+/// ✉ Continue with email · ⊞ QR code the quiet line: the lesser ways in, as words
/// ```
///
/// ⚠️ **Every slot is measured the same way on every screen of a [layout]**, whatever it holds — the
@@ -119,10 +119,10 @@ class OnboardingFrame extends StatelessWidget {
);
final quiet = math.max(44.0, scaler.scale(quietSize) * 1.45);
final (head, foot) = switch (layout) {
- // The headline's three lines; the three ways in and the quiet line under them.
+ // The headline's three lines; the two accounts and the quiet line under them.
OnboardingLayout.welcome => (
math.max(3 * line, 2 * line + _underGap + button),
- 3 * button + 2 * _buttonGap + quiet + 8,
+ 2 * button + 2 * _buttonGap + quiet + 8,
),
// Two lines of headline, the link and the steps; one quiet line.
OnboardingLayout.goTo => (
diff --git a/mobile/lib/phone/welcome/phone_welcome.dart b/mobile/lib/phone/welcome/phone_welcome.dart
index 4b9849faa..be626168e 100644
--- a/mobile/lib/phone/welcome/phone_welcome.dart
+++ b/mobile/lib/phone/welcome/phone_welcome.dart
@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:harness_mobile/auth/sign_in_provider.dart';
@@ -31,10 +32,13 @@ import 'sign_in_provider_button.dart';
/// │ all lit, a phone │
/// └─────────────────────┘
///
-/// [ ⊞ Scan QR from computer ] → the camera ([ScanToConnectPage]) → Use email instead
-/// [ G Continue with Google ]
-/// [ Continue with Apple ]
-/// (Cancel here while an account's page is up)
+/// [ G Continue with Google ]
+/// [ Continue with Apple ]
+/// ✉ Continue with email · ⊞ QR code words, not boxes
+/// (Cancel in their place while an account's page is up)
+///
+/// Continue with email → Your email → Check your email.
+/// QR code → the camera ([ScanToConnectPage]); back for the others.
/// ```
///
/// Signing in is all there is to do here, and it moves on by itself: signed in, the app swaps this
@@ -42,17 +46,17 @@ import 'sign_in_provider_button.dart';
/// the computer's session when it has one (`docs/research/2026-10-11-phone-onboarding`, agreed with
/// the owner 2026-10-12).
///
-/// ⚠️ **Three ways in, nothing else** (owner, 2026-10-12): **Scan QR from computer** first, the
-/// screen's one filled button — its camera reads the code a signed-in computer's Add Phone shows
-/// ([ConnectCode]): its sign-in code signs this phone in to that computer's account with nothing to
-/// type, and its pairing code is held for that computer ([AppNotifier.pendingPairing]) — then
-/// Google and Apple.
-/// No sample, no "Is Harness on your computer?", no tips. An emailed code is the camera's "Use
-/// email instead", and where a scan without a sign-in code ends up.
+/// ⚠️ **Four ways in, nothing else** (owner, 2026-10-14; it was the scan first, then Google and
+/// Apple, on 2026-10-12): **Google** and **Apple**, the only buttons, then the lesser ways in as
+/// one line of words — **Continue with email**, an emailed code, also where a scan without a
+/// sign-in code ends up; **QR code**: its camera reads the code a signed-in computer's Add Phone
+/// shows ([ConnectCode]): its sign-in code signs this phone in to that computer's account with
+/// nothing to type, and its pairing code is held for that computer ([AppNotifier.pendingPairing]).
+/// No sample, no "Is Harness on your computer?", no tips.
///
-/// ⚠️ **The foot never changes height.** While an account's page is up, the quiet line under the
-/// buttons becomes Cancel; why it did not finish is said under the picture — so the picture, in
-/// the same place on every onboarding screen ([OnboardingFrame]), never moves for it.
+/// ⚠️ **The foot never changes height.** While an account's page is up, the line of lesser ways in
+/// under the buttons becomes Cancel; why it did not finish is said under the picture — so the
+/// picture, in the same place on every onboarding screen ([OnboardingFrame]), never moves for it.
class PhoneWelcome extends StatefulWidget {
const PhoneWelcome({
super.key,
@@ -352,6 +356,7 @@ class _PhoneWelcomeState extends State<PhoneWelcome> {
waitingOn: notifier.signInProvider,
entering: entering,
onCancel: notifier.cancelProviderSignIn,
+ onEmail: () => _go(_Step.email),
onScan: () => _go(_Step.scan),
),
),
@@ -364,7 +369,8 @@ class _PhoneWelcomeState extends State<PhoneWelcome> {
signingIn: _signingInWithScan,
// Where the code is on the computer — the same steps as the camera on Computers.
steps: const ComputerSteps(account: null),
- onUseEmail: () => _go(_Step.email),
+ // No "Use email instead" under it (owner, 2026-10-14): Continue with email sits
+ // beside QR code, one back away.
onBack: () => _go(_Step.hello),
),
_Step.email => SignInForm(
@@ -440,13 +446,14 @@ class _PhoneWelcomeState extends State<PhoneWelcome> {
}
}
-/// The welcome's foot: Scan QR from computer — the screen's one filled button — then Google and
-/// Apple ([SignInProviderButton]), and under them the quiet line's slot: Cancel while an account's
-/// page is up, empty otherwise, so the foot is the same height whatever it holds.
+/// The welcome's foot: Google and Apple ([SignInProviderButton]), and under them one line — the
+/// lesser ways in as words ([_WayLink]), or Cancel in their place while an account's page is up —
+/// so the foot is the same height whatever it holds.
class _Accounts extends StatelessWidget {
const _Accounts({
required this.onProvider,
required this.onCancel,
+ required this.onEmail,
required this.onScan,
this.waitingOn,
this.entering = false,
@@ -463,6 +470,9 @@ class _Accounts extends StatelessWidget {
final bool entering;
final VoidCallback onCancel;
+ /// "Continue with email": the emailed code's step.
+ final VoidCallback onEmail;
+
/// "Scan QR from computer": the camera.
final VoidCallback onScan;
@@ -473,15 +483,8 @@ class _Accounts extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- TtyPrimaryButton(
- key: const ValueKey('welcome-scan'),
- icon: LucideIcons.qrCode300,
- label: OnboardingCopy.scanQrCode,
- // Not while an account's page is up, or past it: the scan would sign in behind it.
- onPressed: onProvider == null ? null : onScan,
- ),
- for (final provider in SignInProvider.values) ...[
- const SizedBox(height: 10),
+ for (final (i, provider) in SignInProvider.values.indexed) ...[
+ if (i > 0) const SizedBox(height: 10),
SignInProviderButton(
provider: provider,
onPressed: onProvider == null ? null : () => onProvider!(provider),
@@ -490,6 +493,9 @@ class _Accounts extends StatelessWidget {
: null,
),
],
+ const SizedBox(height: 10),
+ // The lesser ways in, as words; Cancel in their place while an account's page is up — they
+ // could not be pressed then anyway — so the foot holds no empty room for it.
if (waiting)
Center(
child: TtyTextButton(
@@ -500,13 +506,127 @@ class _Accounts extends StatelessWidget {
),
)
else
- // The quiet line's room, held: Cancel takes it without the foot growing.
- const SizedBox(height: 44),
+ // Wider than the phone — a large text size — it shrinks to fit, on one line.
+ Center(
+ child: FittedBox(
+ fit: BoxFit.scaleDown,
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ // Not while an account's page is up, or past it — neither the email nor the
+ // scan: either would sign in behind it.
+ _WayLink(
+ key: const ValueKey('welcome-continue-email'),
+ icon: LucideIcons.mail300,
+ label: OnboardingCopy.continueWithEmail,
+ onPressed: onProvider == null ? null : onEmail,
+ ),
+ const _Dot(),
+ _WayLink(
+ key: const ValueKey('welcome-scan'),
+ icon: LucideIcons.qrCode300,
+ label: OnboardingCopy.qrCode,
+ semanticLabel: OnboardingCopy.scanQrCode,
+ onPressed: onProvider == null ? null : onScan,
+ ),
+ ],
+ ),
+ ),
+ ),
],
);
}
}
+/// One of the welcome's lesser ways in, under the accounts: its icon and words in the quiet line's
+/// face — Continue with email, QR code. Words, not a box: only the accounts are buttons. Pressed,
+/// it brightens on the finger's way DOWN.
+class _WayLink extends StatefulWidget {
+ const _WayLink({
+ super.key,
+ required this.icon,
+ required this.label,
+ required this.onPressed,
+ this.semanticLabel,
+ });
+
+ final IconData icon;
+ final String label;
+
+ /// Null while a sign-in is in flight.
+ final VoidCallback? onPressed;
+
+ /// What a screen reader hears, where [label] is the short form. Null is [label].
+ final String? semanticLabel;
+
+ @override
+ State<_WayLink> createState() => _WayLinkState();
+}
+
+class _WayLinkState extends State<_WayLink> {
+ bool _down = false;
+
+ @override
+ Widget build(BuildContext context) {
+ final tty = Tty.of(context);
+ final enabled = widget.onPressed != null;
+ final ink = !enabled
+ ? tty.dim
+ : _down
+ ? tty.text
+ : tty.faint;
+ return Semantics(
+ button: true,
+ enabled: enabled,
+ label: widget.semanticLabel ?? widget.label,
+ excludeSemantics: true,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTapDown: enabled ? (_) => setState(() => _down = true) : null,
+ onTapCancel: enabled ? () => setState(() => _down = false) : null,
+ onTapUp: enabled ? (_) => setState(() => _down = false) : null,
+ onTap: enabled
+ ? () {
+ HapticFeedback.selectionClick();
+ widget.onPressed!();
+ }
+ : null,
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(minHeight: 44),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Icon(widget.icon, size: 15, color: ink),
+ const SizedBox(width: 7),
+ TtyText(
+ widget.label,
+ color: ink,
+ size: OnboardingFrame.quietSize,
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
+
+/// The `·` between the lesser ways in.
+class _Dot extends StatelessWidget {
+ const _Dot();
+
+ @override
+ Widget build(BuildContext context) {
+ final tty = Tty.of(context);
+ return ExcludeSemantics(
+ child: TtyText('·', color: tty.dim, size: OnboardingFrame.quietSize),
+ );
+ }
+}
+
/// A line under the picture, in the status line's place: why an account's sign-in did not finish
/// (the terminal's red ✗), why a phone that was signed in is back here (the sign-out mark in its
/// yellow — not red: the person did nothing wrong, and signing in again is the whole of what to do),
diff --git a/mobile/lib/phone/welcome/scan_to_connect.dart b/mobile/lib/phone/welcome/scan_to_connect.dart
index a309b08e6..67a8e14d8 100644
--- a/mobile/lib/phone/welcome/scan_to_connect.dart
+++ b/mobile/lib/phone/welcome/scan_to_connect.dart
@@ -34,7 +34,7 @@ const kAddPhoneWhere = 'Harness menu → Add Phone';
/// (2) Click "Add Phone"
/// Harness menu → Add Phone
///
-/// Use email instead ([fallbackLabel])
+/// Use email instead ([fallbackLabel]; none without [onUseEmail])
/// ```
///
/// ⚠️ **Only the scan here (owner, 2026-10-08).** What has to happen on the computer first — get
@@ -46,12 +46,13 @@ const kAddPhoneWhere = 'Harness menu → Add Phone';
/// The camera runs only while this page is up. A code that is not ours is ignored, so a stray QR
/// in frame does nothing. A camera refused says where to turn it on, with a link to this app's
/// Settings, and the camera comes up on the way back; no camera at all says so. Either way the
-/// button under the square is the way in without one.
+/// button under the square is the way in without one — or, where there is none (the welcome's,
+/// which offers Continue with email beside QR code), back.
class ScanToConnectPage extends StatefulWidget {
const ScanToConnectPage({
super.key,
required this.onCode,
- required this.onUseEmail,
+ this.onUseEmail,
required this.onBack,
this.signingIn = false,
this.fallbackLabel = 'Use email instead',
@@ -87,7 +88,9 @@ class ScanToConnectPage extends StatefulWidget {
/// and the page scrolls where even that is not enough.
final Widget? steps;
- final VoidCallback onUseEmail;
+ /// [fallbackLabel] pressed. Null shows no way out under the camera but back: the welcome's
+ /// (owner, 2026-10-14), whose Continue with email sits right beside QR code.
+ final VoidCallback? onUseEmail;
final VoidCallback onBack;
/// A code was read and the phone is signing in with it.
@@ -320,18 +323,18 @@ class _ScanToConnectPageState extends State<ScanToConnectPage>
),
),
const Spacer(),
- const SizedBox(height: 20),
- Center(
- child: TtyTextButton(
- label: widget.fallbackLabel,
- color: tty.faint,
- // Not while the scan signs in: the other way would start a second.
- onPressed: widget.signingIn
- ? null
- : widget.onUseEmail,
+ if (widget.onUseEmail case final onUseEmail?) ...[
+ const SizedBox(height: 20),
+ Center(
+ child: TtyTextButton(
+ label: widget.fallbackLabel,
+ color: tty.faint,
+ // Not while the scan signs in: the other way would start a second.
+ onPressed: widget.signingIn ? null : onUseEmail,
+ ),
),
- ),
- const SizedBox(height: 12),
+ const SizedBox(height: 12),
+ ],
],
),
),
diff --git a/mobile/test/measurement_controls_test.dart b/mobile/test/measurement_controls_test.dart
index dd3482d52..08c7f317d 100644
--- a/mobile/test/measurement_controls_test.dart
+++ b/mobile/test/measurement_controls_test.dart
@@ -82,7 +82,9 @@ void main() {
picture.dispose();
});
}
- await tester.tap(find.byType(Checkbox));
+ // What is shared is said in ⓘ's tooltip, not under the line.
+ expect(find.byTooltip(SetupUsageChoice.detail), findsOneWidget);
+ await tester.tap(find.text(SetupUsageChoice.title));
await tester.pumpAndSettle();
expect(usage.signedOutSharing, isTrue);
await tester.ensureVisible(find.text('Partly completed'));
diff --git a/mobile/test/phone_edge/welcome_behavior_test.dart b/mobile/test/phone_edge/welcome_behavior_test.dart
index 9b1d32346..50c6eb5bd 100644
--- a/mobile/test/phone_edge/welcome_behavior_test.dart
+++ b/mobile/test/phone_edge/welcome_behavior_test.dart
@@ -88,11 +88,9 @@ void main() {
return (app: app, sent: sent);
}
- /// The emailed code's way in: Scan QR code, then the camera's "Use email instead".
+ /// The emailed code's way in: Continue with email, under the accounts.
Future<void> toEmail(WidgetTester tester) async {
- await tester.tap(find.byKey(const ValueKey('welcome-scan')));
- await frames(tester);
- await tester.tap(find.text('Use email instead'));
+ await tester.tap(find.byKey(const ValueKey('welcome-continue-email')));
await frames(tester);
}
diff --git a/mobile/test/phone_edge/welcome_layout_test.dart b/mobile/test/phone_edge/welcome_layout_test.dart
index f4d299515..6f0cc3cf8 100644
--- a/mobile/test/phone_edge/welcome_layout_test.dart
+++ b/mobile/test/phone_edge/welcome_layout_test.dart
@@ -71,10 +71,11 @@ void main() {
final app = edgeApp(noMachines: true);
addTearDown(app.dispose);
await pump(tester, welcome(app), scale, brightness);
- // The emailed code's way in: Scan QR code, then the camera's "Use email instead".
- await tapInView(tester, find.byKey(const ValueKey('welcome-scan')));
- await frames(tester);
- await tapInView(tester, find.text('Use email instead'));
+ // The emailed code's way in: Continue with email, under the accounts.
+ await tapInView(
+ tester,
+ find.byKey(const ValueKey('welcome-continue-email')),
+ );
await frames(tester);
await tester.enterText(
find.byType(TextField),
diff --git a/mobile/test/phone_welcome_first_screen_test.dart b/mobile/test/phone_welcome_first_screen_test.dart
index c922f3612..78eb692ac 100644
--- a/mobile/test/phone_welcome_first_screen_test.dart
+++ b/mobile/test/phone_welcome_first_screen_test.dart
@@ -12,9 +12,9 @@ import 'package:harness_mobile/phone/welcome/scan_to_connect.dart';
import 'package:harness_mobile/phone/welcome/sign_in_provider_button.dart';
import 'package:harness_mobile/state/app_state.dart';
-/// The first screen: ① Welcome — the promise, Scan QR code and the two accounts, and nothing else
-/// (`docs/research/2026-10-11-phone-onboarding`; owner, 2026-10-12). The emailed code is the
-/// camera's "Use email instead".
+/// The first screen: ① Welcome — the promise, the two accounts, and under them one quiet line:
+/// Continue with email · QR code (owner, 2026-10-14; it was Scan QR code first, then the two
+/// accounts, on 2026-10-12, `docs/research/2026-10-11-phone-onboarding`).
void main() {
group('ConnectCode', () {
test('reads the desktop app\'s link, all of it in the fragment', () {
@@ -93,9 +93,8 @@ void main() {
Rect picture(WidgetTester tester) =>
tester.getRect(find.byType(OnboardingPicture));
- TtyPrimaryButton scan(WidgetTester tester) => tester.widget<TtyPrimaryButton>(
- find.byKey(const ValueKey('welcome-scan')),
- );
+ final email = find.byKey(const ValueKey('welcome-continue-email'));
+ final scan = find.byKey(const ValueKey('welcome-scan'));
SignInProviderButton account(WidgetTester tester, SignInProvider provider) =>
tester
@@ -103,7 +102,7 @@ void main() {
.firstWhere((button) => button.provider == provider);
testWidgets(
- 'the promise, Scan QR code and the two accounts — and nothing else',
+ 'the promise, the two accounts, then Continue with email · QR code — and nothing else',
(tester) async {
await pump(tester);
expect(find.text(OnboardingCopy.welcome), findsOneWidget);
@@ -111,20 +110,28 @@ void main() {
tester.widget<OnboardingPicture>(find.byType(OnboardingPicture)).scene,
OnboardingScene.welcome,
);
- expect(find.text(OnboardingCopy.scanQrCode), findsOneWidget);
expect(find.text('Continue with Google'), findsOneWidget);
expect(find.text('Continue with Apple'), findsOneWidget);
- // The emailed code is the camera's, not this screen's.
- expect(find.text(OnboardingCopy.continueWithEmail), findsNothing);
- // Scan QR code first, then Google, then Apple.
- expect(
- tester.getTopLeft(find.text(OnboardingCopy.scanQrCode)).dy,
- lessThan(tester.getTopLeft(find.text('Continue with Google')).dy),
- );
+ expect(find.text(OnboardingCopy.continueWithEmail), findsOneWidget);
+ expect(find.text(OnboardingCopy.qrCode), findsOneWidget);
+ // The camera's long name is what a screen reader hears, not what the line says.
+ expect(find.text(OnboardingCopy.scanQrCode), findsNothing);
+ // Only the accounts are buttons; the lesser ways in are words.
+ expect(find.byType(TtyPrimaryButton), findsNothing);
+ // Google, then Apple, then the quiet line — email and QR code side by side on it.
expect(
tester.getTopLeft(find.text('Continue with Google')).dy,
lessThan(tester.getTopLeft(find.text('Continue with Apple')).dy),
);
+ expect(
+ tester.getTopLeft(find.text('Continue with Apple')).dy,
+ lessThan(tester.getTopLeft(email).dy),
+ );
+ expect(tester.getCenter(email).dy, tester.getCenter(scan).dy);
+ expect(
+ tester.getCenter(email).dx,
+ lessThan(tester.getCenter(scan).dx),
+ );
// Not the camera, the sample, or the steps on the computer of the first screen before it.
expect(find.byType(ScanToConnectPage), findsNothing);
@@ -148,20 +155,28 @@ void main() {
notifier.notifyListeners();
await tester.pump();
expect(find.text('Waiting for Google…'), findsOneWidget);
+ // Cancel takes the quiet line's place: email and the camera could not be pressed now.
expect(find.byKey(const ValueKey('welcome-cancel')), findsOneWidget);
- // The other account, and the camera, wait it out.
+ expect(email, findsNothing);
+ expect(scan, findsNothing);
+ // The other account waits it out.
expect(account(tester, SignInProvider.apple).onPressed, isNull);
- expect(scan(tester).onPressed, isNull);
// The foot is the same height whatever it says: the picture has not moved.
expect(picture(tester), before);
- // Past the page, going in: nothing left to cancel, and a scan cannot sign in behind it.
+ // Past the page, going in: nothing left to cancel; the quiet line is back, and neither an
+ // email nor a scan can sign in behind it.
notifier.status = AppStatus.bootstrapping;
notifier.notifyListeners();
await tester.pump();
expect(find.text('Signing in…'), findsOneWidget);
expect(find.byKey(const ValueKey('welcome-cancel')), findsNothing);
- expect(scan(tester).onPressed, isNull);
+ await tester.tap(scan);
+ await tester.pump();
+ expect(find.byType(ScanToConnectPage), findsNothing);
+ await tester.tap(email);
+ await tester.pump();
+ expect(find.text('Your email'), findsNothing);
expect(picture(tester), before);
},
);
@@ -182,15 +197,26 @@ void main() {
expect(picture(tester), before);
});
- testWidgets('the emailed code: the address, then the four digits, and back', (
+ testWidgets('QR code: the camera, with no "Use email instead" — back is the way out', (
tester,
) async {
await pump(tester);
- // Through the camera: Scan QR code, then its "Use email instead".
- await tester.tap(find.byKey(const ValueKey('welcome-scan')));
+ await tester.tap(scan);
await tester.pump();
expect(find.byType(ScanToConnectPage), findsOneWidget);
- await tester.tap(find.text('Use email instead'));
+ // Continue with email is beside QR code on the welcome, one back away (owner, 2026-10-14).
+ expect(find.text('Use email instead'), findsNothing);
+ await tester.binding.handlePopRoute();
+ await tester.pump();
+ expect(find.text(OnboardingCopy.welcome), findsOneWidget);
+ expect(email, findsOneWidget);
+ });
+
+ testWidgets('the emailed code: the address, then the four digits, and back', (
+ tester,
+ ) async {
+ await pump(tester);
+ await tester.tap(email);
await tester.pump();
expect(find.text('Your email'), findsOneWidget);
diff --git a/mobile/test/render/phone_screens_render_test.dart b/mobile/test/render/phone_screens_render_test.dart
index fbb776706..3ec9d84a3 100644
--- a/mobile/test/render/phone_screens_render_test.dart
+++ b/mobile/test/render/phone_screens_render_test.dart
@@ -369,7 +369,7 @@ void main() {
/// The welcome's quiet line: the emailed code.
Future<void> toEmail(WidgetTester tester) async {
- await tester.tap(find.byKey(const ValueKey('welcome-email-way')));
+ await tester.tap(find.byKey(const ValueKey('welcome-continue-email')));
await tester.pump(const Duration(milliseconds: 300));
}