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.

fix(mobile): Set up Intern 3 from Computers goes back to that list when done (#2351)

Bubu-Dudu-52hz1be7f71441a6
diff --git a/mobile/lib/phone/add_device/add_device_page.dart b/mobile/lib/phone/add_device/add_device_page.dart
index 1dd7be4fd..97b89c9e0 100644
--- a/mobile/lib/phone/add_device/add_device_page.dart
+++ b/mobile/lib/phone/add_device/add_device_page.dart
@@ -29,11 +29,20 @@ import 'setup_hotspot.dart';
/// for the computer's password first; opened, it starts, and its hotspot comes back for the rest.
/// One on a cable is online already: it is only signed in, with no Wi-Fi to choose.
class AddDevicePage extends StatefulWidget {
- const AddDevicePage({super.key, required this.notifier, this.hotspot});
+ const AddDevicePage({
+ super.key,
+ required this.notifier,
+ this.hotspot,
+ this.overComputers = false,
+ });
final AppNotifier notifier;
final SetupHotspot? hotspot;
+ /// Pushed over Computers (its Set up Intern 3): done, it goes back to that list rather than
+ /// putting a second one over it, so back from there still reaches what opened Computers.
+ final bool overComputers;
+
@override
State<AddDevicePage> createState() => _AddDevicePageState();
}
@@ -727,6 +736,11 @@ class _AddDevicePageState extends State<AddDevicePage> {
if (!_alreadyHere) _app.markMachineNew(machine.machineId);
}
if (!mounted) return;
+ if (widget.overComputers) {
+ // Its row reads "new", with Start on it, in the list underneath.
+ Navigator.of(context).pop();
+ return;
+ }
await Navigator.of(context).pushReplacement(
phoneRoute(
// Its row reads "new", with Start on it.
diff --git a/mobile/lib/phone/machines_tab.dart b/mobile/lib/phone/machines_tab.dart
index 11350742d..d8a7c1cc5 100644
--- a/mobile/lib/phone/machines_tab.dart
+++ b/mobile/lib/phone/machines_tab.dart
@@ -545,7 +545,10 @@ class _ConnectBarState extends State<_ConnectBar> {
label: 'Set up Intern 3',
onPressed: () => Navigator.of(context).push(
phoneRoute(
- (_) => AddDevicePage(notifier: widget.notifier),
+ (_) => AddDevicePage(
+ notifier: widget.notifier,
+ overComputers: true,
+ ),
),
),
),