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.

Desktop: Swarm chat with round 28 faces, quiet message lines and a composer that matches Cmd-N (#4467) (#3540)

0xken15c2a573d33f5a
diff --git a/desktop/design/desktop-design-system.md b/desktop/design/desktop-design-system.md
index 1215b3fda..4e367deac 100644
--- a/desktop/design/desktop-design-system.md
+++ b/desktop/design/desktop-design-system.md
@@ -482,6 +482,19 @@ on it (anh Dee, 2026-11-07, task #4465). Every element below follows them.
lines, and two 18 faces: who asked, then who is doing it. Only while the
task waits for the reader: Decline as plain text and Accept as the blue
capsule, on the right.
+- **Chat message.** A message row (`SuperTabMessageRow`) leads with a round
+ 28 face, then one header line: the name at 13 semibold and the time at 12
+ in tertiary ink (`textFaint`), nothing else; no engine mark, since colour
+ is only the face's. The text reads at 14 on 20 px lines (`SwarmType`).
+ An empty chat shows no line; only a chat that can't be read or is still
+ loading says so (task #4467).
+- **Chat composer.** Both composers (the chat's and a thread's) are Cmd-N's
+ field: radius 12, a hairline (`rim`) and the faint fill (`field`). Under
+ the text, the paperclip on the left and, on the right, the mic beside the
+ round send (`SwarmSendButton`, `super_tabs/chat/send_button.dart`): a 28
+ circle in a 32 target, `rim` with a `textFaint` arrow while there is
+ nothing to send, `AppPalette.accent` with a white (`onSelection`) arrow
+ once there is text or a file. No @ button: an @ typed tags.
- **Decision card.** One question (`SuperTabDecisionCard`, in the Buddy chat
and Notifications; the Decisions page row uses the same buttons): the
question, `Unblocks:` line, one button per option with the recommended one
diff --git a/desktop/lib/shared/theme/app_theme.dart b/desktop/lib/shared/theme/app_theme.dart
index d70ec0314..0886444c5 100644
--- a/desktop/lib/shared/theme/app_theme.dart
+++ b/desktop/lib/shared/theme/app_theme.dart
@@ -1559,11 +1559,11 @@ abstract final class AppDesktop {
static const double groupGap = 16;
static const double controlGap = 8;
- /// The Swarm composer's box, as the phone draws it (Huy, 11-04): the
- /// phone's corners (`SwarmComposer.cardRadius`), the text [composerTop]
- /// below the top and [composerSide] in from each side, and [composerRowGap]
- /// between the text and the row of actions under it.
- static const double composerRadius = 24;
+ /// The Swarm composer's box, as the phone draws it (Huy, 11-04): the text
+ /// [composerTop] below the top and [composerSide] in from each side, and
+ /// [composerRowGap] between the text and the row of actions under it. Its
+ /// corners are Cmd-N's field's (anh Dee, 11-07, #4467).
+ static const double composerRadius = 12;
static const double composerTop = 12;
static const double composerSide = groupGap;
static const double composerRowGap = 12;
@@ -1577,10 +1577,9 @@ abstract final class AppDesktop {
static const double iconSize = 16;
static const double identitySize = 28;
- /// A chat or thread message's avatar: a rounded square, as Slack draws one
- /// (Huy, 2026-11-03). Avatars elsewhere stay round.
- static const double messageAvatarSize = 36;
- static const double messageAvatarRadius = 8;
+ /// A chat or thread message's face: round at 28, as every other avatar
+ /// (anh Dee, 11-07, #4467; was Slack's 36 rounded square).
+ static const double messageAvatarSize = 28;
static const double formWidth = 460;
static const double focusWidth = 1.5;
diff --git a/desktop/lib/super_tabs/chat/send_button.dart b/desktop/lib/super_tabs/chat/send_button.dart
new file mode 100644
index 000000000..c9cf71bdd
--- /dev/null
+++ b/desktop/lib/super_tabs/chat/send_button.dart
@@ -0,0 +1,71 @@
+import 'package:flutter/material.dart';
+
+import '../../shared/theme/app_icons.dart';
+import '../../shared/theme/app_theme.dart' as grid;
+import '../../widgets/desktop_chrome.dart';
+
+/// A chat composer's send: a round 28-point button in the row's 32-point
+/// target, grey while there is nothing to send and blue once there is, the
+/// one blue in the composer (anh Dee, 11-07, #4467: blue only for the main
+/// action). Its circle is keyed `swarm-send-fill`.
+class SwarmSendButton extends StatelessWidget {
+ const SwarmSendButton({
+ super.key,
+ required this.tooltip,
+ required this.onPressed,
+ });
+
+ final String tooltip;
+
+ /// Null while there is nothing to send, or it can't go now.
+ final VoidCallback? onPressed;
+
+ static const double size = 28;
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ final ready = onPressed != null;
+ return Tooltip(
+ message: tooltip,
+ child: Semantics(
+ button: true,
+ enabled: ready,
+ child: SizedBox.square(
+ dimension: grid.AppControl.height,
+ child: Center(
+ child: Material(
+ type: MaterialType.transparency,
+ child: InkWell(
+ customBorder: const CircleBorder(),
+ onTap: onPressed,
+ mouseCursor: ready
+ ? SystemMouseCursors.click
+ : SystemMouseCursors.basic,
+ child: DecoratedBox(
+ key: const ValueKey('swarm-send-fill'),
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: ready ? grid.AppPalette.accent : DesktopChrome.rim,
+ ),
+ child: SizedBox.square(
+ dimension: size,
+ child: Center(
+ child: Icon(
+ AppIcons.arrowUp,
+ size: AppIcons.inlineSize,
+ color: ready
+ ? DesktopChrome.onSelection
+ : DesktopChrome.hint,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/desktop/lib/super_tabs/composer_actions.dart b/desktop/lib/super_tabs/composer_actions.dart
index f12ab0f03..6dd462ed9 100644
--- a/desktop/lib/super_tabs/composer_actions.dart
+++ b/desktop/lib/super_tabs/composer_actions.dart
@@ -34,21 +34,6 @@ EdgeInsets composerFieldInsets({required double target}) => EdgeInsets.fromLTRB(
),
);
-/// @ Tag on a composer's row, as on the phone: it types `@` at the caret
-/// ([superTabTagPrompt]), and the tag list opens as for one typed.
-class SuperTabComposerTagButton extends StatelessWidget {
- const SuperTabComposerTagButton({super.key, required this.onPressed});
-
- final VoidCallback? onPressed;
-
- @override
- Widget build(BuildContext context) => AppIconButton(
- icon: AppIcons.atSign,
- tooltip: 'Tag someone',
- onPressed: onPressed,
- );
-}
-
/// The mic left of send: starts a voice message (voice_recorder.dart). A
/// composer draws it only with a recorder.
class SuperTabComposerMic extends StatelessWidget {
diff --git a/desktop/lib/super_tabs/composer_tags.dart b/desktop/lib/super_tabs/composer_tags.dart
index b4357c762..d41f1eb42 100644
--- a/desktop/lib/super_tabs/composer_tags.dart
+++ b/desktop/lib/super_tabs/composer_tags.dart
@@ -121,22 +121,6 @@ List<SuperTabComposerChoice> superTabTagChoices(
].take(superTabCompletionLimit).toList();
}
-/// [value] with `@` typed at its caret, in place of any selection, as @ Tag
-/// types it: after a space where the caret follows a word, so the tag list
-/// opens there ([superTabTagAtCaret]).
-TextEditingValue superTabTagPrompt(TextEditingValue value) {
- final text = value.text;
- final selection = value.selection.isValid
- ? value.selection
- : TextSelection.collapsed(offset: text.length);
- final before = text.substring(0, selection.start);
- final at = before.isEmpty || RegExp(r'\s$').hasMatch(before) ? '@' : ' @';
- return TextEditingValue(
- text: before + at + text.substring(selection.end),
- selection: TextSelection.collapsed(offset: before.length + at.length),
- );
-}
-
/// [value] with the tag typed at [at] replaced by [token] and a space, the
/// caret after it.
TextEditingValue superTabInsertTag(
diff --git a/desktop/lib/super_tabs/identity.dart b/desktop/lib/super_tabs/identity.dart
index 16b8294b0..9d9e996e1 100644
--- a/desktop/lib/super_tabs/identity.dart
+++ b/desktop/lib/super_tabs/identity.dart
@@ -23,7 +23,6 @@ class SuperTabAvatar extends StatelessWidget {
this.status,
this.face = false,
this.now,
- this.radius,
}) : lead = false;
SuperTabAvatar.person(
@@ -31,7 +30,6 @@ class SuperTabAvatar extends StatelessWidget {
super.key,
this.size = 30,
this.now,
- this.radius,
}) : identity = 'person:${person.id}',
name = person.shownName,
picture = person.avatar,
@@ -50,7 +48,6 @@ class SuperTabAvatar extends StatelessWidget {
this.size = 30,
bool engineBadge = true,
this.lead = false,
- this.radius,
}) : identity = 'agent:${agent.id}',
name = name ?? agent.displayName ?? agent.name,
picture = agent.avatar,
@@ -79,9 +76,6 @@ class SuperTabAvatar extends StatelessWidget {
/// Draw the agent face rather than an initial when there is no picture.
final bool face;
- /// The corner of a rounded-square face, as a message's; round when null.
- final double? radius;
-
/// A Lead's thin gold ring around the face, outside its box so no row
/// moves: a PM in My agents.
final bool lead;
@@ -95,7 +89,6 @@ class SuperTabAvatar extends StatelessWidget {
size: size,
picture: picture,
face: face,
- radius: radius,
);
return SuperTabUntil(
until: now == null ? status?.until : null,
diff --git a/desktop/lib/super_tabs/message_row.dart b/desktop/lib/super_tabs/message_row.dart
index 8fb7cf8c6..4a9ac243b 100644
--- a/desktop/lib/super_tabs/message_row.dart
+++ b/desktop/lib/super_tabs/message_row.dart
@@ -34,18 +34,16 @@ Widget superTabMessageAvatar(
SuperTabPerson? person,
double size = SuperTabMessageRow.avatarSize,
}) {
- const radius = grid.AppDesktop.messageAvatarRadius;
if (agent != null) {
return SuperTabAvatar.agent(
agent,
name: author,
size: size,
engineBadge: false,
- radius: radius,
);
}
if (person != null && !message.fromAgent) {
- return SuperTabAvatar.person(person, size: size, radius: radius);
+ return SuperTabAvatar.person(person, size: size);
}
// Someone no longer in the Swarm keeps the face their recorded name gives.
return SuperTabAvatar(
@@ -53,7 +51,6 @@ Widget superTabMessageAvatar(
name: message.fromAgent ? author : superTabPersonName(message.authorName),
size: size,
face: message.fromAgent,
- radius: radius,
);
}
@@ -739,15 +736,9 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {
crossAxisAlignment:
WrapCrossAlignment.center,
children: [
+ // The name and the time only: colour
+ // is the face's (River, 11-07, #4467).
_name(authorStyle, finger),
- if (message.fromAgent)
- Tooltip(
- message: _identityDetails,
- child: EngineMark(
- engine: widget.agent?.engine,
- size: 14,
- ),
- ),
if (widget.headerStatus
case final status?)
status
@@ -807,9 +798,9 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {
'Earlier message',
text: switch (widget.reply) {
final reply? => superTabQuoteText(reply),
- null when widget.replyGone => 'The original message is no longer in this conversation.',
- null =>
- 'The original message isn’t loaded.',
+ null when widget.replyGone =>
+ 'Original message removed',
+ null => 'Original message not loaded',
},
onTap: widget.onOpenReply == null
? null
diff --git a/desktop/lib/super_tabs/reply_box.dart b/desktop/lib/super_tabs/reply_box.dart
index c539641b4..91125a22a 100644
--- a/desktop/lib/super_tabs/reply_box.dart
+++ b/desktop/lib/super_tabs/reply_box.dart
@@ -2,13 +2,12 @@ import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-import '../shared/theme/app_icons.dart';
import '../shared/theme/app_theme.dart' as grid;
-import '../shared/widgets/app_icon_button.dart';
import '../state/harness_attachments.dart';
import '../widgets/desktop_chrome.dart';
import '../widgets/new_harness_attachments.dart';
import '../widgets/new_harness_paste.dart';
+import 'chat/send_button.dart';
import 'composer_actions.dart';
import 'composer_files.dart';
import 'composer_newline.dart';
@@ -17,9 +16,10 @@ import 'swarm_type.dart';
/// A thread's reply box, one everywhere a reply is written (the thread pane,
/// the Threads view): files dropped, pasted or attached, Enter sends and
-/// ⇧Enter breaks the line. Under the text, one row as on the phone (Huy and
-/// Scholes, 11-04): + (attach) and @ Tag, then [options] such as the pane's
-/// New session, and the mic (with [onMic]) and the arrow at its right end.
+/// ⇧Enter breaks the line. Under the text, one row (Huy and Scholes, 11-04):
+/// the paperclip, then [options] such as the pane's New session, and the mic
+/// (with [onMic]) and the round send at its right end, drawn as Cmd-N's field
+/// (anh Dee, 11-07, #4467). An @ typed tags; there is no @ button (River, 11-07).
class SuperTabReplyBox extends StatelessWidget {
const SuperTabReplyBox({
super.key,
@@ -34,7 +34,6 @@ class SuperTabReplyBox extends StatelessWidget {
required this.onEdited,
required this.onSend,
this.options,
- this.onTag,
this.onMic,
this.voiceRow,
this.voiceNotice,
@@ -43,7 +42,6 @@ class SuperTabReplyBox extends StatelessWidget {
this.surfaceKey = const ValueKey('super-thread-composer-surface'),
this.fieldKey = const ValueKey('super-thread-composer'),
this.sendKey = const ValueKey('super-thread-send'),
- this.tagKey = const ValueKey('super-thread-tag'),
this.micKey = const ValueKey('super-thread-mic'),
this.hint = 'Reply',
});
@@ -63,8 +61,8 @@ class SuperTabReplyBox extends StatelessWidget {
final VoidCallback onSend;
final Widget? options;
- /// @ Tag's press, and the mic's: no mic without one; @ Tag greyed.
- final VoidCallback? onTag, onMic;
+ /// The mic's press: no mic without one.
+ final VoidCallback? onMic;
/// A voice message under way in this thread: drawn in the row's place.
final Widget? voiceRow;
@@ -77,13 +75,13 @@ class SuperTabReplyBox extends StatelessWidget {
/// Enter; a non-null answer is the key's.
final KeyEventResult? Function(KeyEvent event)? onKey;
final List<TextInputFormatter> inputFormatters;
- final Key surfaceKey, fieldKey, sendKey, tagKey, micKey;
+ final Key surfaceKey, fieldKey, sendKey, micKey;
/// The field's hint: what an empty box says it is for.
final String hint;
/// The Tab order inside an [OrderedTraversalPolicy] group around the box,
- /// the row's own: the field (and its files) first, then + and @ Tag, the
+ /// the row's own: the field (and its files) first, then the paperclip, the
/// options ([optionsOrder], such as the pane's New session), the mic and
/// send, and last what the owner puts under the box ([underOrder], such as
/// the pane's Also send). Outside such a group it has no effect, and the
@@ -200,14 +198,6 @@ class SuperTabReplyBox extends StatelessWidget {
child: NewHarnessAttachButton(
attachments: files,
enabled: writable && !busy,
- icon: AppIcons.plus,
- ),
- ),
- FocusTraversalOrder(
- order: toolsOrder,
- child: SuperTabComposerTagButton(
- key: tagKey,
- onPressed: writable ? onTag : null,
),
),
Expanded(child: options ?? const SizedBox.shrink()),
@@ -223,11 +213,9 @@ class SuperTabReplyBox extends StatelessWidget {
order: sendOrder,
child: ListenableBuilder(
listenable: Listenable.merge([files, text]),
- builder: (context, _) => AppIconButton(
+ builder: (context, _) => SwarmSendButton(
key: sendKey,
- icon: AppIcons.arrowUp,
tooltip: 'Send reply',
- color: DesktopChrome.accent,
onPressed:
writable &&
!busy &&
diff --git a/desktop/lib/super_tabs/swarm_type.dart b/desktop/lib/super_tabs/swarm_type.dart
index 6dc56bb13..3b8279ef9 100644
--- a/desktop/lib/super_tabs/swarm_type.dart
+++ b/desktop/lib/super_tabs/swarm_type.dart
@@ -6,24 +6,22 @@ import '../widgets/desktop_chrome.dart';
import '../widgets/finger_target.dart';
import '../widgets/markdown_style.dart';
-/// The Swarm's text, at Slack desktop's sizes, weights and line heights, in the system font (task #2312, Huy,
-/// 2026-11-03). Slack reads a message at 15 px on 22 px lines with its sender in the heaviest weight and the time at
-/// 12 px, and lists its sidebar at 15 px on 28 px rows; the app's own defaults (14 px on 1.45, names semibold, a 13 px
-/// sidebar) made a Swarm chat read smaller and flatter beside it. Only the Swarm's screens use these: the terminal,
-/// Settings and every other screen keep [DesktopChrome]'s.
+/// The Swarm's text in the system font (task #2312, Huy, 2026-11-03). The chat reads by anh Dee's three sizes (11-07,
+/// #4467): 14 for chat text on 20 px lines, 13 for names in semibold, 12 for details such as the time, in tertiary ink.
+/// The sidebar keeps Slack's 15 px on 28 px rows. Only the Swarm's screens use these: the terminal, Settings and every
+/// other screen keep [DesktopChrome]'s.
///
/// A phone's layout (`workspaceIsCompact`) keeps the app's sizes: its rows, composer and finger targets were measured
/// on them (Huy, 2026-11-02), and Slack's numbers are its desktop app's.
abstract final class SwarmType {
- static const double bodySize = 15;
- static const double bodyLine = 22;
+ static const double bodySize = 14;
+ static const double bodyLine = 20;
+ static const double nameSize = 13;
static const double timeSize = 12;
static const double sidebarSize = 15;
+ static const double sidebarLine = 22;
static const double sidebarRow = 28;
- /// Slack's names are Lato Black; the system font draws its heaviest face for it.
- static const FontWeight nameWeight = FontWeight.w900;
-
static TextStyle body(BuildContext context, {Color? color}) =>
workspaceIsCompact(context)
? DesktopChrome.text(color: color)
@@ -35,15 +33,25 @@ abstract final class SwarmType {
color: color,
medium: true,
).copyWith(fontWeight: FontWeight.w600)
- : _body(color).copyWith(fontWeight: nameWeight);
+ : DesktopChrome.text(
+ color: color,
+ size: nameSize,
+ height: bodyLine / nameSize,
+ ).copyWith(
+ fontWeight: FontWeight.w600,
+ letterSpacing: grid.AppType.trackingFor(nameSize),
+ );
+ /// A detail beside a name, such as a message's time: 12 px in tertiary ink.
static TextStyle time(BuildContext context, {Color? color}) =>
- DesktopChrome.metadata(color: color).copyWith(fontSize: timeSize);
+ DesktopChrome.metadata(color: color ?? DesktopChrome.hint)
+ .copyWith(fontSize: timeSize);
static TextStyle composer(BuildContext context, {Color? color}) =>
body(context, color: color);
- /// A sidebar row's text: 15 px on 22 px lines, as Slack lists its channels; a phone's ([compact]) the app's 13 px.
+ /// A sidebar row's text: 15 px on [sidebarLine] lines, as Slack lists its channels; a phone's ([compact]) the app's
+ /// 13 px.
static TextStyle sidebar({
required bool compact,
Color? color,
@@ -53,7 +61,7 @@ abstract final class SwarmType {
: DesktopChrome.text(
color: color,
size: sidebarSize,
- height: bodyLine / sidebarSize,
+ height: sidebarLine / sidebarSize,
medium: medium,
).copyWith(letterSpacing: grid.AppType.trackingFor(sidebarSize));
@@ -68,11 +76,11 @@ abstract final class SwarmType {
/// The room above and below a project's or a task's line.
static double projectRowPadding({required bool compact}) =>
- compact ? 8 : (projectRowHeight(compact: false) - bodyLine) / 2;
+ compact ? 8 : (projectRowHeight(compact: false) - sidebarLine) / 2;
/// The room above and below a sidebar row's line.
static double sidebarRowPadding({required bool compact}) =>
- compact ? 8 : (sidebarRow - 2 - bodyLine) / 2;
+ compact ? 8 : (sidebarRow - 2 - sidebarLine) / 2;
static TextStyle _body(Color? color) => DesktopChrome.text(
color: color,
diff --git a/desktop/lib/super_tabs/thread_panel.dart b/desktop/lib/super_tabs/thread_panel.dart
index 12bfd1214..1fa790441 100644
--- a/desktop/lib/super_tabs/thread_panel.dart
+++ b/desktop/lib/super_tabs/thread_panel.dart
@@ -412,13 +412,6 @@ class SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
setState(() {});
}
- /// @ Tag: `@` at the caret, reported as an edit so the tag list opens.
- void _promptTag() {
- _composer.value = superTabTagPrompt(_composer.value);
- _edited(_composer.text);
- _focus.requestFocus();
- }
-
void _moveTag(int index) {
_tagIndex.value = index;
WidgetsBinding.instance.addPostFrameCallback((_) {
@@ -722,7 +715,6 @@ class SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
onEdited: _edited,
onSend: () => unawaited(_send()),
options: _choices(_writable),
- onTag: _promptTag,
onMic: switch (widget.voice) {
final voice? => () => voice.start(
conversationId: _conversationId,
diff --git a/desktop/lib/super_tabs/threads_page.dart b/desktop/lib/super_tabs/threads_page.dart
index f7fb9d3f8..91d11f226 100644
--- a/desktop/lib/super_tabs/threads_page.dart
+++ b/desktop/lib/super_tabs/threads_page.dart
@@ -445,7 +445,6 @@ class _ThreadCardState extends State<_ThreadCard> {
surfaceKey: ValueKey('super-thread-card-surface:$_key'),
fieldKey: ValueKey('super-thread-card-field:$_key'),
sendKey: ValueKey('super-thread-card-send:$_key'),
- tagKey: ValueKey('super-thread-card-tag:$_key'),
micKey: ValueKey('super-thread-card-mic:$_key'),
);
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index eb539d18b..3d682052c 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -118,6 +118,7 @@ import 'buddy_rows.dart';
import 'task_groups.dart';
import 'tasks_view.dart';
import 'chat/agent_chat_header.dart';
+import 'chat/send_button.dart';
import 'tasks/personal_tasks_pane.dart';
import 'tasks/task_header.dart';
import 'voice_length.dart';
@@ -2732,11 +2733,7 @@ class _SuperTabViewState extends State<SuperTabView>
setState(() => _finding = null);
if (target == null) {
ScaffoldMessenger.maybeOf(context)?.showSnackBar(
- SnackBar(
- content: Text(
- note ?? 'The original message is no longer in this conversation.',
- ),
- ),
+ SnackBar(content: Text(note ?? 'Original message removed')),
);
return;
}
@@ -3387,7 +3384,6 @@ class _SuperTabViewState extends State<SuperTabView>
required double room,
required Widget field,
required Widget attach,
- required Widget tag,
required List<Widget> options,
required List<Widget> trailing,
required Widget send,
@@ -3395,8 +3391,7 @@ class _SuperTabViewState extends State<SuperTabView>
}) {
// Too little height for a second row (a phone on its side with its keyboard
// up): the actions take the row's end. A narrow phone with so little
- // height gets the squeezed row, which beats a composer that overflows; it
- // has no room for @ Tag there, and an @ typed still opens the list.
+ // height gets the squeezed row, which beats a composer that overflows.
final target = _phone ? kFingerTarget : grid.AppControl.height;
final row = composerRowInsets(target: target);
if (_phone && room < _phoneComposerTwoRowsFrom && voice == null) {
@@ -3438,8 +3433,9 @@ class _SuperTabViewState extends State<SuperTabView>
Row(
key: const ValueKey('super-message-composer-actions'),
children: [
+ // Only the paperclip on the left: an @ typed tags
+ // (River, 11-07, #4467).
attach,
- tag,
Expanded(
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
@@ -3455,13 +3451,6 @@ class _SuperTabViewState extends State<SuperTabView>
);
}
- /// @ Tag: `@` at the caret, reported as an edit so the tag list opens.
- void _promptTag() {
- _composer.value = superTabTagPrompt(_composer.value);
- _composerEdited(_composer.text);
- _focus.requestFocus();
- }
-
/// Whether ⋮ carries the views a wider header draws as icons.
bool get _menuNamesViews =>
_phone && !_devicesVisible && !_listViewHoldsThePane;
@@ -6058,7 +6047,7 @@ class _SuperTabViewState extends State<SuperTabView>
bottom: grid.AppDesktop.controlGap,
),
child: Text(
- 'Your message starts its own thread and Buddy session',
+ 'Starts its own thread and Buddy session',
key: const ValueKey('super-chat-session-note'),
style: DesktopChrome.metadata(
color: DesktopChrome.muted,
@@ -6198,14 +6187,6 @@ class _SuperTabViewState extends State<SuperTabView>
NewHarnessAttachButton(
attachments: _files,
enabled: writable && !busy,
- icon: AppIcons.plus,
- ),
- ),
- tag: fingerTarget(
- enabled: _phone,
- SuperTabComposerTagButton(
- key: const ValueKey('super-composer-tag'),
- onPressed: writable ? _promptTag : null,
),
),
options: [
@@ -6252,10 +6233,8 @@ class _SuperTabViewState extends State<SuperTabView>
listenable: Listenable.merge([_composer, _files]),
builder: (context, _) => fingerTarget(
enabled: _phone,
- AppIconButton(
- icon: AppIcons.arrowUp,
+ SwarmSendButton(
tooltip: 'Send message',
- color: DesktopChrome.accent,
onPressed:
writable &&
!c.uploading &&
@@ -6308,7 +6287,7 @@ class _SuperTabViewState extends State<SuperTabView>
maintainAnimation: true,
maintainState: true,
child: Text(
- 'Your message starts its own thread and Buddy session',
+ 'Starts its own thread and Buddy session',
key: const ValueKey('super-chat-session-note'),
style: DesktopChrome.metadata(color: DesktopChrome.muted),
),
diff --git a/desktop/test/goldens/swarm-elements-dark.png b/desktop/test/goldens/swarm-elements-dark.png
index 05afa459e..3de71bac0 100644
Binary files a/desktop/test/goldens/swarm-elements-dark.png and b/desktop/test/goldens/swarm-elements-dark.png differ
diff --git a/desktop/test/goldens/swarm-elements-light.png b/desktop/test/goldens/swarm-elements-light.png
index 42ad2be1c..e2eb8d04b 100644
Binary files a/desktop/test/goldens/swarm-elements-light.png and b/desktop/test/goldens/swarm-elements-light.png differ
diff --git a/desktop/test/super_tab_buddy_sessions_test.dart b/desktop/test/super_tab_buddy_sessions_test.dart
index 98d08e4d2..13e8db002 100644
--- a/desktop/test/super_tab_buddy_sessions_test.dart
+++ b/desktop/test/super_tab_buddy_sessions_test.dart
@@ -1072,7 +1072,7 @@ void main() {
expect(box(tester, chatSession).on, isTrue);
expect(
tester.widget<Text>(chatNote).data,
- 'Your message starts its own thread and Buddy session',
+ 'Starts its own thread and Buddy session',
);
// The line's place was kept: the box doesn't move.
expect(tester.getRect(chatComposer).bottom, restingBottom);
diff --git a/desktop/test/super_tab_chat_quiet_test.dart b/desktop/test/super_tab_chat_quiet_test.dart
new file mode 100644
index 000000000..4b8ec6699
--- /dev/null
+++ b/desktop/test/super_tab_chat_quiet_test.dart
@@ -0,0 +1,185 @@
+import 'dart:typed_data';
+
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/shared/theme/app_icons.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/harness_attachments.dart';
+import 'package:harness/super_tabs/avatar_art.dart';
+import 'package:harness/super_tabs/message_row.dart';
+import 'package:harness/widgets/desktop_chrome.dart';
+import 'package:harness/widgets/engine_identity.dart';
+
+import 'super_tab_mentions_test.dart' show showView;
+import 'support/super_tab_fixture.dart';
+
+/// Task #4467 (anh Dee, 11-07 15:35): the Swarm chat, quiet. Round faces at 28, the name in semibold, the time in
+/// 12 tertiary, text at 14, and a composer that matches Cmd-N.
+void main() {
+ group('a message row', () {
+ /// A person, an agent in the Swarm, and an agent that has left, one message each.
+ ConversationServer server() {
+ final server = ConversationServer();
+ (server.state['agents'] as List).add({
+ 'id': 'pm',
+ 'name': 'Lead',
+ 'displayName': 'River',
+ 'machineId': 'mac',
+ 'harnessId': 'h-pm',
+ 'contributorId': 'owner',
+ 'configuration': {'engine': 'claude'},
+ });
+ server.append('From a person');
+ server.append('From an agent', agent: true);
+ server.messages.last['author'] = {
+ 'kind': 'agent',
+ 'id': 'pm',
+ 'name': 'Lead',
+ };
+ server.append('From a person again');
+ server.append('From an agent that left', agent: true);
+ return server;
+ }
+
+ testWidgets('heads with the name and the time only: no engine mark '
+ '(River, 11-07: colour only on faces)', (tester) async {
+ await showView(tester, server());
+ expect(
+ find.descendant(
+ of: find.byType(SuperTabMessageRow),
+ matching: find.byType(EngineMark),
+ ),
+ findsNothing,
+ );
+ expect(find.text('River'), findsWidgets);
+ });
+
+ for (final brightness in Brightness.values) {
+ testWidgets('draws every sender as a round face at 28 '
+ '(${brightness.name})', (tester) async {
+ await showView(tester, server(), brightness: brightness);
+ final faces = find.descendant(
+ of: find.byType(SuperTabMessageRow),
+ matching: find.byType(SuperTabAvatarFace),
+ );
+ expect(faces, findsNWidgets(4));
+ for (final face in faces.evaluate()) {
+ final widget = face.widget as SuperTabAvatarFace;
+ expect(widget.radius, isNull, reason: 'round, not a rounded square');
+ expect(tester.getSize(find.byWidget(widget)), const Size(28, 28));
+ }
+ });
+ }
+ });
+
+ group('the composer, as Cmd-N draws its field', () {
+ Finder key(String value) => find.byKey(ValueKey(value));
+
+ /// The round send's fill inside [surface].
+ BoxDecoration sendFill(WidgetTester tester, String surface) {
+ final fill = find.descendant(
+ of: key(surface),
+ matching: key('swarm-send-fill'),
+ );
+ expect(tester.getSize(fill), const Size.square(28));
+ final box = tester.widget<DecoratedBox>(fill);
+ final decoration = box.decoration as BoxDecoration;
+ expect(decoration.shape, BoxShape.circle);
+ return decoration;
+ }
+
+ void expectNeutral(BoxDecoration fill) =>
+ expect(fill.color, DesktopChrome.rim, reason: 'neutral while empty');
+ void expectBlue(BoxDecoration fill) =>
+ expect(fill.color, grid.AppPalette.accent, reason: 'blue to send');
+
+ /// The box is one rounded field: radius 12, a hairline, the faint fill.
+ void expectField(WidgetTester tester, String surface) {
+ final box = tester.widget<DecoratedBox>(key(surface));
+ final decoration = box.decoration as BoxDecoration;
+ expect(decoration.borderRadius, BorderRadius.circular(12));
+ expect(decoration.border, Border.all(color: DesktopChrome.rim));
+ expect(decoration.color, DesktopChrome.field);
+ expect(
+ find.descendant(
+ of: key(surface),
+ matching: find.descendant(
+ of: key('new-harness-attach'),
+ matching: find.byIcon(AppIcons.paperclip),
+ ),
+ ),
+ findsOneWidget,
+ );
+ }
+
+ for (final brightness in Brightness.values) {
+ testWidgets('the main chat: a paperclip, and send turns blue for text '
+ 'or a file (${brightness.name})', (tester) async {
+ final c = await showView(
+ tester,
+ ConversationServer(),
+ brightness: brightness,
+ );
+ const surface = 'super-message-composer-surface';
+ expectField(tester, surface);
+ expectNeutral(sendFill(tester, surface));
+ // Only the paperclip on the left; @ still tags when typed (River, 11-07).
+ expect(key('super-composer-tag'), findsNothing);
+
+ await tester.enterText(key('super-message-composer'), 'Ship it');
+ await tester.pump();
+ expectBlue(sendFill(tester, surface));
+
+ await tester.enterText(key('super-message-composer'), '');
+ await tester.pump();
+ expectNeutral(sendFill(tester, surface));
+
+ c.attachments('lead').add([
+ HarnessAttachment('a.png', Uint8List.fromList([1, 2, 3])),
+ ]);
+ await tester.pump();
+ expectBlue(sendFill(tester, surface));
+ c.attachments('lead').clear();
+ // The typed draft's save waits on a timer: let it run.
+ await tester.pumpWidget(const SizedBox());
+ await c.flush();
+ });
+
+ testWidgets('a thread\'s reply box is drawn the same '
+ '(${brightness.name})', (tester) async {
+ final server = ConversationServer()..threads = true;
+ server.append('Should we do thread replies?');
+ server.append('Yes, like Slack.');
+ server.messages.last
+ ..['thread'] = 'message-1'
+ ..['replyTo'] = 'message-1';
+ final c = await showView(tester, server, brightness: brightness);
+ c.openThread('message-1');
+ await tester.pumpAndSettle();
+ const surface = 'super-thread-composer-surface';
+ expectField(tester, surface);
+ expectNeutral(sendFill(tester, surface));
+ expect(key('super-thread-tag'), findsNothing);
+
+ await tester.enterText(key('super-thread-composer'), 'Agreed');
+ await tester.pump();
+ expectBlue(sendFill(tester, surface));
+ await tester.pumpWidget(const SizedBox());
+ await c.flush();
+ });
+ }
+ });
+
+ // anh Dee (11-07 16:23), rule 7: empty means empty. An empty chat shows no
+ // line; the composer under it is what fills it.
+ testWidgets('an empty chat shows no line', (tester) async {
+ final c = await showView(tester, ConversationServer());
+ for (final chat in ['lead', 'offline']) {
+ await c.select(chat);
+ await tester.pumpAndSettle();
+ expect(find.text('Start the conversation.'), findsNothing);
+ expect(find.textContaining('Discuss the plan'), findsNothing);
+ expect(find.textContaining('Say what you want to build'), findsNothing);
+ }
+ });
+}
diff --git a/desktop/test/super_tab_composer_padding_test.dart b/desktop/test/super_tab_composer_padding_test.dart
index ded507a14..e8db42865 100644
--- a/desktop/test/super_tab_composer_padding_test.dart
+++ b/desktop/test/super_tab_composer_padding_test.dart
@@ -10,12 +10,12 @@ import 'support/super_tab_fixture.dart';
/// Huy, 11-04: the composer was too tight, its hint and its row of actions
/// against the box's edge. As on the phone and in Slack, the text sits 12 below
-/// the top and 16 in from each side, the + and the arrow's glyphs keep those
+/// the top and 16 in from each side, the paperclip and the arrow's glyphs keep those
/// edges, the row has a little more air above it, the arrow sits as far up from
-/// the bottom as the text sits down from the top, and the corners are the
-/// phone's (SwarmComposer.cardRadius).
+/// the bottom as the text sits down from the top, and the corners are Cmd-N's
+/// field's (anh Dee, 11-07, #4467).
void main() {
- const top = 12.0, side = 16.0, rowGap = 12.0, radius = 24.0;
+ const top = 12.0, side = 16.0, rowGap = 12.0, radius = 12.0;
ConversationServer buddyChat() {
final server = ConversationServer()..threads = true;
@@ -108,12 +108,7 @@ void main() {
final plus = glyph(
tester,
find.descendant(of: surfaceKey, matching: key('new-harness-attach')),
- AppIcons.plus,
- );
- final tag = glyph(
- tester,
- key(thread ? 'super-thread-tag' : 'super-composer-tag'),
- AppIcons.atSign,
+ AppIcons.paperclip,
);
final mic = glyph(
tester,
@@ -129,15 +124,18 @@ void main() {
expect(field.top - surface.top, closeTo(top, .5), reason: 'top');
expect(field.left - surface.left, closeTo(side, .5), reason: 'left');
expect(surface.right - field.right, closeTo(side, .5), reason: 'right');
- // The + under the text's first letter, the arrow at the text's right
- // edge, and the mic as far from the arrow as @ is from +.
+ // The paperclip under the text's first letter, the arrow at the text's right
+ // edge.
expect(plus.left, closeTo(field.left, .5), reason: '+ edge');
expect(surface.right - send.right, closeTo(side, .5), reason: 'send');
+ // The mic right beside the round send: two touching targets apart
+ // (River, 11-07, #4467).
expect(
send.left - mic.right,
- closeTo(tag.left - plus.right, .5),
- reason: 'mic and send spacing',
+ closeTo(grid.AppControl.height - AppIcons.inlineSize, .5),
+ reason: 'mic beside send',
);
+
// The row's air over Desktop's 32pt targets, the same over a phone's
// 44pt ones, which would otherwise push a short phone's box past the
// keyboard.
diff --git a/desktop/test/super_tab_composer_row_test.dart b/desktop/test/super_tab_composer_row_test.dart
index 900b92648..9315efb72 100644
--- a/desktop/test/super_tab_composer_row_test.dart
+++ b/desktop/test/super_tab_composer_row_test.dart
@@ -10,8 +10,9 @@ import 'support/fake_voice_recorder.dart';
import 'support/super_tab_fixture.dart';
/// Huy and Scholes, 11-04: the Desktop and web composer is the phone's. One
-/// rounded box, the text on top and one row under it: + (attach), @ Tag, the
-/// New session chip, the mic and send. Also send is a small checkbox under a
+/// rounded box, the text on top and one row under it: the paperclip (attach,
+/// anh Dee 11-07, #4467, where + was), the New session chip, the mic and
+/// send; an @ typed tags (River, 11-07: no @ button on Desktop). Also send is a small checkbox under a
/// thread's box. The mic shows only with a recorder (River, 11-04: recording
/// is its own task), so nobody sees a button that does nothing.
void main() {
@@ -117,48 +118,50 @@ void main() {
);
Finder send() => find.byTooltip('Send message');
- testWidgets('holds +, @ Tag and New session under the text, and send at '
- 'the row\'s right end', (tester) async {
- await show(tester);
- for (final text in ['One line', fiveLines]) {
- await tester.enterText(key('super-message-composer'), text);
- await tester.pumpAndSettle();
- final field = tester.getRect(key('super-message-composer'));
- final surface = tester.getRect(key('super-message-composer-surface'));
- final plus = tester.getRect(attach());
- final tag = tester.getRect(key('super-composer-tag'));
- final session = tester.getRect(key('super-chat-new-session'));
- final arrow = tester.getRect(send());
- expect(key('super-message-composer-actions'), findsOneWidget);
- for (final button in [plus, tag, session, arrow]) {
- expect(button.top, greaterThanOrEqualTo(field.bottom), reason: text);
+ testWidgets(
+ 'holds the paperclip and New session under the text, and send at '
+ 'the row\'s right end',
+ (tester) async {
+ await show(tester);
+ for (final text in ['One line', fiveLines]) {
+ await tester.enterText(key('super-message-composer'), text);
+ await tester.pumpAndSettle();
+ final field = tester.getRect(key('super-message-composer'));
+ final surface = tester.getRect(key('super-message-composer-surface'));
+ final plus = tester.getRect(attach());
+ final session = tester.getRect(key('super-chat-new-session'));
+ final arrow = tester.getRect(send());
+ expect(key('super-message-composer-actions'), findsOneWidget);
+ for (final button in [plus, session, arrow]) {
+ expect(
+ button.top,
+ greaterThanOrEqualTo(field.bottom),
+ reason: text,
+ );
+ }
+ expect(plus.left, lessThan(session.left));
+ expect(session.right, lessThan(arrow.left));
+ // Send keeps the box's bottom-right corner however long the message
+ // (Scholes, 11-03), the box's inset from its edges.
+ expect(
+ surface.right - arrow.right,
+ lessThanOrEqualTo(grid.AppDesktop.groupGap),
+ );
+ expect(
+ surface.bottom - arrow.bottom,
+ lessThanOrEqualTo(grid.AppDesktop.groupGap),
+ );
}
- expect(plus.left, lessThan(tag.left));
- expect(tag.left, lessThan(session.left));
- expect(session.right, lessThan(arrow.left));
- // Send keeps the box's bottom-right corner however long the message
- // (Scholes, 11-03), the box's inset from its edges.
expect(
- surface.right - arrow.right,
- lessThanOrEqualTo(grid.AppDesktop.groupGap),
- );
- expect(
- surface.bottom - arrow.bottom,
- lessThanOrEqualTo(grid.AppDesktop.groupGap),
+ find.descendant(
+ of: attach(),
+ matching: find.byIcon(AppIcons.paperclip),
+ ),
+ findsOneWidget,
);
- }
- expect(
- find.descendant(of: attach(), matching: find.byIcon(AppIcons.plus)),
- findsOneWidget,
- );
- expect(
- find.descendant(
- of: key('super-composer-tag'),
- matching: find.byIcon(AppIcons.atSign),
- ),
- findsOneWidget,
- );
- });
+ expect(key('super-composer-tag'), findsNothing);
+ },
+ );
testWidgets('shows no mic without a recorder, and no Also send', (
tester,
@@ -192,17 +195,11 @@ void main() {
);
});
- testWidgets('@ Tag types @ at the caret and opens the tag list', (
- tester,
- ) async {
+ testWidgets('an @ typed opens the tag list', (tester) async {
await show(tester);
- await tester.enterText(key('super-message-composer'), 'hi');
- await tester.pump();
- await tester.tap(key('super-composer-tag'));
+ await tester.enterText(key('super-message-composer'), 'hi @');
await tester.pumpAndSettle();
final field = tester.widget<TextField>(key('super-message-composer'));
- expect(field.controller!.text, 'hi @');
- expect(field.controller!.selection.baseOffset, 4);
expect(key('super-composer-completions'), findsOneWidget);
expect(focusedIn(tester, key('super-message-composer')), isTrue);
// Enter picks from the list, as for an @ typed.
@@ -212,26 +209,28 @@ void main() {
expect(field.controller!.text.length, greaterThan(4));
});
- testWidgets('Tab goes from the text to +, @ Tag, New session, the mic and '
- 'send, in the row\'s order', (tester) async {
- await show(tester, recorder: FakeVoiceRecorder());
- await tester.enterText(key('super-message-composer'), 'Ready');
- await tester.pump();
- expect(focusedIn(tester, key('super-message-composer')), isTrue);
- for (final next in [
- attach(),
- key('super-composer-tag'),
- key('super-chat-new-session'),
- key('super-composer-mic'),
- send(),
- ]) {
- await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ testWidgets(
+ 'Tab goes from the text to the paperclip, New session, the mic and '
+ 'send, in the row\'s order',
+ (tester) async {
+ await show(tester, recorder: FakeVoiceRecorder());
+ await tester.enterText(key('super-message-composer'), 'Ready');
await tester.pump();
- expect(focusedIn(tester, next), isTrue, reason: '$next');
- }
- // The draft's save runs out.
- await tester.pump(const Duration(seconds: 1));
- });
+ expect(focusedIn(tester, key('super-message-composer')), isTrue);
+ for (final next in [
+ attach(),
+ key('super-chat-new-session'),
+ key('super-composer-mic'),
+ send(),
+ ]) {
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ expect(focusedIn(tester, next), isTrue, reason: '$next');
+ }
+ // The draft's save runs out.
+ await tester.pump(const Duration(seconds: 1));
+ },
+ );
});
group('a thread', () {
@@ -240,43 +239,45 @@ void main() {
matching: key('new-harness-attach'),
);
- testWidgets('holds +, @ Tag and New session under the text, send at the '
- 'right end, and Also send on its own line under the box', (
- tester,
- ) async {
- await show(tester, thread: 'message-3');
- await tester.enterText(key('super-thread-composer'), fiveLines);
- await tester.pumpAndSettle();
- final field = tester.getRect(key('super-thread-composer'));
- final surface = tester.getRect(key('super-thread-composer-surface'));
- final plus = tester.getRect(attach());
- final tag = tester.getRect(key('super-thread-tag'));
- final session = tester.getRect(key('super-thread-new-session'));
- final send = tester.getRect(key('super-thread-send'));
- for (final button in [plus, tag, session, send]) {
- expect(button.top, greaterThanOrEqualTo(field.bottom));
- expect(button.bottom, lessThanOrEqualTo(surface.bottom));
- }
- expect(plus.left, lessThan(tag.left));
- expect(tag.left, lessThan(session.left));
- expect(session.right, lessThan(send.left));
- expect(
- find.descendant(of: attach(), matching: find.byIcon(AppIcons.plus)),
- findsOneWidget,
- );
- // Also send is under the box, whatever room the row has.
- final also = tester.getRect(key('super-thread-also-send'));
- expect(also.top, greaterThanOrEqualTo(surface.bottom));
- expect(
- find.descendant(
- of: key('super-thread-also-line'),
- matching: key('super-thread-also-send'),
- ),
- findsOneWidget,
- );
- expect(find.text('Also send to the main chat'), findsOneWidget);
- expect(key('super-thread-mic'), findsNothing);
- });
+ testWidgets(
+ 'holds the paperclip and New session under the text, send at the '
+ 'right end, and Also send on its own line under the box',
+ (tester) async {
+ await show(tester, thread: 'message-3');
+ await tester.enterText(key('super-thread-composer'), fiveLines);
+ await tester.pumpAndSettle();
+ final field = tester.getRect(key('super-thread-composer'));
+ final surface = tester.getRect(key('super-thread-composer-surface'));
+ final plus = tester.getRect(attach());
+ final session = tester.getRect(key('super-thread-new-session'));
+ final send = tester.getRect(key('super-thread-send'));
+ for (final button in [plus, session, send]) {
+ expect(button.top, greaterThanOrEqualTo(field.bottom));
+ expect(button.bottom, lessThanOrEqualTo(surface.bottom));
+ }
+ expect(plus.left, lessThan(session.left));
+ expect(session.right, lessThan(send.left));
+ expect(
+ find.descendant(
+ of: attach(),
+ matching: find.byIcon(AppIcons.paperclip),
+ ),
+ findsOneWidget,
+ );
+ // Also send is under the box, whatever room the row has.
+ final also = tester.getRect(key('super-thread-also-send'));
+ expect(also.top, greaterThanOrEqualTo(surface.bottom));
+ expect(
+ find.descendant(
+ of: key('super-thread-also-line'),
+ matching: key('super-thread-also-send'),
+ ),
+ findsOneWidget,
+ );
+ expect(find.text('Also send to the main chat'), findsOneWidget);
+ expect(key('super-thread-mic'), findsNothing);
+ },
+ );
testWidgets('names the project chat in Also send', (tester) async {
await show(tester, chat: 'lead', thread: 'message-1');
@@ -303,14 +304,10 @@ void main() {
expect(key('super-thread-voice-row'), findsOneWidget);
});
- testWidgets('@ Tag types @ at the caret and opens the tag list', (
- tester,
- ) async {
+ testWidgets('an @ typed opens the tag list', (tester) async {
await show(tester, chat: 'lead', thread: 'message-1');
- await tester.tap(key('super-thread-tag'));
+ await tester.enterText(key('super-thread-composer'), '@');
await tester.pumpAndSettle();
- final field = tester.widget<TextField>(key('super-thread-composer'));
- expect(field.controller!.text, '@');
expect(key('super-thread-completions'), findsOneWidget);
});
});
diff --git a/desktop/test/super_tab_message_avatar_test.dart b/desktop/test/super_tab_message_avatar_test.dart
index 7923d3447..2358def25 100644
--- a/desktop/test/super_tab_message_avatar_test.dart
+++ b/desktop/test/super_tab_message_avatar_test.dart
@@ -5,8 +5,8 @@ import 'package:harness/super_tabs/identity.dart';
import 'package:harness/super_tabs/message_row.dart';
import 'package:harness/super_tabs/model.dart';
-/// Huy (11-03): the chat and the thread draw avatars as Slack does, 36 px
-/// rounded squares, with more room above each new sender.
+/// The chat and the thread draw round faces at 28 (anh Dee, 11-07, #4467; Huy's 11-03 36 px rounded squares
+/// before), with more room above each new sender.
SuperTabMessage _message(String id) => SuperTabMessage.fromJson({
'id': id,
'conversationId': 'lead',
@@ -36,30 +36,24 @@ Future<void> _show(WidgetTester tester, List<Widget> rows) => tester.pumpWidget(
),
);
-/// The face's rounded-square fill: no circle, an 8-point corner.
-bool _roundedSquare(Widget w) =>
+/// The face's round fill.
+bool _round(Widget w) =>
w is Container &&
w.decoration is BoxDecoration &&
- (w.decoration! as BoxDecoration).shape == BoxShape.rectangle &&
- (w.decoration! as BoxDecoration).borderRadius == BorderRadius.circular(8);
+ (w.decoration! as BoxDecoration).shape == BoxShape.circle;
void main() {
- testWidgets('a message avatar is a 36-point rounded square', (tester) async {
+ testWidgets('a message avatar is a 28-point circle', (tester) async {
await _show(tester, [_row(_message('m1'))]);
final avatar = find.byType(SuperTabAvatar);
- expect(tester.getSize(avatar), const Size.square(36));
+ expect(tester.getSize(avatar), const Size.square(28));
expect(
- find.descendant(
- of: avatar,
- matching: find.byWidgetPredicate(_roundedSquare),
- ),
+ find.descendant(of: avatar, matching: find.byWidgetPredicate(_round)),
findsOneWidget,
);
});
- testWidgets('a message photo is clipped to the same rounded square', (
- tester,
- ) async {
+ testWidgets('a message photo is clipped to the same circle', (tester) async {
await _show(tester, [
SuperTabMessageRow(
message: _message('m1'),
@@ -81,12 +75,12 @@ void main() {
final avatar = find.byType(SuperTabAvatar);
expect(
find.descendant(of: avatar, matching: find.byType(ClipOval)),
- findsNothing,
+ findsOneWidget,
);
- final clip = tester.widget<ClipRRect>(
+ expect(
find.descendant(of: avatar, matching: find.byType(ClipRRect)),
+ findsNothing,
);
- expect(clip.borderRadius, BorderRadius.circular(8));
});
testWidgets('avatars outside messages stay round', (tester) async {
diff --git a/desktop/test/super_tab_project_chat_agent_post_test.dart b/desktop/test/super_tab_project_chat_agent_post_test.dart
index 2084f5c64..55ce2e66e 100644
--- a/desktop/test/super_tab_project_chat_agent_post_test.dart
+++ b/desktop/test/super_tab_project_chat_agent_post_test.dart
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
import 'package:harness/super_tabs/controller.dart';
+import 'package:harness/super_tabs/message_row.dart';
import 'package:harness/super_tabs/view.dart';
import 'support/capture.dart';
@@ -72,8 +73,8 @@ void main() {
}
testWidgets(
- 'shows an Engineer\'s post in the project chat with its name and engine '
- 'mark, and its terminals stay the PM\'s alone',
+ 'shows an Engineer\'s post in the project chat with its name, and its '
+ 'terminals stay the PM\'s alone',
(tester) async {
final c = await show(tester, Brightness.dark);
expect(
@@ -81,7 +82,15 @@ void main() {
findsOneWidget,
);
expect(find.text('Marlin'), findsWidgets);
- expect(find.byKey(const ValueKey('engine-icon-codex')), findsWidgets);
+ // No engine mark beside the name: colour is the face's (River, 11-07,
+ // #4467).
+ expect(
+ find.descendant(
+ of: find.byType(SuperTabMessageRow),
+ matching: find.byKey(const ValueKey('engine-icon-codex')),
+ ),
+ findsNothing,
+ );
// The chat's terminals: its PM alone, as #2207 keeps it.
expect(c.snapshot!.paneAgentIds('lead'), ['lead-agent']);
expect(find.byTooltip('Group terminals (1)'), findsOneWidget);
diff --git a/desktop/test/super_tab_reply_box_test.dart b/desktop/test/super_tab_reply_box_test.dart
index befd77009..de9d0277c 100644
--- a/desktop/test/super_tab_reply_box_test.dart
+++ b/desktop/test/super_tab_reply_box_test.dart
@@ -440,12 +440,12 @@ void main() {
// The row's order, then Also send under the box (Huy and Scholes, 11-04).
for (final width in [800.0, SuperTabPaneLayout.rightWidth]) {
- testBox('Tab goes from the reply to +, @ Tag, New session, send and Also '
+ testBox('Tab goes from the reply to the paperclip, New session, send and '
+ 'Also '
'send at ${width.round()}px', (tester) async {
await panel(tester, buddyChat(), 'offline', width: width);
final order = [
find.byKey(const ValueKey('new-harness-attach')),
- find.byKey(const ValueKey('super-thread-tag')),
newSession,
send,
alsoSend,
diff --git a/desktop/test/super_tab_reply_jump_test.dart b/desktop/test/super_tab_reply_jump_test.dart
index 802a0b027..dad27a4a2 100644
--- a/desktop/test/super_tab_reply_jump_test.dart
+++ b/desktop/test/super_tab_reply_jump_test.dart
@@ -276,9 +276,7 @@ void main() {
expect(
find.descendant(
of: quoteIn(reply),
- matching: find.text(
- 'The original message is no longer in this conversation.',
- ),
+ matching: find.text('Original message removed'),
),
findsOneWidget,
);
@@ -315,9 +313,7 @@ void main() {
expect(
find.descendant(
of: quoteIn('message-60'),
- matching: find.text(
- 'The original message is no longer in this conversation.',
- ),
+ matching: find.text('Original message removed'),
),
findsOneWidget,
);
@@ -327,10 +323,7 @@ void main() {
await show(tester, chat(60, replyTo: 'message-gone'));
await tester.tap(quoteIn('message-60'));
await tester.pumpAndSettle();
- expect(
- note('The original message is no longer in this conversation.'),
- findsOneWidget,
- );
+ expect(note('Original message removed'), findsOneWidget);
expect(row('message-60').hitTestable(), findsOneWidget);
expect(find.byKey(const ValueKey('super-reply-back')), findsNothing);
});
@@ -359,10 +352,7 @@ void main() {
await tester.tap(quoteIn('message-60'));
await tester.pumpAndSettle();
expect(find.textContaining('Private plan'), findsNothing);
- expect(
- note('The original message is no longer in this conversation.'),
- findsOneWidget,
- );
+ expect(note('Original message removed'), findsOneWidget);
});
testWidgets('a failed page read says so and stops', (tester) async {
diff --git a/desktop/test/super_tab_task_line_test.dart b/desktop/test/super_tab_task_line_test.dart
index c6ad8ddd5..3a1fb8ad8 100644
--- a/desktop/test/super_tab_task_line_test.dart
+++ b/desktop/test/super_tab_task_line_test.dart
@@ -376,7 +376,7 @@ void main() {
);
});
- testWidgets('an agent\'s engine mark stays between its name and the time', (
+ testWidgets('an agent\'s name comes before its tag, with no engine mark', (
tester,
) async {
final server = _server('task-line')..threadAsks['root'] = 'proposal';
@@ -400,16 +400,17 @@ void main() {
of: _row('root'),
matching: find.text('River'),
);
- final mark = find.descendant(
- of: _row('root'),
- matching: find.byType(EngineMark),
- );
final tag = find.descendant(
of: _row('root'),
matching: find.text('✋ Proposal'),
);
- expect(left(name), lessThan(left(mark)));
- expect(left(mark), lessThan(left(tag)));
+ // No engine mark in a message header: colour is the face's (River,
+ // 11-07, #4467).
+ expect(
+ find.descendant(of: _row('root'), matching: find.byType(EngineMark)),
+ findsNothing,
+ );
+ expect(left(name), lessThan(left(tag)));
});
testWidgets('keeps its header when the same person wrote just before', (
diff --git a/desktop/test/super_tab_typography_test.dart b/desktop/test/super_tab_typography_test.dart
index 946f8d908..d4cfd04fa 100644
--- a/desktop/test/super_tab_typography_test.dart
+++ b/desktop/test/super_tab_typography_test.dart
@@ -10,7 +10,8 @@ import 'super_tab_mentions_test.dart' show showView;
import 'support/super_tab_fixture.dart';
import 'support/super_tab_phone.dart';
-/// Task #2312 (Huy, 2026-11-03): the Swarm's text at Slack desktop's sizes, weights and line heights, in the system font.
+/// Task #2312 (Huy, 2026-11-03): the Swarm's text in the system font. Task #4467 (anh Dee, 11-07): three sizes, 14 chat,
+/// 13 names, 12 details; the name in semibold, the time in tertiary ink.
/// The style a [RichText] draws [text] in: its spans' styles, merged from the root down to the span holding it.
TextStyle? styleOf(WidgetTester tester, String text) {
@@ -40,18 +41,19 @@ TextStyle? _within(InlineSpan span, String text, TextStyle above) {
double lineOf(TextStyle style) => style.fontSize! * style.height!;
void main() {
- testWidgets('a message body reads at 15 px on 22 px lines', (tester) async {
+ testWidgets('a message body reads at 14 px on 20 px lines', (tester) async {
final server = ConversationServer()
..append('Shipped the search field. It wraps when the line runs long.');
await showView(tester, server);
final body = styleOf(tester, 'Shipped the search field')!;
- expect(body.fontSize, 15);
- expect(lineOf(body), closeTo(22, 0.01));
+ expect(body.fontSize, 14);
+ expect(lineOf(body), closeTo(20, 0.01));
expect(body.fontWeight ?? FontWeight.w400, FontWeight.w400);
});
testWidgets(
- 'the sender is named at 15 px in the heaviest weight, the time at 12 px',
+ 'the sender is named at 13 px in semibold on the body\'s line, the time '
+ 'at 12 px in tertiary ink',
(tester) async {
final server = ConversationServer()..append('Shipped');
await showView(tester, server);
@@ -63,13 +65,14 @@ void main() {
.toList();
// The reader's own message: its author reads You.
final name = texts.firstWhere((t) => t.data == 'You');
- expect(name.style!.fontSize, 15);
- expect(name.style!.fontWeight, FontWeight.w900);
+ expect(name.style!.fontSize, 13);
+ expect(name.style!.fontWeight, FontWeight.w600);
+ expect(lineOf(name.style!), closeTo(20, 0.01));
final time = texts.firstWhere(
(t) => RegExp(r'^\d{1,2}:\d{2}').hasMatch(t.data ?? ''),
);
expect(time.style!.fontSize, 12);
- expect(time.style!.color, DesktopChrome.muted);
+ expect(time.style!.color, DesktopChrome.hint);
},
);
@@ -82,7 +85,7 @@ void main() {
);
await showView(tester, server);
for (final text in ['a listed item', 'a quoted line', 'bold words']) {
- expect(styleOf(tester, text)!.fontSize, 15, reason: text);
+ expect(styleOf(tester, text)!.fontSize, 14, reason: text);
}
expect(styleOf(tester, 'bold words')!.fontWeight, FontWeight.w700);
expect(styleOf(tester, 'the code')!.fontFamily, AppFonts.mono);
@@ -103,7 +106,7 @@ void main() {
expect(body!.fontSize, 14);
});
- testWidgets('the thread view heads at 15 px in the heaviest weight, and its '
+ testWidgets('the thread view heads as a name, 13 px semibold, and its '
'replies read as the chat does', (tester) async {
final server = ConversationServer()..threads = true;
server.append('Should we do thread replies?');
@@ -115,14 +118,14 @@ void main() {
c.openThread('message-1');
await tester.pumpAndSettle();
final header = tester.widget<Text>(find.text('Thread'));
- expect(header.style!.fontSize, 15);
- expect(header.style!.fontWeight, FontWeight.w900);
+ expect(header.style!.fontSize, 13);
+ expect(header.style!.fontWeight, FontWeight.w600);
final reply = styleOf(tester, 'Yes, like Slack.')!;
- expect(reply.fontSize, 15);
- expect(lineOf(reply), closeTo(22, 0.01));
+ expect(reply.fontSize, 14);
+ expect(lineOf(reply), closeTo(20, 0.01));
});
- testWidgets('the composer writes at 15 px on 22 px lines', (tester) async {
+ testWidgets('the composer writes at 14 px on 20 px lines', (tester) async {
await showView(tester, ConversationServer());
final field = tester.widget<EditableText>(
find.descendant(
@@ -130,8 +133,8 @@ void main() {
matching: find.byType(EditableText),
),
);
- expect(field.style.fontSize, 15);
- expect(lineOf(field.style), closeTo(22, 0.01));
+ expect(field.style.fontSize, 14);
+ expect(lineOf(field.style), closeTo(20, 0.01));
});
testWidgets('sidebar items read at 15 px on rows 28 px apart, a project 32', (
diff --git a/desktop/test/swarm_elements_gallery_test.dart b/desktop/test/swarm_elements_gallery_test.dart
index 0d6ce7720..12e10129a 100644
--- a/desktop/test/swarm_elements_gallery_test.dart
+++ b/desktop/test/swarm_elements_gallery_test.dart
@@ -11,6 +11,7 @@ import 'package:harness/state/harness_activity.dart';
import 'package:harness/shared/theme/app_icons.dart';
import 'package:harness/shared/theme/app_type.dart';
import 'package:harness/shared/widgets/app_icon_button.dart';
+import 'package:harness/state/harness_attachments.dart';
import 'package:harness/super_tabs/buddy_card.dart';
import 'package:harness/super_tabs/buddy_rows.dart';
import 'package:harness/super_tabs/chat/agent_chat_header.dart';
@@ -19,7 +20,9 @@ import 'package:harness/super_tabs/decisions.dart';
import 'package:harness/super_tabs/decisions_view.dart';
import 'package:harness/super_tabs/avatar_art.dart';
import 'package:harness/super_tabs/identity.dart';
+import 'package:harness/super_tabs/message_row.dart';
import 'package:harness/super_tabs/model.dart';
+import 'package:harness/super_tabs/reply_box.dart';
import 'package:harness/super_tabs/tasks/personal_task_card.dart';
import 'package:harness/super_tabs/tasks/personal_tasks.dart';
import 'package:harness/super_tabs/tasks/tasks_pane_header.dart';
@@ -28,6 +31,7 @@ import 'package:harness/terminal/terminal_typography.dart';
import 'super_tab_personal_tasks_pane_test.dart' show TasksFixture;
import 'support/buddy_engine_fixture.dart';
+import 'support/super_tab_fixture.dart';
/// The Swarm elements gallery (desktop-design-system.md, Swarm elements): every
/// element drawn in light and dark against its checked-in image. A new or
@@ -139,7 +143,7 @@ Future<List<SuperTabController>> _show(
await buddy.select('swarm-buddy-peer');
await member.select('aeef');
tester.view.devicePixelRatio = 1;
- tester.view.physicalSize = const Size(760, 1460);
+ tester.view.physicalSize = const Size(760, 1740);
addTearDown(tester.view.reset);
await tester.pumpWidget(
MaterialApp(
@@ -615,6 +619,29 @@ class _Gallery extends StatelessWidget {
),
],
),
+ title('Chat: message rows, and the composer empty and typed'),
+ SizedBox(
+ width: 440,
+ child: Column(
+ children: [
+ _message(
+ 'River',
+ 'New Project is in the sidebar now.',
+ agent: _agent('River'),
+ ),
+ _message('dee', 'Found it, thanks!', person: _person),
+ ],
+ ),
+ ),
+ const SizedBox(height: 8),
+ const Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SizedBox(width: 340, child: _Composer('empty', '')),
+ SizedBox(width: 16),
+ SizedBox(width: 340, child: _Composer('typed', 'Ship it')),
+ ],
+ ),
title('Top bar: your Buddy, a member agent'),
for (final c in bars)
SizedBox(
@@ -722,6 +749,78 @@ class _Gallery extends StatelessWidget {
}
}
+/// A chat message row, as the chat draws one. Its time is words, which the
+/// comparison leaves out, so the image holds in every time zone.
+Widget _message(
+ String author,
+ String text, {
+ SuperTabAgent? agent,
+ SuperTabPerson? person,
+}) => SuperTabMessageRow(
+ message: SuperTabMessage.fromJson({
+ 'id': 'm-$author',
+ 'conversationId': 'lead',
+ 'text': text,
+ 'sequence': 1,
+ 'createdAt': '2026-11-07T09:12:00Z',
+ 'author': agent != null
+ ? {'kind': 'agent', 'id': agent.id, 'name': author}
+ : {'kind': 'person', 'id': person!.id, 'name': '[email protected]'},
+ }),
+ author: author,
+ agent: agent,
+ person: person,
+ receipts: const [],
+ onReturnToComposer: () {},
+ readerId: 'p1',
+);
+
+/// A chat composer ([SuperTabReplyBox], the box both composers draw) holding
+/// [typed]: the round send grey while empty, blue once there is text.
+class _Composer extends StatefulWidget {
+ const _Composer(this.name, this.typed);
+ final String name, typed;
+
+ @override
+ State<_Composer> createState() => _ComposerState();
+}
+
+class _ComposerState extends State<_Composer> {
+ final SuperTabController controller = ConversationServer().controller();
+ late final text = TextEditingController(text: widget.typed);
+ final focus = FocusNode();
+ final files = HarnessAttachments();
+
+ @override
+ void dispose() {
+ text.dispose();
+ focus.dispose();
+ files.dispose();
+ controller.dispose();
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) => SuperTabReplyBox(
+ controller: controller,
+ text: text,
+ focus: focus,
+ files: files,
+ enabled: true,
+ writable: true,
+ busy: false,
+ error: null,
+ onEdited: (_) {},
+ onSend: () {},
+ onMic: () {},
+ hint: 'Message #Pilot',
+ surfaceKey: ValueKey('gallery-composer-${widget.name}'),
+ fieldKey: ValueKey('gallery-composer-field-${widget.name}'),
+ sendKey: ValueKey('gallery-composer-send-${widget.name}'),
+ micKey: ValueKey('gallery-composer-mic-${widget.name}'),
+ );
+}
+
/// Matches when [galleryDifference] finds none. A mismatch fails with what
/// differs and saves the image it drew to the system temp folder, never into
/// the source tree, where CI's runner would count it as a changed source.
diff --git a/docs/plans/2026-11-07-swarm-chat-quiet-plan.md b/docs/plans/2026-11-07-swarm-chat-quiet-plan.md
new file mode 100644
index 000000000..8c0165a08
--- /dev/null
+++ b/docs/plans/2026-11-07-swarm-chat-quiet-plan.md
@@ -0,0 +1,94 @@
+# Swarm chat, quiet: round 28 faces, quiet message lines, a composer that matches Cmd-N (task #4467)
+
+**Goal:** Redraw the Swarm chat by anh Dee's six rules (11-07 15:35): round faces at 28, the name in semibold, the
+time in 12 tertiary, text at 14, and a composer that matches Cmd-N's field with a round send button that stays
+neutral until there is something to send.
+
+**Architecture:** The chat's sizes already live in one place each: the message face in `AppDesktop.messageAvatar*`,
+the text in `SwarmType`, the composer's box in `AppDesktop.composerRadius`. Change those values and the two
+composers (the main chat's in `view.dart`, the thread's `SuperTabReplyBox`) pick them up. The one new element, the
+round send button, lives in `desktop/lib/super_tabs/chat/` and both composers use it, so there is one send button.
+
+**Tech Stack:** Flutter (Desktop), flutter_test widget tests; the gallery from #4461 for light and dark.
+
+**Spec:** task #4467 brief (River, 11-07, from anh Dee's 'sure' at 15:35).
+
+Way of working: the project's Engineer flow: this plan first, each task's failing test committed before its code,
+one pull request, one independent review.
+
+```
+ ● River 4:12 PM 28 round face · 13 semibold · 12 tertiary
+ New Project is in the sidebar now. 14 text
+ ● dee 4:13 PM
+ Found it, thanks!
+╭──────────────────────────────────────────────╮ radius 12, hairline, faint fill
+│ Message River │
+│ 📎 @ New session 🎤 (↑) │ (↑) round: grey empty, blue with text
+╰──────────────────────────────────────────────╯
+```
+
+## Global Constraints
+
+- Desktop only; a phone layout (`workspaceIsCompact`) keeps the app's sizes, as today.
+- Rule 1: grey everywhere, colour only on agent faces. Rule 2: blue only for the main action (send with text).
+- Rule 3: 14 chat, 13 names, 12 details. Light and dark, at 880 and wide.
+- Keep what the composer already holds: @ Tag and New session (Huy and Scholes, 11-04); only the attach glyph, the
+ corners and the send button change.
+- Every changed element goes into the design doc's Swarm elements section and the gallery test (#4461) in this PR.
+- Windows: no process starts; nothing platform-specific.
+
+## Review Focus
+
+- The send button with only a file attached (no text) turns blue: a file is something to send.
+- A queued message while busy (`canQueueText`) still enables send in the main chat, so it turns blue then too.
+- A message row whose author left the Swarm still draws a round face (the fallback branch).
+- The name line keeps the body's 20 px line, so a row's height doesn't jump between name and text.
+- Dark mode: the neutral send button's fill and arrow stay readable on the field (no new colour: `field` step and
+ `hint` ink).
+
+## Task 1: round message faces at 28
+
+**Files:** `desktop/lib/shared/theme/app_theme.dart` (`messageAvatarSize`, drop `messageAvatarRadius`),
+`desktop/lib/super_tabs/message_row.dart` (`superTabMessageAvatar`), test `desktop/test/super_tab_chat_quiet_test.dart`.
+
+- [ ] Test: a message row's face is 28 × 28 and round (`SuperTabAvatarFace.radius == null`), for an agent, a person
+ and an author who left.
+- [ ] Watch it fail (36, radius 8).
+- [ ] `messageAvatarSize = 28`; `superTabMessageAvatar` passes no radius; remove `messageAvatarRadius`.
+- [ ] Pass; run the message row tests.
+
+## Task 2: quiet message lines
+
+**Files:** `desktop/lib/super_tabs/swarm_type.dart`, `desktop/test/super_tab_typography_test.dart`.
+
+- [ ] Test (typography test updated): body and composer 14 on 20; the sender 13 in semibold (w600) on 20; the time
+ 12 in `textFaint` (tertiary); markdown keeps 14; the thread header is a name, 13 semibold.
+- [ ] Watch it fail.
+- [ ] `bodySize = 14`, `bodyLine = 20`, `nameSize = 13`, `nameWeight = FontWeight.w600`; `time` in `DesktopChrome.hint`.
+- [ ] Pass.
+
+## Task 3: the composer matches Cmd-N
+
+**Files:** `desktop/lib/super_tabs/chat/send_button.dart` (new), `desktop/lib/super_tabs/view.dart` (composer's
+attach and send only), `desktop/lib/super_tabs/reply_box.dart`, `desktop/lib/shared/theme/app_theme.dart`
+(`composerRadius`), tests `desktop/test/super_tab_chat_quiet_test.dart`, `super_tab_composer_row_test.dart`.
+
+**Interfaces:** `SwarmSendButton({Key? key, required String tooltip, VoidCallback? onPressed})`: a 28 round button,
+key `swarm-send-fill` on its circle; null `onPressed` draws it neutral (`DesktopChrome.rim` fill, `hint` arrow),
+else blue (`AppPalette.accent` fill, white arrow).
+
+- [ ] Test: both composers' boxes have radius 12 and a hairline; attach shows `AppIcons.paperclip`; send is a round
+ 28 button, neutral when empty, blue after typing and after attaching a file, neutral again when cleared.
+- [ ] Watch it fail.
+- [ ] Add `SwarmSendButton`; use it in both composers; paperclip in both; `composerRadius = 12`.
+- [ ] Pass; run the composer tests.
+
+## Task 4: design doc and gallery
+
+**Files:** `desktop/design/desktop-design-system.md` (Swarm elements: Chat), the gallery test from #4461 and its
+images.
+
+- [ ] Gallery: a message row (agent and person), the composer empty and with text, in light and dark; fails before
+ the images are updated.
+- [ ] Update the images, inspect them, commit.
+- [ ] Doc: the chat's face, name, time, text and composer numbers, and the send button's two states.