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.

Round dial: thread face without "‹ chat" or spine, dial scroll moves the open thread, voice keeps its thread (Diego) (#2893)

0xdiego25f2acf9a59ff8
diff --git a/cli/src/cable/cableSession.spec.ts b/cli/src/cable/cableSession.spec.ts
index 4c70c5848..5cb78669f 100644
--- a/cli/src/cable/cableSession.spec.ts
+++ b/cli/src/cable/cableSession.spec.ts
@@ -5607,6 +5607,20 @@ describe('swarm cards', () => {
}
})
+ it('logs why a voice turn ended in an error: the failed post and the words the dial was shown', async () => {
+ const lines: string[] = []
+ const offline = vi.fn(async (): Promise<SaidOnCard> => { throw new Error('offline') })
+ const host = cardHost({ cards: [card('st1', [withBuddy({ local: 'h1' })])] }, { transcribe: vi.fn(async () => 'ship it'), route: vi.fn(), swarmSay: offline, log: (l: string) => lines.push(l) })
+ const { session, port } = await connect(host)
+ try {
+ port.say(BUDDY); await settle()
+ voice(port, 'h1')
+ await vi.waitFor(() => expect(port.sent.some((m) => m.t === 'voice.error')).toBe(true))
+ } finally { await session.stop() }
+ expect(lines).toContain('cable: voice → Swarm chat of h1 failed (offline)')
+ expect(lines).toContain('cable: voice → error "Could not reach your Buddy. Try again."')
+ })
+
it('on the Buddy face an unreachable post shows voice.error and types nothing', async () => {
const offline = vi.fn(async (): Promise<SaidOnCard> => { throw new Error('offline') })
expect(await spoken(BUDDY, [withBuddy({ local: 'h1' })], offline)).toEqual({ errors: ['Could not reach your Buddy. Try again.'], turns: [] })
diff --git a/cli/src/cable/cableSession.ts b/cli/src/cable/cableSession.ts
index efb305fa0..4600ddb5e 100644
--- a/cli/src/cable/cableSession.ts
+++ b/cli/src/cable/cableSession.ts
@@ -2251,9 +2251,11 @@ export class CableSession {
const generation = this.voiceGeneration
const uploadId = this.voiceUploadId
const current = () => generation === this.voiceGeneration
- const reply = (message: Message) => current()
- ? this.send({ ...message, ...(uploadId ? { uploadId } : {}) })
- : Promise.resolve(false)
+ const reply = (message: Message) => {
+ // Every way a turn ends in an error is logged, with the words the dial shows: several ended silently (Diego, 2026-11-04).
+ if (message.t === 'voice.error' && current()) this.log(`cable: voice → error "${String(message.message)}"`)
+ return current() ? this.send({ ...message, ...(uploadId ? { uploadId } : {}) }) : Promise.resolve(false)
+ }
this.voice = null
if (turn?.draft && (!turn.draft.pin || !this.voiceDraft.current(turn.draft.pin))) {
await reply({ t: 'voice.error', message: 'That draft changed. Review it again.' }); return
@@ -2476,7 +2478,10 @@ export class CableSession {
// refused post for a read-only Chat with PM was typed into the PM's terminal.
if (turn.agentId && !carried && !selection?.ok && this.host.swarmSay) {
const face = turn.swarmFace
- const said = await this.host.swarmSay(agentId, instruction, ...this.sayArgs(face, turn.onFace)).catch((): SaidOnCard => ({ said: false }))
+ const said = await this.host.swarmSay(agentId, instruction, ...this.sayArgs(face, turn.onFace)).catch((err: Error): SaidOnCard => {
+ this.log(`cable: voice → Swarm chat of ${agentId.slice(0, 8)} failed (${err?.message ?? err})`)
+ return { said: false }
+ })
if (!current()) return
if (said.said) {
this.log(`cable: voice → Swarm chat of ${agentId.slice(0, 8)}`)
diff --git a/cli/src/core/devicesLink.spec.ts b/cli/src/core/devicesLink.spec.ts
index 061875f2c..87e772922 100644
--- a/cli/src/core/devicesLink.spec.ts
+++ b/cli/src/core/devicesLink.spec.ts
@@ -264,6 +264,10 @@ describe('the devices\' Swarm card requests to the Super Tab service', () => {
expect((await devices.answer('super_tabs', { action: 'cardSay', harnessId: 'h1', text: 'ship it', chatId: 'pm1', reviewed: true })).echoed).toEqual({ action: 'cardSay', harnessId: 'h1', text: 'ship it', chatId: 'pm1', reviewed: true })
expect((await devices.answer('super_tabs', { action: 'cardSay', harnessId: 'h1', text: 'ship it', chatId: 'pm1', reviewed: 'yes' })).echoed).toEqual({ action: 'cardSay', harnessId: 'h1', text: 'ship it', chatId: 'pm1' })
expect((await devices.answer('super_tabs', { action: 'cardSay', harnessId: 'h1', text: 'ship it', chatId: 7 })).echoed).toEqual({ action: 'cardSay', harnessId: 'h1', text: 'ship it' })
+ // A swarmThread dial's words carry the thread on the face as it began (null: none) and whether they may start one (#2756).
+ expect((await devices.answer('super_tabs', { action: 'cardSay', harnessId: 'h1', text: 'ship it', chat: 'buddy', chatId: 'b0', thread: 'm9', threaded: true })).echoed).toEqual({ action: 'cardSay', harnessId: 'h1', text: 'ship it', chat: 'buddy', chatId: 'b0', thread: 'm9', threaded: true })
+ expect((await devices.answer('super_tabs', { action: 'cardSay', harnessId: 'h1', text: 'ship it', thread: null })).echoed).toEqual({ action: 'cardSay', harnessId: 'h1', text: 'ship it', thread: null })
+ expect((await devices.answer('super_tabs', { action: 'cardSay', harnessId: 'h1', text: 'ship it', thread: 7, threaded: 'yes' })).echoed).toEqual({ action: 'cardSay', harnessId: 'h1', text: 'ship it' })
expect((await devices.answer('super_tabs', { action: 'cardSide', tabId: 't1', side: 'buddy', leadId: 'l1', text: 'x' })).echoed).toEqual({ action: 'cardSide', tabId: 't1', side: 'buddy' })
})
})
diff --git a/cli/src/core/devicesLink.ts b/cli/src/core/devicesLink.ts
index 78b0232a8..10f6f37da 100644
--- a/cli/src/core/devicesLink.ts
+++ b/cli/src/core/devicesLink.ts
@@ -131,7 +131,10 @@ export function createDevicesLink(deps: DevicesLinkDeps) {
const chat = payload.chat === true || payload.chat === 'buddy' ? { chat: payload.chat } : {}
return core.superTabRequest(action === 'cardsWanted' ? { action, on: on === true, include, ...(focus !== undefined ? { focus } : {}) }
: action === 'cardSay' ? { action, harnessId, text, ...chat, ...(typeof payload.chatId === 'string' ? { chatId: payload.chatId } : {}),
- ...(payload.reviewed === true ? { reviewed: true } : {}) }
+ ...(payload.reviewed === true ? { reviewed: true } : {}),
+ // A swarmThread dial's pinned thread (null: none) and whether its words may start one (spec 2026-11-03-dial-thread-face).
+ ...(payload.thread === null || typeof payload.thread === 'string' ? { thread: payload.thread } : {}),
+ ...(payload.threaded === true ? { threaded: true } : {}) }
: action === 'cardWorker' ? { action, machineId, harnessId }
: action === 'cardSide' ? { action, tabId, side }
: { action, tabId, leadId, session, ...chat })
diff --git a/desktop/lib/super_tabs/thread_panel.dart b/desktop/lib/super_tabs/thread_panel.dart
index 1849ce7f0..ccd84ebf2 100644
--- a/desktop/lib/super_tabs/thread_panel.dart
+++ b/desktop/lib/super_tabs/thread_panel.dart
@@ -32,6 +32,7 @@ class SuperTabThreadPanel extends StatefulWidget {
required this.outgoing,
this.sessionActivity,
this.machineName,
+ this.onScroll,
});
final SuperTabController controller;
@@ -50,6 +51,10 @@ class SuperTabThreadPanel extends StatefulWidget {
/// A machine's name, said beside an agent `@` offers.
final String Function(String machineId)? machineName;
+ /// Given the thread's list while the panel lives (null once it is gone),
+ /// so a device scrolling this Swarm scrolls the thread, not the chat.
+ final ValueChanged<ScrollController?>? onScroll;
+
@override
State<SuperTabThreadPanel> createState() => _SuperTabThreadPanelState();
}
@@ -100,6 +105,7 @@ class _SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
super.initState();
_focus.requestFocus();
_scroll.addListener(_measureAfterFrame);
+ widget.onScroll?.call(_scroll);
}
@override
@@ -124,6 +130,7 @@ class _SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
@override
void dispose() {
+ widget.onScroll?.call(null);
_scroll.dispose();
_composer.dispose();
_focus.dispose();
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index ac28bf613..53fff7938 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -219,8 +219,15 @@ class _SuperTabViewState extends State<SuperTabView>
widget.app?.readPullRequestsStatus,
);
- /// A device with a Lead of this Swarm open scrolls the chat on screen.
- late final _dial = DialListScroll(() => _scroll[c.selectedId]);
+ /// A device with a Lead of this Swarm open scrolls the chat on screen, or
+ /// the thread open beside it (the dial's thread face shows that thread).
+ late final _dial = DialListScroll(
+ () =>
+ c.openedThread?.conversationId == c.selectedId && _threadScroll != null
+ ? _threadScroll
+ : _scroll[c.selectedId],
+ );
+ ScrollController? _threadScroll;
VoidCallback? _unregisterDial;
void _registerDial() {
_unregisterDial?.call();
@@ -3251,6 +3258,7 @@ class _SuperTabViewState extends State<SuperTabView>
sessionActivity: (session) =>
superTabSessionActivity(c, widget.app, session),
machineName: widget.machineName,
+ onScroll: (list) => _threadScroll = list,
);
}
diff --git a/desktop/test/super_tab_dial_scroll_test.dart b/desktop/test/super_tab_dial_scroll_test.dart
index 03157bd81..300c1d4e1 100644
--- a/desktop/test/super_tab_dial_scroll_test.dart
+++ b/desktop/test/super_tab_dial_scroll_test.dart
@@ -3,6 +3,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
import 'package:harness/state/app_state.dart';
import 'package:harness/super_tabs/view.dart';
+import 'package:harness/widgets/laid_out_list.dart';
import 'support/super_tab_fixture.dart';
import 'swarm_state_test.dart' show createApp;
@@ -134,4 +135,80 @@ void main() {
);
},
);
+
+ // A thread open beside the chat is what the dial's thread face shows: the dial scrolls the thread, never the chat behind it
+ // (Diego, 2026-11-04).
+ testWidgets(
+ 'with a thread open, the dial scrolls the thread and leaves the chat',
+ (tester) async {
+ final app = createApp(connected: true);
+ addTearDown(app.dispose);
+ final server = ConversationServer()..threads = true;
+ for (var i = 0; i < 60; i++) {
+ server.append('message $i');
+ }
+ for (var i = 1; i <= 40; i++) {
+ server.append('Reply $i: a long enough answer to fill the pane.');
+ server.messages.last
+ ..['thread'] = 'message-1'
+ ..['replyTo'] = 'message-1';
+ }
+ final c = server.controller();
+ addTearDown(c.dispose);
+ await c.refresh();
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: Scaffold(
+ body: SuperTabView(
+ controller: c,
+ app: app,
+ onInvite: () {},
+ onAddAgent: (_) {},
+ onOpenTerminal: (_) {},
+ machineName: (_) => 'Team Mac',
+ ),
+ ),
+ ),
+ );
+ await tester.pumpAndSettle();
+ c.openThread('message-1');
+ await tester.pumpAndSettle();
+ ScrollPosition chat() => tester
+ .widget<ScrollView>(
+ find.byKey(const PageStorageKey('super-messages-tab-lead')),
+ )
+ .controller!
+ .position;
+ ScrollPosition thread() => tester
+ .widget<ListView>(
+ find.descendant(
+ of: find.byKey(const ValueKey('super-thread-panel')),
+ matching: find.byType(LaidOutListView),
+ ),
+ )
+ .controller!
+ .position;
+ final chatAt = chat().pixels, threadEnd = thread().pixels;
+ expect(threadEnd, greaterThan(100));
+
+ Future<void> dial(Map<String, dynamic> p) => app.handleEventForTest('m', {
+ 'type': 'dial_scroll',
+ 'payload': {...p, 'superTabId': 'tab'},
+ });
+ await dial({'phase': 'down', 'dy': 0});
+ await dial({'phase': 'move', 'dy': 20});
+ expect(thread().pixels, threadEnd - 50);
+ expect(chat().pixels, chatAt, reason: 'the chat behind the thread stays');
+
+ // Closed, the thread gives the dial back to the chat.
+ c.closeThread();
+ await tester.pumpAndSettle();
+ final back = chat().pixels;
+ await dial({'phase': 'move', 'dy': 20});
+ expect(chat().pixels, back - 50);
+ await dial({'phase': 'up', 'dy': 0, 'velocity': 0});
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
}
diff --git a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
index 4a9b0c099..6a8b1d0f1 100644
--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
@@ -1456,8 +1456,8 @@ static void render_buddy_empty(ht_scene_t *f, const ht_lead_t *l)
/*
* THE THREAD FACE (spec 2026-11-03-dial-thread-face, mockup round-thread): a Lead whose face chat is a thread. The teal
* ring at the glass edge, "Thread" (Buddy: "Thread · Buddy"), the thread's title on two lines, no pet, and the card of the
- * thread's last message with a teal spine, its meta line (who, how many replies) and up to three lines; "Waiting for ..."
- * until one comes. "‹ chat" at the left edge says which way out. Inter has no hooked arrow, so the label leads with ›.
+ * thread's last message with its meta line (who, how many replies) and up to three lines; "Waiting for ..." until one
+ * comes. A sideways swipe leaves it. Inter has no hooked arrow, so the label leads with one drawn in boxes.
*/
// The next line of `*cursor` in `w` px, copied to `out`.
static void thread_line(const char **cursor, const ht_font_t *font, int w, char out[HT_TEXT_BYTES])
@@ -1518,20 +1518,12 @@ static void face_thread(ht_scene_t *f, const ht_lead_t *l, bool buddy, const cha
}
if (rows == 0) rows = 1;
int h = 26 + rows * 38 + (meta[0] ? 28 : 0);
- // x 63..403, symmetric, so "‹ chat" has room at the edge. Three lines under a two-line title end at y 369: its corners
- // are 180 px from the centre at most, inside the ring's 226 px inner edge, so all three lines stay.
+ // x 63..403, symmetric. Three lines under a two-line title end at y 369: its corners are 180 px from the centre at most,
+ // inside the ring's 226 px inner edge, so all three lines stay. No spine and no "chat" label (Diego, 2026-11-04).
ht_box(f, 63, top, 340, h, 28, card, color(mix_black(TEAL, 70)));
- ht_box(f, 63, top + 18, 7, h - 36, 3, teal, teal);
if (meta[0]) focus_put(f, 75, top + 13, 316, small, teal, card, meta, true);
if (!recap) focus_put(f, 75, top + 17, 316, body, DIM, card, buddy ? "Waiting for your Buddy…" : "Waiting for the PM…", true);
else for (int i = 0; i < rows; i++) focus_put(f, 75, top + (meta[0] ? 45 : 17) + i * 38, 316, body, wait ? ACCENT : FG, card, text[i], true);
- // The way out: a chevron at the left edge, small "chat" under it.
- uint16_t out = color(mix_black(TEAL, 85));
- // At the screen's vertical centre, where the glass is widest: "‹" just above y 233, "chat" just below, 15 px in from the
- // edge, so every corner of both runs is 6 px or more inside the ring's inner edge (r 226.5), and 8 px clear of the card.
- int cw = ht_measure(&ht_mono_16, "chat"), vw = ht_measure(body, "\u2039");
- ht_text(f, 15 + (cw - vw) / 2, 233 - body->height, vw, body, out, bg, "\u2039");
- ht_text(f, 15, 234, cw, &ht_mono_16, out, bg, "chat");
}
/*
* A SWARM PANE'S FACE (spec §4): the agent face, built from the Lead. The project on the upper arc; working: the pet
diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.py
index 6860875f0..9d027c497 100644
--- a/devices/harness-device/firmware/test/test_touch_ui.py
+++ b/devices/harness-device/firmware/test/test_touch_ui.py
@@ -2161,28 +2161,17 @@ static bool teal_ring(void) {
return false;
}
// The label is "Thread" with a teal hook arrow of boxes left of it (Inter has no U+21B3, and no "›" stands in); the card starts at
-// x 60 and "chat" ends 8 px or more left of it.
+// x 63. No "‹ chat" at the left edge and no teal spine on the card (Diego, 2026-11-04): the swipe out needs no label.
static void thread_chrome_checks(void) {
- const ht_run_t *label = NULL, *chat = NULL; int card_x = -1;
+ const ht_run_t *label = NULL; int card_x = -1, spines = 0;
for (int i = 0; i < scene.count; i++) {
const ht_run_t *r = &scene.runs[i];
if (!strcmp(r->text, "Thread")) label = r;
- if (!strcmp(r->text, "chat")) chat = r;
if (!r->text[0] && r->w == 340 && r->box.h >= 60) card_x = r->x;
+ if (!r->text[0] && r->w == 7 && r->box.fill == ht_rgb(0x2dd4bf)) spines++;
}
- assert(label && chat && card_x == 63 && !scene_says("\xe2\x80\xba"));
- assert(chat->x + chat->w + 8 <= card_x);
- // Both runs of the way out: every corner of the box is 6 px or more inside the ring's inner edge (r 226.5 from 233, 233).
- const ht_run_t *out[2] = {chat, NULL};
- for (int i = 0; i < scene.count; i++) if (!strcmp(scene.runs[i].text, "\xe2\x80\xb9")) out[1] = &scene.runs[i];
- assert(out[1]);
- for (int k = 0; k < 2; k++) {
- ht_rect_t b = ht_run_bounds(out[k]);
- for (int c = 0; c < 4; c++) {
- int dx = (c & 1 ? b.x + b.w : b.x) - 233, dy = (c & 2 ? b.y + b.h : b.y) - 233;
- assert(dx * dx + dy * dy <= 220 * 220 + 220 / 2); // 220.5 squared, to the pixel
- }
- }
+ assert(label && card_x == 63 && !scene_says("\xe2\x80\xba"));
+ assert(!scene_says("chat") && !scene_says("\xe2\x80\xb9") && spines == 0);
int strokes = 0;
for (int i = 0; i < scene.count; i++) {
const ht_run_t *r = &scene.runs[i];
@@ -2205,7 +2194,7 @@ static void swarm_thread_checks(const char *dir) {
assert(title_is("web-api") && scene_says("Thread") && scene_says("Fix the login bug on Safari") && scene_says("session expires"));
thread_chrome_checks();
portrait(dir, "thread-a-waiting-1line");
- assert(scene_says("Waiting for the PM") && scene_says("chat") && !scene_says("Working") && teal_ring() && !pet_frame());
+ assert(scene_says("Waiting for the PM") && !scene_says("Working") && teal_ring() && !pet_frame());
// The main chat's recap is not the thread's; the thread's is, with who spoke and how many.
ui_supertab_recap("s1", "T0", "pm1", "", "Merged #2704.", 1792560000u, false); scene_take();
assert(!scene_says("Merged") && scene_says("Waiting for the PM"));
diff --git a/docs/specs/2026-11-03-dial-thread-face.md b/docs/specs/2026-11-03-dial-thread-face.md
index 123a49068..ecdb6c170 100644
--- a/docs/specs/2026-11-03-dial-thread-face.md
+++ b/docs/specs/2026-11-03-dial-thread-face.md
@@ -15,8 +15,9 @@ Choices Diego made (mockup `devices/harness-device/mockup/round-thread/index.htm
the app closes the thread too. The next horizontal swipe changes project, as today.
- The app moving to another chat or thread moves the dial with it (the newest move wins, as the focus rule does today).
- The thread face: teal ring, "↳ Thread" (or "↳ Thread · Buddy") under the project's name, the thread's title on up to
- two lines, **no pet and no bottom arc**, the recap card with a teal spine and a small "PM · N replies" line, and "‹ chat"
- at the left edge. With no agent reply yet the card says "Waiting for the PM…" ("Waiting for your Buddy…").
+ two lines, **no pet and no bottom arc**, and the recap card with a small "PM · N replies" line. No spine on the card and
+ no "‹ chat" label (Diego, 2026-11-04: the sideways swipe needs no label). With no agent reply yet the card says
+ "Waiting for the PM…" ("Waiting for your Buddy…").
- The PM face keeps no chat label (the project's name is enough); the Buddy face keeps "Your Buddy".
## Builds on