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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Round dial: a hold on the recap opens Personal | Team; the name opens the project list again (#3307)
0xdiego255325d47b9ba2
diff --git a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.cindex 08151d9cc..5441e3917 100644--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c@@ -243,6 +243,7 @@ static EXT_RAM_BSS_ATTR struct {uint32_t voice_wait_until;hit_t hits[24];ht_rect_t caption_arc;+ ht_rect_t recap_card; // a Swarm face's recap on the glass (its card, padded), for a hold; empty on any other faceint hit_count, pressed;bool touch_down, touch_cancelled;bool touch_brake, coasting;@@ -884,6 +885,15 @@ static void tabs_open(void)if (s.view != TABS) return;ht_tab_carousel_reset(&tab_carousel, tabs_total(), tab_index_here());}+// A hold on the face: on a Swarm face's recap, the Personal | Team picker when the dial has both (Diego, 2026-11-06: the+// name stays the project list); anywhere else, or with no picker, the tabs.+static void face_hold(void)+{+ ht_rect_t r = s.recap_card;+ bool on_recap = r.w && s.start_x >= r.x && s.start_x < r.x + r.w && s.start_y >= r.y && s.start_y < r.y + r.h;+ if (on_recap && swarm_pick_open()) return;+ tabs_open();+}static void workspace_failed(const char *message){ht_workspace_cancel_request(&workspace);@@ -1343,7 +1353,7 @@ static void surface_tick(uint32_t now)pressed_action.kind == A_PET && !gesture.moved && held >= 650 && held < 5000) {// Enter directly. The opening contact is consumed until a real release,// so lifting or sliding after the hold cannot also select a tab.- tabs_open();+ face_hold();return;}ht_character_mood_t mood = s.view == VOICE ?@@ -1755,6 +1765,29 @@ static void render_swarm_face(ht_scene_t *f)s.caption_arc = (ht_rect_t){r.x - 14, r.y - 14, r.w + 28, r.h + 28};break;}+ // The recap's place, for a hold (face_hold): its card, or on a skin with none the box of its lines.+ if (recap && *recap) {+ ht_rect_t u = {0};+ for (int i = 0; i < f->count; i++) {+ const ht_run_t *r = &f->runs[i];+ if (r->box.h >= 40 && r->w >= 280 && r->y > 120 && r->y < 380) { u = (ht_rect_t){r->x, r->y, r->w, (int16_t)r->box.h}; break; }+ }+ for (int i = 0; !u.w && i < f->count; i++) {+ const ht_run_t *r = &f->runs[i];+ if (!r->text[0] || r->arc || r->box.h || r->y < 140 || r->y > 380) continue;+ ht_rect_t b = ht_run_bounds(r);+ for (int j = i; j < f->count; j++) {+ const ht_run_t *q = &f->runs[j];+ if (!q->text[0] || q->arc || q->box.h || q->y < 140 || q->y > 380) continue;+ ht_rect_t c = ht_run_bounds(q);+ int x0 = c.x < b.x ? c.x : b.x, y0 = c.y < b.y ? c.y : b.y;+ int x1 = c.x + c.w > b.x + b.w ? c.x + c.w : b.x + b.w, y1 = c.y + c.h > b.y + b.h ? c.y + c.h : b.y + b.h;+ b = (ht_rect_t){x0, y0, x1 - x0, y1 - y0};+ }+ u = b;+ }+ if (u.w) s.recap_card = (ht_rect_t){u.x - 12, u.y - 12, u.w + 24, u.h + 24};+ }// With the badge, the companion and its badge are the inbox's target; the rest of the face still talks.if (badge) s.hits[s.hit_count++] = (hit_t){{pet.x - 16, pet.y - 24, pet.w + 48, pet.h + 40}, A_PET_INBOX, 0, true};else if (bell && !told) s.hits[s.hit_count++] = (hit_t){{83, bell_y - 18, 300, 84}, A_INBOX, 0, true};@@ -2786,6 +2819,7 @@ bool habitat_scene_take(ht_scene_t *f)s.dirty = false;s.notice_frame = 0;s.hit_count = 0;+ s.recap_card = (ht_rect_t){0};// The custom pets' memory (pet_store.c): a pack dropped or replaced since the last scene was built is freed here.// The render task is the only caller, and it paints each scene before it takes the next (display_habitat.c), so// nothing drawn from those packs is still being rasterised. The scene it keeps as `front` (for the next damage@@ -3133,7 +3167,6 @@ static void dispatch(action_t a)view(HOME);break;case A_AGENTS: {- if (swarm_pick_open()) break; // a Swarm face with a Personal and a Team card: the picker, else PANESview(AGENTS);if (swarm_here()) { ht_tab_carousel_reset(&pane_carousel, swarm_here()->lead_n, sw.at); break; }ht_tab_carousel_reset(&pane_carousel, s.count, s.active >= 0 && s.active < s.count ? s.active : 0);@@ -3974,7 +4007,9 @@ void habitat_touch(bool down, int x, int y, uint32_t now)dispatch((action_t){.kind = A_VOICE_STOP, .value = 1});} else if (s.view == DRAFT && pressed_action.kind == A_DRAFT_EDIT) {pressed_action.kind = A_DRAFT_OPTIONS; dispatch(pressed_action);- } else if (surface && (pressed_action.kind == A_PET || pressed_action.kind == A_PET_INBOX))+ } else if (surface && pressed_action.kind == A_PET)+ face_hold();+ else if (surface && pressed_action.kind == A_PET_INBOX)tabs_open();} else if (result == HT_TOUCH_TAP) {if (pressed_action.kind == A_PET) {diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.pyindex 2e8522a18..d319b33e0 100644--- a/devices/harness-device/firmware/test/test_touch_ui.py+++ b/devices/harness-device/firmware/test/test_touch_ui.py@@ -86,6 +86,7 @@ static struct {question_t q;agent_t agents[MAX_PROJECTS]; hit_t hits[24];ht_rect_t caption_arc;+ ht_rect_t recap_card;} s;static ht_gesture_t gesture;static ht_character_t character;@@ -229,7 +230,7 @@ swarm_parts = {# with the last `swarms` list it keeps beside it'swarms_apply': source[source.index('// The last `swarms` list as it came'):source.index('void ui_swarms_replace(')],}-for name in ['copy', 'recap_preview', 'notice_unread', 'notice_was_read', 'notice_forget_read', 'notice_flush_reads', 'notice_mark_read', 'habitat_scene_receipt', 'habitat_scene_presented', 'pane_memory', 'pane_memory_apply', 'dismiss_result', 'activity_text', 'ensure', 'input_cancel', 'view', 'notice_open', 'workspace_index', 'swarm_core', 'swarm_voice_id', 'voice_lead', 'tabs_open', 'workspace_failed', 'tab_request', 'tabs_sync', 'ui_scroll_reportable', 'focus_skin', 'focus_face_for', 'focus_chord', 'focus_put', 'focus_span', 'focus_take', 'focus_rows', 'ui_rows', 'ui_can_display', 'ui_wrap', 'text_in', 'control', 'home_footer', 'footer_control', 'text', 'center', 'render_brand', 'heading', 'question_view', 'question_rows', 'question_move', 'question_text', 'render_question', 'render_choices', 'render_answer_review', 'question_answer', 'send_answer', 'make_action', 'character_mood', 'voice_status', 'home_caption_rotates', 'home_caption_tick', 'status_animated', 'status_speed', 'status_wake_ms', 'surface_tick', 'command_face', 'render_workspace_preview', 'question_prompt', 'focus_bell', 'mix_black', 'face_buddy_disc', 'face_buddy_ring', 'companion_box', 'notice_badge', 'pill2', 'swarm_pair', 'render_swarm_pick', 'face_buddy_avatar', 'render_buddy_empty', 'thread_line', 'thread_rest', 'face_thread', 'render_swarm_face', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'swarms_apply', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:+for name in ['copy', 'recap_preview', 'notice_unread', 'notice_was_read', 'notice_forget_read', 'notice_flush_reads', 'notice_mark_read', 'habitat_scene_receipt', 'habitat_scene_presented', 'pane_memory', 'pane_memory_apply', 'dismiss_result', 'activity_text', 'ensure', 'input_cancel', 'view', 'notice_open', 'workspace_index', 'swarm_core', 'swarm_voice_id', 'voice_lead', 'tabs_open', 'face_hold', 'workspace_failed', 'tab_request', 'tabs_sync', 'ui_scroll_reportable', 'focus_skin', 'focus_face_for', 'focus_chord', 'focus_put', 'focus_span', 'focus_take', 'focus_rows', 'ui_rows', 'ui_can_display', 'ui_wrap', 'text_in', 'control', 'home_footer', 'footer_control', 'text', 'center', 'render_brand', 'heading', 'question_view', 'question_rows', 'question_move', 'question_text', 'render_question', 'render_choices', 'render_answer_review', 'question_answer', 'send_answer', 'make_action', 'character_mood', 'voice_status', 'home_caption_rotates', 'home_caption_tick', 'status_animated', 'status_speed', 'status_wake_ms', 'surface_tick', 'command_face', 'render_workspace_preview', 'question_prompt', 'focus_bell', 'mix_black', 'face_buddy_disc', 'face_buddy_ring', 'companion_box', 'notice_badge', 'pill2', 'swarm_pair', 'render_swarm_pick', 'face_buddy_avatar', 'render_buddy_empty', 'thread_line', 'thread_rest', 'face_thread', 'render_swarm_face', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'swarms_apply', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:code += swarm_parts[name] if name in swarm_parts else function(name)code += function('render_settings') + function('ui_visit_state')code += function('ui_project_known') + function('ui_focus_project') + function('ui_apply_pending_focus')@@ -319,7 +320,7 @@ code += 'static bool audio_client_active(void);\n' + function('ui_boot_pressed')code += r'''static ht_scene_t scene;static void scene_take(void) {- ht_scene_clear(&scene, BG); s.hit_count = 0; s.notice_frame = 0;+ ht_scene_clear(&scene, BG); s.hit_count = 0; s.notice_frame = 0; s.recap_card = (ht_rect_t){0};if (s.view == OTA) render_brand(&scene);else if (s.view == DRAFT) render_draft(&scene);else if (s.view == DRAFT_OPTIONS) render_draft_options(&scene);@@ -2645,16 +2646,29 @@ static bool pick_pill(void) {}return false;}+// Diego (2026-11-06): in a Swarm, a hold on the recap opens Personal | Team; the name keeps opening the project list.+static void hold_at(int x, int y) {+ fake_ms += 1000; habitat_touch(true, x, y, fake_ms); surface_tick(fake_ms + 700);+ habitat_touch(false, x, y, fake_ms + 760); scene_take();+}+static void hold_recap(void) {+ ui_supertab_recap(sw.tab, sw.lead, "c0", "", "Tests green on all three boards.", 1792560000u, false); scene_take();+ ht_rect_t c = s.recap_card; assert(c.w && c.h);+ hold_at(c.x + c.w / 2, c.y + c.h / 2);+}static void swarm_pick_checks(const char *dir) {- // The title opens the picker: "Swarm" on the top arc, one pill, the Swarm on the face (Team) filled.+ // The name opens the project list (PANES), even with a Personal and a Team card.pick_setup(true, 1, "s1");- fake_ms += 1000; tap(fake_ms, 233, 30);+ fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == AGENTS);+ dispatch((action_t){.kind = A_HOME}); scene_take();+ // A hold on the recap opens the picker: "Swarm" on the top arc, one pill, the Swarm on the face (Team) filled.+ hold_recap();assert(s.view == SWARM_PICK && scene_says("Swarm") && scene_says("Personal") && scene_says("Team") && pick_pill() && pick_half() == 1);portrait(dir, "pick-team");// Personal by a thumb's press (drifting, held): the Personal card's first Lead on the face, the desktop told as for a tab pick.thumb(183, 233, 14, 10, 500);assert(s.view == HOME && !strcmp(sw.tab, "sp") && !strcmp(sw.lead, "P0") && wire_has(0, "select sp P0"));- fake_ms += 1000; tap(fake_ms, 233, 30);+ hold_recap();assert(s.view == SWARM_PICK && pick_half() == 0);portrait(dir, "pick-personal");// The filled half only returns, unchanged and silent.@@ -2663,30 +2677,34 @@ static void swarm_pick_checks(const char *dir) {// Team goes to the last non-Personal card shown, else the first in list order.pick_setup(true, 2, "s3");swarm_enter(ht_supertabs_find(&swarm, "sp"), NULL, true); scene_take();- fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK);+ hold_recap(); assert(s.view == SWARM_PICK);fake_ms += 1000; tap(fake_ms, 283, 233);assert(s.view == HOME && !strcmp(sw.tab, "s3") && !strcmp(sw.lead, "B0") && wire_has(0, "select s3 B0"));pick_setup(true, 2, "sp");- fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK);+ hold_recap(); assert(s.view == SWARM_PICK);fake_ms += 1000; tap(fake_ms, 283, 233);assert(s.view == HOME && !strcmp(sw.tab, "s1") && !strcmp(sw.lead, "A0"));// Idle: 5 s with no touch returns to the same Lead and side, and sends no select or side frame.pick_setup(true, 1, "s1");- fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK);+ hold_recap(); assert(s.view == SWARM_PICK);swarm_sent = 0; fake_ms += 4000; surface_tick(fake_ms); assert(s.view == SWARM_PICK);fake_ms += 1000; surface_tick(fake_ms); scene_take();assert(s.view == HOME && !strcmp(sw.tab, "s1") && !strcmp(sw.lead, "A0") && no_side_since(0)); // (a recap retry may still go out with time)// A finger held down past the idle deadline does not make the wake 1 ms on every pass (the picker waits for the lift).pick_setup(true, 1, "s1");- fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK && s.pick_until);+ hold_recap(); assert(s.view == SWARM_PICK && s.pick_until);sw.retried = true; // the recap's own 5 s retry is not under tests.touch_down = true; fake_ms = s.pick_until + 500; assert(habitat_next_wake_ms() > 1); s.touch_down = false;assert(habitat_next_wake_ms() == 1); // and once lifted the deadline is due- // No picker without both a Personal card and another: the name keeps opening PANES.+ // No picker without both a Personal card and another: the hold opens the tabs, as on any face.pick_setup(true, 0, "sp");- fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == AGENTS);+ hold_recap(); assert(s.view == TABS);pick_setup(false, 2, "s1");- fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == AGENTS);+ hold_recap(); assert(s.view == TABS);+ // A hold off the recap (on the pet) opens the tabs too.+ pick_setup(true, 1, "s1");+ ui_supertab_recap(sw.tab, sw.lead, "c0", "", "Tests green.", 1792560000u, false); scene_take();+ hold_at(233, 110); assert(s.view == TABS);}static void swarm_pair_checks(const char *dir) {// Drawn: 180 x 44 at y 388, "PM" lit, no side dots, no lower-arc hint, no unread bell.diff --git a/docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md b/docs/specs/2026-11-05-dial-lead-pm-buddy-pair.mdindex cd2f83a77..1109512ec 100644--- a/docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md+++ b/docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md@@ -7,7 +7,7 @@ On the round dial's Lead face (a Swarm project's face), change only these, keep1. Switch between the PM and the Buddy with a **PM | Buddy** pair at the bottom (as in his reference: the bell pill above atwo-part pill), instead of swiping up and down.2. Notices open **only by tapping the bell**; pulling down no longer opens them.-3. In a Swarm, tapping the **project name** opens a picker with two choices only, **Personal | Team** (mockup option B: one+3. In a Swarm, holding the **recap** (first: tapping the project name; changed 2026-11-06) opens a picker with two choices only, **Personal | Team** (mockup option B: onepill, the current half filled).4. In a Swarm, the bell and its page hold **only what needs you**.5. The "PM" line under the project name goes.@@ -69,8 +69,10 @@ unread), so it often does the wrong one. After this change a vertical swipe on t- The Swarm list (`/api/super-tabs/list`) marks the reader's own Personal Swarm: `personal: true` on its row only.- The cards service copies it to the card (`SwarmCard.personal`), and the `supertab` frame carries `"personal": true` for it.-- On a Swarm face, tapping the project name opens the picker **when the dial holds the reader's Personal card and at least one- other card**; otherwise the name keeps today's behaviour (PANES).+- On a Swarm face, **holding the recap** (650 ms on its card, or on its lines on a skin with no card) opens the picker **when+ the dial holds the reader's Personal card and at least one other card**; otherwise the hold opens the tabs, as a hold anywhere+ else on the face does. Tapping the project name always opens the project list (PANES). (Diego, 2026-11-06: changed from a tap+ on the name.)- The picker is its own screen: black glass, the word "Swarm" on the top arc, and one pill centred (200 × 44 px at y 211,same style as the PM | Buddy pair) with "Personal" and "Team". The half of the Swarm on the face is filled.- Tapping the other half switches Swarm: Personal opens the Personal card; Team opens the last non-Personal card that was on