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: Personal | Team picker as two big rows; desktop focus never closes it (#3397)

0xken1546b8124da5e2
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 5441e3917..6e4f9fada 100644
--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
@@ -1527,16 +1527,56 @@ static void swarm_pair(ht_scene_t *f, bool buddy)
s.hits[s.hit_count++] = (hit_t){{X - 40, 382, HALF + 40, HT_HEIGHT - 382}, A_SIDE_PM, 0, true};
s.hits[s.hit_count++] = (hit_t){{X + HALF, 382, HALF + 40, HT_HEIGHT - 382}, A_SIDE_BUDDY, 0, true};
}
-// The Personal | Team picker: "Swarm" on the top arc and one 200 x 44 pill at y 211, the half of the Swarm on the face filled.
+/*
+ * The Personal | Team picker, option B (Diego, 2026-11-06: the 200 x 44 pill sat small in an empty glass). "Swarm" on the
+ * top arc and two rows of 340 x 104 px: Personal over Team, each with its icon, its name in Inter 30 and where it lands in
+ * Inter 20 (Personal: its project count; Team: the Swarm it opens), the one on the face filled with a green check.
+ */
+// 12 x 12 cells of 3 px, '#' ink: one person for Personal, and two (the second smaller, behind) for Team.
+static const ht_cell_frame_t *pick_icon(int which, bool on)
+{
+ static const char *const ME[12] = {
+ "....####....", "...######...", "...######...", "...######...", "....####....", "............",
+ "..########..", ".##########.", ".##########.", ".##########.", ".##########.", "............"};
+ static const char *const TEAM[12] = {
+ "...##.......", "..####..##..", "..####.####.", "..####.####.", "...##...##..", "............",
+ ".######.###.", "########.###", "########.###", "########.###", "########....", "............"};
+ static uint8_t cells[2][12 * 12];
+ static uint16_t palette[2][2][2];
+ static ht_cell_frame_t frames[2][2];
+ const char *const *art = which ? TEAM : ME;
+ for (int y = 0; y < 12; y++) for (int x = 0; x < 12; x++) cells[which][y * 12 + x] = art[y][x] == '#';
+ uint16_t c = color(on ? 0xffffff : 0x9a9ca3);
+ palette[which][on][0] = 0; palette[which][on][1] = (uint16_t)(c << 8 | c >> 8); // panel order
+ frames[which][on] = (ht_cell_frame_t){.cols = 12, .rows = 12, .cell = 3, .palette = palette[which][on], .cells = cells[which]};
+ return &frames[which][on];
+}
+static void pick_row(ht_scene_t *f, int y, int which, const char *name, const char *detail, bool on)
+{
+ enum { X = 63, W = 340, H = 104, R = 28, ICON = 36 };
+ uint16_t fill = color(on ? 0x2b2d33 : 0x141518), edge = color(on ? 0x2b2d33 : 0x2e3035);
+ ht_box(f, X, y, W, H, R, fill, edge);
+ ht_cell_sprite(f, X + 26, y + (H - ICON) / 2, pick_icon(which, on));
+ const ht_font_t *big = &ht_lv_inter_30.base, *small = &ht_lv_inter_20.base;
+ int tx = X + 26 + ICON + 18, tw = W - (tx - X) - 26 - (on ? ht_done_28.width + 10 : 0);
+ ht_text(f, tx, y + 18, tw, big, on ? color(0xffffff) : color(0x9a9ca3), fill, name);
+ ht_text(f, tx, y + 18 + big->height + 4, tw, small, on ? color(0xc9cbd1) : color(0x9a9ca3), fill, detail);
+ if (on) ht_text(f, X + W - 26 - ht_done_28.width, y + (H - ht_done_28.height) / 2, ht_done_28.width, &ht_done_28,
+ color(0x1fd13c), fill, HT_DONE);
+}
static void render_swarm_pick(ht_scene_t *f)
{
- enum { X = 133, Y = 211, W = 200, H = 44, HALF = W / 2 };
- const ht_supertab_t *t = swarm_here();
+ const ht_supertab_t *t = swarm_here(), *mine = swarm_pick_target(false), *team = swarm_pick_target(true);
+ bool personal = t && t->personal;
ht_arc_title_face(f, FG, "Swarm", &ht_arc_inter_prop);
- pill2(f, X, Y, W, H, "Personal", "Team", !(t && t->personal));
- // A thumb's targets: each half 30 px wider and 40 px taller each way than it is drawn.
- s.hits[s.hit_count++] = (hit_t){{X - 30, Y - 40, HALF + 30, H + 80}, A_PICK_PERSONAL, 0, true};
- s.hits[s.hit_count++] = (hit_t){{X + HALF, Y - 40, HALF + 30, H + 80}, A_PICK_TEAM, 0, true};
+ char projects[32];
+ int n = mine ? mine->lead_n : 0;
+ snprintf(projects, sizeof projects, "%d project%s", n, n == 1 ? "" : "s");
+ pick_row(f, 120, 0, "Personal", projects, personal);
+ pick_row(f, 242, 1, "Team", team ? team->name : "", !personal);
+ // A thumb's targets: each row and half the gaps around it, meeting at y 233.
+ s.hits[s.hit_count++] = (hit_t){{43, 96, 380, 137}, A_PICK_PERSONAL, 0, true};
+ s.hits[s.hit_count++] = (hit_t){{43, 233, 380, 137}, A_PICK_TEAM, 0, true};
}
/*
* Desktop's agent pattern (avatar_art.dart superTabAgentPattern; the daemon sends its 15 half bits and colour): mirrored on
@@ -5622,7 +5662,9 @@ void ui_supertab_focus(const char *tab, const char *lead)
const ht_supertab_t *t = ht_supertabs_find(&swarm, tab);
int i = swarm_lead_index(t, lead);
// As `focus` today: never while talking, nor over a question or a form.
- bool free = !s.voice_open && !question_view(s.view) && s.view != FORM && s.view != DRAFT && s.view != DRAFT_OPTIONS;
+ // Nor over the Personal | Team picker: the desktop's focus closed it under a thumb, whose tap then talked (Diego's dial,
+ // 2026-11-06); the pick itself moves the desktop.
+ bool free = !s.voice_open && !question_view(s.view) && s.view != FORM && s.view != DRAFT && s.view != DRAFT_OPTIONS && s.view != SWARM_PICK;
sw.pending[0] = 0;
// The app is on another Lead of the Swarm coming back: the face comes back on that one.
if (i >= 0 && !strcmp(sw.lost.tab, tab)) COPY(sw.lost.lead, lead);
diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.py
index d319b33e0..848d600f7 100644
--- a/devices/harness-device/firmware/test/test_touch_ui.py
+++ b/devices/harness-device/firmware/test/test_touch_ui.py
@@ -230,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', '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']:
+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', 'pick_icon', 'pick_row', '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')
@@ -2632,20 +2632,37 @@ static void pick_setup(bool personal, int teams, const char *face) {
if (teams > 1) pick_card("s3", "t0", "Team B", "B0", false);
enter_at(face, NULL); swarm_sent = 0; scene_take();
}
-static bool pick_half(void) { // the filled half: 0 Personal, 1 Team, -1 none
+// The picker's two rows (option B, Diego 2026-11-06): 340 x 104 at x 63, Personal at y 120 and Team at y 242.
+static int pick_half(void) { // the filled row: 0 Personal, 1 Team, -1 none
for (int i = 0; i < scene.count; i++) {
const ht_run_t *r = &scene.runs[i];
- if (r->box.h && r->box.fill == ht_rgb(0x2b2d33) && r->y == 214) return r->x < 233 ? 0 : 1;
+ if (r->box.h == 104 && r->w == 340 && r->x == 63 && r->box.fill == ht_rgb(0x2b2d33)) return r->y == 120 ? 0 : r->y == 242 ? 1 : -1;
}
return -1;
}
-static bool pick_pill(void) {
+static bool pick_pill(void) { // both rows drawn, the other one on the dark fill
+ int rows = 0;
for (int i = 0; i < scene.count; i++) {
const ht_run_t *r = &scene.runs[i];
- if (r->box.h == 44 && r->w == 200 && r->x == 133 && r->y == 211 && r->box.fill == ht_rgb(0x141518)) return true;
+ if (r->box.h == 104 && r->w == 340 && r->x == 63 && (r->y == 120 || r->y == 242)
+ && (r->box.fill == ht_rgb(0x2b2d33) || r->box.fill == ht_rgb(0x141518))) rows++;
+ }
+ return rows == 2;
+}
+static bool pick_check_at(int y0) { // the green check on the filled row
+ for (int i = 0; i < scene.count; i++) if (!strcmp(scene.runs[i].text, HT_DONE) && scene.runs[i].y > y0 && scene.runs[i].y < y0 + 104) return true;
+ return false;
+}
+static bool pick_icon_at(int y0) { // a cell sprite icon at the row's left
+ for (int i = 0; i < scene.count; i++) {
+ const ht_run_t *r = &scene.runs[i];
+ if (r->sprite.width && r->x >= 80 && r->x <= 100 && r->y > y0 && r->y < y0 + 104) return true;
}
return false;
}
+#define PICK_PERSONAL_X 233
+#define PICK_PERSONAL_Y 172
+#define PICK_TEAM_Y 294
// 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);
@@ -2664,26 +2681,37 @@ static void swarm_pick_checks(const char *dir) {
// 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);
+ // Each row says where it lands: Personal its project count, Team the Swarm it opens; icons left, the check on the filled one.
+ assert(scene_says("1 project") && scene_says("Team A") && pick_check_at(242) && !pick_check_at(120));
+ assert(pick_icon_at(120) && pick_icon_at(242));
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);
+ thumb(PICK_PERSONAL_X, PICK_PERSONAL_Y, 14, 10, 500);
assert(s.view == HOME && !strcmp(sw.tab, "sp") && !strcmp(sw.lead, "P0") && wire_has(0, "select sp P0"));
hold_recap();
- assert(s.view == SWARM_PICK && pick_half() == 0);
+ assert(s.view == SWARM_PICK && pick_half() == 0 && pick_check_at(120) && !pick_check_at(242));
portrait(dir, "pick-personal");
// The filled half only returns, unchanged and silent.
- swarm_sent = 0; fake_ms += 1000; tap(fake_ms, 183, 233);
+ swarm_sent = 0; fake_ms += 1000; tap(fake_ms, PICK_PERSONAL_X, PICK_PERSONAL_Y);
assert(s.view == HOME && !strcmp(sw.tab, "sp") && swarm_sent == 0);
// 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();
hold_recap(); assert(s.view == SWARM_PICK);
- fake_ms += 1000; tap(fake_ms, 283, 233);
+ fake_ms += 1000; tap(fake_ms, PICK_PERSONAL_X, PICK_TEAM_Y);
assert(s.view == HOME && !strcmp(sw.tab, "s3") && !strcmp(sw.lead, "B0") && wire_has(0, "select s3 B0"));
pick_setup(true, 2, "sp");
hold_recap(); assert(s.view == SWARM_PICK);
- fake_ms += 1000; tap(fake_ms, 283, 233);
+ fake_ms += 1000; tap(fake_ms, PICK_PERSONAL_X, PICK_TEAM_Y);
assert(s.view == HOME && !strcmp(sw.tab, "s1") && !strcmp(sw.lead, "A0"));
+ // The desktop's focus (supertab.focus) while the picker is open never closes it: a tap meant for a row talked to the
+ // face instead (Diego's dial, 2026-11-06 14:38).
+ pick_setup(true, 1, "s1");
+ hold_recap(); assert(s.view == SWARM_PICK);
+ ui_supertab_focus("s1", "A0"); scene_take(); assert(s.view == SWARM_PICK);
+ ui_supertab_focus("sp", "P0"); scene_take(); assert(s.view == SWARM_PICK && !strcmp(sw.tab, "s1"));
+ fake_ms += 1000; tap(fake_ms, PICK_PERSONAL_X, PICK_PERSONAL_Y);
+ assert(s.view == HOME && !strcmp(sw.tab, "sp"));
// 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");
hold_recap(); assert(s.view == SWARM_PICK);