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): reopen a dismissed link prompt, and hold any agent row

tony559661b5f46c
diff --git a/mobile/lib/phone/agent_row.dart b/mobile/lib/phone/agent_row.dart
index 1984995bb..b5bbbfbe1 100644
--- a/mobile/lib/phone/agent_row.dart
+++ b/mobile/lib/phone/agent_row.dart
@@ -13,17 +13,28 @@ import 'status_pill.dart';
/// it names the MACHINE, because this list mixes them and a name alone is ambiguous the moment two
/// machines both have a `main` or a `docs` agent.
class AgentRow extends StatelessWidget {
- const AgentRow({super.key, required this.entry, required this.onTap});
+ const AgentRow({
+ super.key,
+ required this.entry,
+ required this.onTap,
+ this.onLongPress,
+ });
final AgentEntry entry;
final VoidCallback onTap;
+ /// The row's `⋯`, held rather than tapped — the same door [AgentTile] opens on a machine's own
+ /// page. Optional for the same reason it is there: a row that cannot be OPENED can still be
+ /// acted on, and an agent whose terminal has gone is exactly the one somebody wants to delete.
+ final VoidCallback? onLongPress;
+
@override
Widget build(BuildContext context) {
AppTheme.watch(context);
final agent = entry.agent;
return PhoneCard(
onTap: agent.terminalAvailable ? onTap : null,
+ onLongPress: onLongPress,
// A rim in the attention colour, so a waiting agent is findable in a long list without
// reading a word of it — the list's whole job on a phone.
border: entry.isWaiting
diff --git a/mobile/lib/phone/agents_tab.dart b/mobile/lib/phone/agents_tab.dart
index 893031d30..a346dc94f 100644
--- a/mobile/lib/phone/agents_tab.dart
+++ b/mobile/lib/phone/agents_tab.dart
@@ -6,6 +6,7 @@ import 'package:harness_mobile/shared/widgets/empty_state.dart';
import 'package:harness_mobile/state/app_state.dart';
import 'agent_index.dart';
import 'agent_row.dart';
+import 'agents_page.dart';
import 'account_button.dart';
import 'machine_filter_bar.dart';
import 'phone_card.dart';
@@ -188,6 +189,11 @@ class _Body extends StatelessWidget {
// The whole visible list goes with the tap, so the page opens as a pager over exactly the
// agents on screen — the filter chip included. Swiping there walks this order.
onTap: () => openAgentPager(context, notifier, ordered, entry),
+ // The same sheet a machine's own page opens, from [AgentsPage] rather than written again
+ // here: one agent reached two ways must not offer two different sets of actions, and the
+ // delete wording in particular is the one that has to match.
+ onLongPress: () =>
+ showAgentActions(context, notifier, entry.machineId, entry.agent),
),
);
}
diff --git a/mobile/lib/phone/link_page.dart b/mobile/lib/phone/link_page.dart
index 50c155288..e8cb70edb 100644
--- a/mobile/lib/phone/link_page.dart
+++ b/mobile/lib/phone/link_page.dart
@@ -25,6 +25,9 @@ class LinkPage extends StatefulWidget {
class _LinkPageState extends State<LinkPage> {
/// The form's Close marks the prompt dismissed. One already dismissed before this page opened
/// must not shut the page on its first frame.
+ ///
+ /// Always false in practice now that [initState] clears the mark — kept as the guard it is, so
+ /// the rule below still reads on its own if that ever stops being true.
late final bool _dismissedBefore = widget.notifier.isLinkPromptDismissed(
widget.machineId,
);
@@ -33,6 +36,12 @@ class _LinkPageState extends State<LinkPage> {
@override
void initState() {
super.initState();
+ // Opening this page IS the person asking for the form — the machine tile, the padlock empty
+ // state, the machine sheet's "Re-enter password…". Without clearing the mark, a machine whose
+ // form was Closed once could never be reached again: [_follow] reads the mark on its first
+ // run and pops the page on the frame it opened. The desktop fixes the same bug the same way
+ // (`revisitLinkPrompt`, 051ea5b), where the reactive gates check the mark before calling.
+ widget.notifier.revisitLinkPrompt(widget.machineId);
widget.notifier.addListener(_follow);
}