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): update terminal UI controls and enhance Android edge-to-edge support

Dev jacob278d2e2f3009
diff --git a/mobile/lib/main.dart b/mobile/lib/main.dart
index 28aca1284..505d71e98 100644
--- a/mobile/lib/main.dart
+++ b/mobile/lib/main.dart
@@ -1,3 +1,9 @@
+import 'dart:async';
+import 'dart:io' show Platform;
+
+import 'package:flutter/services.dart';
+import 'package:flutter/widgets.dart';
+
import 'app_shell.dart';
import 'p2p/phone_terminal_p2p.dart';
import 'phone/phone_shell.dart';
@@ -20,7 +26,35 @@ import 'phone/phone_shell.dart';
/// It also brings its own second wire to each machine: the WebRTC data channel
/// the harness CLI opens on the desktop's behalf (`lib/p2p/`), so a terminal
/// rides p2p or TURN when it can and the relay only when it must.
-Future<void> main() => startHarness(
- authenticatedScreen: (app) => PhoneShell(notifier: app),
- transportPlugins: phoneTerminalP2p.create,
-);
+Future<void> main() {
+ _drawEdgeToEdgeOnEveryAndroid();
+ return startHarness(
+ authenticatedScreen: (app) => PhoneShell(notifier: app),
+ transportPlugins: phoneTerminalP2p.create,
+ );
+}
+
+/// Draw behind the status and navigation bars on every Android version, not only the new ones.
+///
+/// ⚠️ **Android 15 already does this, and that is exactly the problem.** Targeting SDK 35+ makes
+/// edge-to-edge mandatory from Android 15 on, so the layout has handled the system insets for a
+/// while — but on Android 14 and below nothing opted in, and the same screens sat between two opaque
+/// bars instead. Play Console flags that split ("some users may not see edge-to-edge"); this is the
+/// opt-in Flutter documents for it. Transparent bars, so what shows through is the app's own
+/// background rather than the theme's black strip; the navigation bar keeps the system's contrast
+/// scrim where the device uses three-button navigation.
+///
+/// Not on iOS, which has always drawn under its bars and has no mode to switch. Not awaited: it is
+/// a platform message the first frame does not depend on, and [startHarness] times the launch from
+/// its own first line.
+void _drawEdgeToEdgeOnEveryAndroid() {
+ if (!Platform.isAndroid) return;
+ WidgetsFlutterBinding.ensureInitialized();
+ unawaited(SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge));
+ SystemChrome.setSystemUIOverlayStyle(
+ const SystemUiOverlayStyle(
+ statusBarColor: Color(0x00000000),
+ systemNavigationBarColor: Color(0x00000000),
+ ),
+ );
+}
diff --git a/mobile/lib/phone/terminal_action_column.dart b/mobile/lib/phone/terminal_action_column.dart
index db1f405df..d0cf38a9e 100644
--- a/mobile/lib/phone/terminal_action_column.dart
+++ b/mobile/lib/phone/terminal_action_column.dart
@@ -12,18 +12,17 @@ import 'voice_mic_fab.dart';
import 'voice_status_pill.dart';
/// The terminal's floating controls, stacked in its bottom-right corner:
-/// the mic, then Search, then New agent.
+/// the mic, then Search.
///
/// ```
/// ( Listening… × ) (🎤)
/// (🔍)
-/// (+)
/// ```
///
/// ⚠️ **The mic is on top, and that is what "moved up" means.** It used to sit
-/// alone in the corner, over the agent's own status line; Search and New agent
-/// now take the corner under it, and the mic rides above them. The three share
-/// one column so they read as one set of controls rather than three strays.
+/// alone in the corner, over the agent's own status line; Search now takes the
+/// corner under it, and the mic rides above. The two share one column so they
+/// read as one set of controls rather than two strays.
///
/// ⚠️ **The gaps are set by the mic's hit area, not by the look.** The mic's
/// target spills [VoiceMicButton.touchOverhang] past its slot on every side and
@@ -36,7 +35,6 @@ class TerminalActionColumn extends StatelessWidget {
required this.voice,
required this.session,
required this.onSearch,
- required this.onNewAgent,
});
final VoiceInputController voice;
@@ -47,14 +45,6 @@ class TerminalActionColumn extends StatelessWidget {
final VoidCallback onSearch;
- /// Null when the machine cannot host a new agent right now — offline, still
- /// asking for its password, or not loaded yet after a restart.
- ///
- /// ⚠️ **Drawn dimmed, never left out.** All three buttons are always there:
- /// a `+` that came and went with the machine's state made the column jump,
- /// and read as a missing button rather than one not ready yet.
- final VoidCallback? onNewAgent;
-
/// The column's width: the mic's slot, which the smaller buttons centre under.
static const double width = VoiceMicButton.extent;
@@ -62,7 +52,7 @@ class TerminalActionColumn extends StatelessWidget {
static const double inset = VoiceMicFab.inset;
/// How far the column sits above the terminal's bottom edge — higher than
- /// [inset], so the `+` clears the agent's own status line under it.
+ /// [inset], so Search clears the agent's own status line under it.
static const double bottomInset = 172;
/// The DRAWN gap between one circle and the next, the same all the way down.
@@ -77,14 +67,11 @@ class TerminalActionColumn extends StatelessWidget {
static const double _underMic =
_gap - (VoiceMicButton.extent - VoiceMicCore.diameter) / 2;
- /// Between Search and New agent: circles in slots of their own size.
- static const double _between = _gap;
-
@override
Widget build(BuildContext context) {
AppTheme.watch(context);
final session = this.session;
- // One backdrop read for the three buttons' blurs — see [FloatingGlass].
+ // One backdrop read for the buttons' blurs — see [FloatingGlass].
return BackdropGroup(child: _column(context, session));
}
@@ -126,15 +113,6 @@ class TerminalActionColumn extends StatelessWidget {
onTap: onSearch,
),
),
- const SizedBox(height: _between),
- _centred(
- TerminalRoundAction(
- key: const ValueKey('terminal-new-agent'),
- icon: LucideIcons.plus300,
- label: 'New Harness',
- onTap: onNewAgent,
- ),
- ),
],
);
}
@@ -196,7 +174,7 @@ class TerminalRoundAction extends StatelessWidget {
child: SizedBox.square(
dimension: touchExtent,
child: AnimatedOpacity(
- // The mic's dimmed opacity, so the three read alike.
+ // The mic's dimmed opacity, so they read alike.
duration: const Duration(milliseconds: 160),
opacity: live ? 1 : 0.4,
child: Center(
diff --git a/mobile/lib/phone/terminal_page.dart b/mobile/lib/phone/terminal_page.dart
index 5ba4023b1..c2b224bcb 100644
--- a/mobile/lib/phone/terminal_page.dart
+++ b/mobile/lib/phone/terminal_page.dart
@@ -29,7 +29,6 @@ import 'package:harness_mobile/widgets/terminal_panel.dart';
import 'agent_model_sections.dart';
import 'agent_model_sheet.dart';
import 'agents_list_page.dart';
-import 'agents_page.dart' show openNewAgent;
import 'delete_agent.dart';
import 'held_height.dart';
import 'machines_tab.dart';
@@ -632,19 +631,10 @@ class _TerminalPageState extends State<TerminalPage>
super.dispose();
}
- /// Opens the machine's new-agent form.
- ///
- /// Awaited: the form may be backed out of rather than completed, and this page
- /// gets no rebuild when it lands back on top.
- Future<void> _newAgent() async {
- await openNewAgent(context, widget.notifier, widget.machineId);
- if (mounted) setState(() {});
- }
-
/// Opens the account-wide agent list.
///
- /// Awaited for the same reason [_newAgent] is: the list is backed out of as often as it is tapped
- /// through, and this page gets no rebuild when it lands back on top.
+ /// Awaited: the list is backed out of as often as it is tapped through, and
+ /// this page gets no rebuild when it lands back on top.
Future<void> _openAgentList() async {
await Navigator.of(context)
.push(phoneRoute((_) => AgentsListPage(notifier: widget.notifier)));
@@ -1129,12 +1119,6 @@ class _TerminalPageState extends State<TerminalPage>
takerName: takerName,
reconnecting: reconnecting,
);
- // Creating needs the machine to list its folders and name its engines,
- // so one that is offline or still wants its password cannot host a new
- // agent — the same gate the Agents tab puts on its fab.
- final canCreate =
- machine != null &&
- phoneMachineStatusOf(machine) == PhoneMachineStatus.ready;
// Read this page's own buffer for a dialog, and raise the keyboard when one
// appears. Must run on every build: the session arrives a frame or two
// after the page, and the engine with the agent.
@@ -1347,7 +1331,7 @@ class _TerminalPageState extends State<TerminalPage>
Positioned.fill(
child: _Attaching(key: _skeletonKey),
),
- // The mic, Search and New agent, floating in the
+ // The mic and Search, floating in the
// terminal's bottom-right corner — see
// [TerminalActionColumn].
//
@@ -1364,9 +1348,6 @@ class _TerminalPageState extends State<TerminalPage>
voice: widget.voice,
session: session,
onSearch: _openSearch,
- onNewAgent: canCreate
- ? () => unawaited(_newAgent())
- : null,
),
),
],