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.

mobile: the unread mark goes red, and moves to the end of the row

bubu-dudub274d4fdb0f7
diff --git a/mobile/lib/notify/unread_marks.dart b/mobile/lib/notify/unread_marks.dart
index b455d78cb..250457974 100644
--- a/mobile/lib/notify/unread_marks.dart
+++ b/mobile/lib/notify/unread_marks.dart
@@ -6,30 +6,67 @@ import 'agent_notice.dart';
import 'agent_unread.dart';
/// A mark's colour says what the news is: amber for an agent waiting on you —
-/// the phone's "Waiting for you" tone — and the accent for one that finished.
+/// the phone's "Waiting for you" tone — and red for one that finished.
+///
+/// ⚠️ **Red rather than the accent, which is what this used to be.** The accent
+/// is the app's ordinary indigo: it is on the selected tab, the send button, the
+/// links in the output — so a dot wearing it was the same blue as half the
+/// furniture around it, and it read as decoration rather than as news.
+///
+/// ⚠️ **[AppPalette.dangerFill] and not the theme's error ink, though this is a
+/// mark and not a fill.** It is both: [UnreadCountBadge] paints the same colour
+/// as a pill UNDER white lettering, and `dangerFill` is the app's one red
+/// measured for exactly that (5.38:1 in dark, 6.54:1 in light — see its note).
+/// `colorScheme.error` is tuned as ink on a dark surface and leaves white on it
+/// at 3.42:1, so a count pill in it would fail where the dot would pass.
+///
+/// The name is about where that red came from, not about what it means here:
+/// nothing on this row is destructive.
Color unreadColor(NoticeKind kind) => switch (kind) {
NoticeKind.question => AppPalette.warn,
- NoticeKind.done => AppPalette.accent,
+ NoticeKind.done => AppPalette.dangerFill,
};
/// The mark on one agent's row: it finished, or asked something, while you
/// were elsewhere.
///
-/// The row's own unread dot, iOS Mail's — small, before the name, so it reads
-/// before the name does and never pushes anything else off.
+/// ⚠️ **Where it sits is the CALLER's, and the two callers differ.** A tab chip
+/// keeps it in front of the label, iOS Mail's placement: the strip is a row of
+/// pills, and a mark inside one belongs to that pill wherever it is put.
+///
+/// An agent row does not. It used to lead the title there too, which pushed
+/// every name 15pt right and broke the left edge the name shared with the two
+/// lines under it — a column gone ragged for a mark that is usually absent. The
+/// dot now takes the slot at the row's far end, the one that spins while the
+/// agent works (`SheetAgentStatus`): a place the eye already checks for what a
+/// row is doing, and the only place on the row where nothing else moves when a
+/// mark appears.
+///
+/// So the dot carries no margin of its own — each caller spaces it — and no
+/// single size: see [leading] and [trailing].
class UnreadDot extends StatelessWidget {
- const UnreadDot({super.key, required this.kind});
+ const UnreadDot({super.key, required this.kind, this.diameter = leading});
final NoticeKind kind;
- static const double diameter = 8;
+ final double diameter;
+
+ /// In front of a tab chip's label, where it has the pill to itself.
+ static const double leading = 8;
+
+ /// After an agent row's title.
+ ///
+ /// ⚠️ Larger than [leading], and it has to be: a dot that LEADS is found by
+ /// scanning a column of them, where 8pt is plenty. This one sits at the end of
+ /// a line already carrying a name, a separator and an age — at 8pt it read as
+ /// punctuation after the time rather than as a mark of its own.
+ static const double trailing = 11;
@override
Widget build(BuildContext context) => Container(
key: const ValueKey('unread-dot'),
width: diameter,
height: diameter,
- margin: const EdgeInsets.only(right: 7),
decoration: BoxDecoration(color: unreadColor(kind), shape: BoxShape.circle),
);
}
diff --git a/mobile/lib/phone/desk_tab_strip.dart b/mobile/lib/phone/desk_tab_strip.dart
index d72b17e57..85ba25fef 100644
--- a/mobile/lib/phone/desk_tab_strip.dart
+++ b/mobile/lib/phone/desk_tab_strip.dart
@@ -347,9 +347,18 @@ class _DeskTabPill extends StatelessWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
- // Before the name, as on the agent rows below it: the same
- // mark in the same place, one level up.
- if (unread case final kind?) UnreadDot(kind: kind),
+ // ⚠️ Before the name here, where the agent rows below put it at
+ // their far end — see [UnreadDot]. A pill is read as one thing,
+ // so the mark belongs to it wherever it sits; a column of rows
+ // is not, and a leading dot there moved every name.
+ //
+ // The gap is the caller's: the dot carries no margin, because
+ // the two placements need it on opposite sides.
+ if (unread case final kind?)
+ Padding(
+ padding: const EdgeInsets.only(right: 7),
+ child: UnreadDot(kind: kind),
+ ),
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: _maxLabelWidth),
child: Text(
diff --git a/mobile/lib/phone/desk_tabs_panel.dart b/mobile/lib/phone/desk_tabs_panel.dart
index 64d8293be..b79625867 100644
--- a/mobile/lib/phone/desk_tabs_panel.dart
+++ b/mobile/lib/phone/desk_tabs_panel.dart
@@ -419,7 +419,7 @@ class DeskAgentRow extends StatelessWidget {
final AgentEntry entry;
- /// Its news nobody has gone to yet — see [SheetAgentTitle.unread].
+ /// Its news nobody has gone to yet — see [SheetAgentStatus.unread].
final NoticeKind? unread;
/// The agent on screen. It keeps its row — it is the one you came from, and
@@ -449,7 +449,6 @@ class DeskAgentRow extends StatelessWidget {
title: SheetAgentTitle(
entry: entry,
now: DateTime.now(),
- unread: unread,
name: Text(
agent.displayName,
maxLines: 1,
@@ -458,7 +457,11 @@ class DeskAgentRow extends StatelessWidget {
),
),
subtitle: SheetAgentMeta(entry: entry),
- trailing: SheetAgentStatus(summary: entry.summary, onScreen: onScreen),
+ trailing: SheetAgentStatus(
+ summary: entry.summary,
+ onScreen: onScreen,
+ unread: unread,
+ ),
chevron: !onScreen,
);
}
diff --git a/mobile/lib/phone/sheet_agent_lines.dart b/mobile/lib/phone/sheet_agent_lines.dart
index 1296fe8cb..80ab79651 100644
--- a/mobile/lib/phone/sheet_agent_lines.dart
+++ b/mobile/lib/phone/sheet_agent_lines.dart
@@ -3,8 +3,6 @@ import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:harness_mobile/core/agent_output_stats.dart';
import 'package:harness_mobile/core/models.dart';
-import 'package:harness_mobile/notify/agent_notice.dart';
-import 'package:harness_mobile/notify/unread_marks.dart';
import 'package:harness_mobile/shared/theme/app_theme.dart';
import 'agent_index.dart';
@@ -62,15 +60,10 @@ class SheetAgentTitle extends StatelessWidget {
required this.entry,
required this.name,
required this.now,
- this.unread,
});
final AgentEntry entry;
- /// The news this agent carries that nobody has gone to yet — a finished
- /// turn or a question — or null. Marked with an [UnreadDot] before the name.
- final NoticeKind? unread;
-
/// The name as the caller draws it — plain in the tabs, with the query's hits in bold in search.
final Widget name;
@@ -83,7 +76,9 @@ class SheetAgentTitle extends StatelessWidget {
final attention = agentAttention(entry);
return Row(
children: [
- if (unread case final kind?) UnreadDot(kind: kind),
+ // ⚠️ The unread mark used to lead this row and no longer does: it is at
+ // the row's other end now, in the slot that spins while the agent works
+ // — see [SheetAgentStatus].
Flexible(child: name),
if (activity != null)
Padding(
diff --git a/mobile/lib/phone/sheet_list.dart b/mobile/lib/phone/sheet_list.dart
index 35f0a0fe0..4b8424942 100644
--- a/mobile/lib/phone/sheet_list.dart
+++ b/mobile/lib/phone/sheet_list.dart
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
+import 'package:harness_mobile/notify/agent_notice.dart';
+import 'package:harness_mobile/notify/unread_marks.dart';
import 'package:harness_mobile/shared/theme/app_theme.dart';
import 'package:harness_mobile/widgets/engine_identity.dart';
@@ -421,10 +423,23 @@ class SheetAgentStatus extends StatelessWidget {
super.key,
required this.summary,
this.onScreen = false,
+ this.unread,
});
final PhoneSummary summary;
+ /// News nobody has gone to yet — a turn finished, or a question asked, while
+ /// the person was elsewhere. Drawn here as an [UnreadDot].
+ ///
+ /// ⚠️ **It takes this slot from the spinner rather than sitting beside it.**
+ /// One mark at the end of a row is read at a glance; two are a pair to be
+ /// told apart, on a row whose other two lines are already full. And the
+ /// clash is rarer than it looks — an agent carries unread news because it
+ /// STOPPED, so it is almost never spinning at the same time. When it is, the
+ /// news is what somebody needs to be sent to; that it has since picked up
+ /// more work is on the screen the dot takes them to.
+ final NoticeKind? unread;
+
/// The agent this sheet was opened over: it says so, and nothing else —
/// whatever it is doing is on the screen behind the sheet.
final bool onScreen;
@@ -439,6 +454,9 @@ class SheetAgentStatus extends StatelessWidget {
color: AppPalette.accentOnSurface,
);
}
+ if (unread case final kind?) {
+ return UnreadDot(kind: kind, diameter: UnreadDot.trailing);
+ }
return switch (summary.tone) {
PhoneTone.busy || PhoneTone.attention => StatusDot(
summary: summary,