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
fix(devices): hide tabs that hold no agent on the Pro and the round dial (#1302)
0xdiego25402ee861cd22
diff --git a/devices/harness-device/firmware/main/cable_client.h b/devices/harness-device/firmware/main/cable_client.hindex 3303ae8f4..efcb9bfb2 100644--- a/devices/harness-device/firmware/main/cable_client.h+++ b/devices/harness-device/firmware/main/cable_client.h@@ -169,9 +169,8 @@ typedef struct {char name[CABLE_NAME_MAX];int agents; // how many agents it holds — drawn as a count, never as members// How many TILES it holds, of any kind: agents, shells, viewers. A tab with a terminal and no- // agent has agents=0 and panes=1, and the difference is what keeps it in the switcher — see- // swarm_picker_rebuild(). A daemon too old to send it reports panes==agents, which is the old- // behaviour exactly.+ // agent has agents=0 and panes=1; the switcher leaves it out (ui_swarms_replace). A daemon too+ // old to send it reports panes==agents, which is the old behaviour exactly.int panes;} cable_swarm_t;diff --git a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.cindex f3c3fa2be..a8d9e8d64 100644--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c@@ -4394,9 +4394,12 @@ void ui_service_model_picker(void)}void ui_swarms_replace(const cable_swarm_t *rows, int count, const char *selected){+ // A tab with no agent (only shells or viewers, or nothing) is not listed: nothing on the dial can drive it.+ static cable_swarm_t shown[SWARMS_MAX]; // static: too large for the reader task's stack; single writer+ int total=!rows || count<0 ? 0 : count>SWARMS_MAX ? SWARMS_MAX : count, bounded=0;+ for (int i=0;i<total;i++) if (rows[i].agents>0) shown[bounded++]=rows[i];+ rows=shown;display_lock();- int bounded=count<0 ? 0 : count>SWARMS_MAX ? SWARMS_MAX : count;- if (!rows) bounded=0;char focused[ID_MAX] = "";int focused_index = ht_tab_carousel_index(&tab_carousel);if (s.view == TABS && focused_index >= 0 && focused_index < s.tab_count) COPY(focused, s.tabs[focused_index].id);diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.pyindex e040bd1a5..5bc9699c6 100644--- a/devices/harness-device/firmware/test/test_touch_ui.py+++ b/devices/harness-device/firmware/test/test_touch_ui.py@@ -320,7 +320,7 @@ static void workspace_setup(void) {for(int i=0;i<s.tab_count;i++) {snprintf(s.tabs[i].id,sizeof s.tabs[i].id,"tab-%d",i);snprintf(s.tabs[i].name,sizeof s.tabs[i].name,"%s",names[i]);- s.tabs[i].panes=i;+ s.tabs[i].panes=i; s.tabs[i].agents=1;}scene_take();}@@ -1609,6 +1609,7 @@ int main(int argc, char **argv) {for(int i=4;i<24;i++) {snprintf(s.tabs[i].id,sizeof s.tabs[i].id,"tab-%d",i);snprintf(s.tabs[i].name,sizeof s.tabs[i].name,"Workspace %d",i);+ s.tabs[i].agents=1;}strcpy(s.selected_tab,"tab-23"); dispatch((action_t){.kind=A_TABS}); scene_take();assert(ht_tab_carousel_index(&tab_carousel)==23 && s.hits[0].value==23);@@ -1628,6 +1629,12 @@ int main(int argc, char **argv) {ui_swarms_replace(s.tabs,2,"tab-1");habitat_touch(false,233,233,30075); scene_take();assert(tab_switches==23 && !starts && s.hit_count==3 && ht_tab_carousel_index(&tab_carousel)==0);+ // A tab holding no agent (only shells, or nothing) is not listed.+ {+ cable_swarm_t mixed[3]={{"shell","Shell",0,1},{"tab-0","M2",1,1},{"none","Nothing",0,0}};+ ui_swarms_replace(mixed,3,"shell");+ assert(s.tab_count==1 && !strcmp(s.tabs[0].id,"tab-0") && workspace_index("shell")<0);+ }ui_swarms_replace(NULL,0,NULL); scene_take(); portrait(dir,"tabs-empty");assert(s.view==MESSAGE && !s.loading && workspace.phase==HT_WORKSPACE_IDLE); // removed pending tab fails explicitlydispatch((action_t){.kind=A_TABS}); scene_take();diff --git a/devices/harness-pro/firmware/main/pod/classic/pod_view_tabs.c b/devices/harness-pro/firmware/main/pod/classic/pod_view_tabs.cindex 469e54081..df73cffa1 100644--- a/devices/harness-pro/firmware/main/pod/classic/pod_view_tabs.c+++ b/devices/harness-pro/firmware/main/pod/classic/pod_view_tabs.c@@ -1,8 +1,8 @@// The Tabs screen (Classic Index): a 3 x 2 grid of 164 px covers between the bar and the footer. Each cover wears its// tab's panes as pale minis (one pane fills it, two or more split into two columns, a mark in each, a dot on a working or-// asking one); the first cover is Recent (up to 8 minis, 4 x 2); an empty tab is grey with a grid icon. A cover whose+// asking one); the first cover is Recent (up to 8 minis, 4 x 2); a tab holding no agent has no cover. A cover whose// agents are working wears a ribbon at its foot (eq, "Working", the count). The window's selected tab is ringed in blue-// with its name blue. Under each cover: the name, then "7 agents" / "2 panes" / "Empty".+// with its name blue. Under each cover: the name, then "7 agents" / "2 panes".// Two rows of covers a page; more than six covers page (the frame's scroll is the first row of the page, so always even).// While the finger drags, or the page settles after the release, the glue gives the pixel offset (f->tabs_off) and the grid// is drawn where it is, the bar and the footer drawn last over whatever has scrolled under them.@@ -62,7 +62,6 @@ static unsigned mix(unsigned a, unsigned b, int pct) // a toward b, in percentstatic unsigned cover_top(int c) { return c > 0 ? palette[(c - 1) % PALETTE_N][0] : 0x5d8dda; }static unsigned cover_bottom(int c) { return c > 0 ? palette[(c - 1) % PALETTE_N][1] : 0x2859aa; }static unsigned cover_at(int c, int pct) { return mix(cover_top(c), cover_bottom(c), pct); }-static bool cover_empty(const pod_model_t *m, int c) { return c > 0 && pod_tab_panes(&m->tabs[c - 1]) == 0; }static int chosen_cover(const pod_model_t *m) // the window's selected tab, or -1{return m->tab_count && m->selected < m->tab_count ? m->selected + 1 : -1;@@ -93,8 +92,7 @@ static void caption(const pod_model_t *m, int c, caption_t *cap)int n = pod_tab_panes(t);pod_tab_counts(m, t, &w, NULL);snprintf(cap->name, sizeof cap->name, "%s", t->name);- if (n == 0) snprintf(cap->count, sizeof cap->count, "Empty");- else snprintf(cap->count, sizeof cap->count, "%d pane%s", n, n == 1 ? "" : "s");+ snprintf(cap->count, sizeof cap->count, "%d pane%s", n, n == 1 ? "" : "s");}cap->working = w;}@@ -173,20 +171,6 @@ static void draw_mini(ht_scene_t *s, const pod_model_t *m, int c, int x, int y,}}-// The grid icon of an empty tab: four outlined squares, 72 px across.-static void draw_grid_icon(ht_scene_t *s, int x, int y)-{- const int box = 72, sq = 21, st = 3;- int ox = x + (COVER - box) / 2, oy = y + (COVER - box) / 2;- for (int i = 0; i < 4; i++) {- int sx = ox + (i % 2 ? 42 : 9), sy = oy + (i / 2 ? 42 : 9);- unsigned ground = mix(0xdce2d7, 0xbfcbbd, (sy + sq / 2 - y) * 100 / COVER);- unsigned line = mix(ground, 0xf8faf5, 85);- ht_pro_rect_aa(s, sx, sy, sq, sq, 3, C(line));- ht_pro_rect_aa(s, sx + st, sy + st, sq - 2 * st, sq - 2 * st, 1, C(ground));- }-}-// The working ribbon on the cover's foot: eq on the left, "Working" between, the count on the right.static void draw_ribbon(ht_scene_t *s, int c, int x, int y, int working, uint32_t now_ms){@@ -203,14 +187,9 @@ static void draw_ribbon(ht_scene_t *s, int c, int x, int y, int working, uint32_ht_pro_text(s, x + COVER - RIB_PAD - cw, mid - ci_rg_20.height / 2, cw, &ci_rg_20, C(0xffffff), n);}-// The cover at (x, y): its gradient, its minis (or the grid icon), the ribbon.+// The cover at (x, y): its gradient, its minis, the ribbon.static void draw_cover(ht_scene_t *s, const pod_model_t *m, int c, int x, int y, int working, int detail, uint32_t now_ms){- if (cover_empty(m, c)) {- pod_grad_aa(s, x, y, COVER, COVER, COVER_R, C(0xdce2d7), C(0xbfcbbd));- draw_grid_icon(s, x, y);- return;- }pod_grad_aa(s, x, y, COVER, COVER, COVER_R, C(cover_top(c)), C(cover_bottom(c)));if (!(detail & D_BARE)) {box_t b[CELLS_MAX];diff --git a/devices/harness-pro/firmware/main/pod/console/cs_overview.c b/devices/harness-pro/firmware/main/pod/console/cs_overview.cindex 2aa2e459a..37ed5bd0e 100644--- a/devices/harness-pro/firmware/main/pod/console/cs_overview.c+++ b/devices/harness-pro/firmware/main/pod/console/cs_overview.c@@ -204,23 +204,16 @@ static void card(pod_out_frame_t *f, const pod_model_t *m, int c, int x, int y,unsigned fill = cs_mix(hue, CARD_BASE, 15), border = sel ? CS_FOCUS : asks ? CS_ASK : cs_mix(hue, CARD_BASE, 75);ht_pro_rect_aa_stroke(s, x, y, CARD_W, CARD_H, 18, C(border), C(fill));- // head line: the tab's name on the left; on the right the count chip (a 2 x 2 pane glyph and N, in the hue), or "empty"+ // head line: the tab's name on the left; on the right the count chip (a 2 x 2 pane glyph and N, in the hue)const int left = x + PAD, right = x + CARD_W - PAD, hy = y + NAME_Y;- int cw;- if (c > 0 && pod_tab_panes(&m->tabs[c - 1]) == 0) {- cw = ht_pro_width(&cs_rg_22, "empty");- cs_text(s, right - cw, hy, cw + 2, &cs_rg_22, CS_MUTED, "empty");- } else {- char k[8];- snprintf(k, sizeof k, "%d", count);- int kw = ht_pro_width(&cs_mono_24, k), cx0;- cw = 10 + GLYPH + 8 + kw + 10;- cx0 = right - cw;- ht_pro_rect_aa(s, cx0, hy - 17, cw, 34, 10, C(cs_mix(hue, CARD_BASE, 50)));- for (int i = 0; i < 4; i++) // the pane glyph: four 8 px squares, 4 px apart- ht_pro_rect(s, cx0 + 10 + (i % 2) * 12, hy - GLYPH / 2 + (i / 2) * 12, 8, 8, 2, C(hue));- cs_text(s, cx0 + 10 + GLYPH + 8, hy, kw + 2, &cs_mono_24, CS_INK, k);- }+ char k[8];+ snprintf(k, sizeof k, "%d", count);+ int kw = ht_pro_width(&cs_mono_24, k);+ const int cw = 10 + GLYPH + 8 + kw + 10, cx0 = right - cw;+ ht_pro_rect_aa(s, cx0, hy - 17, cw, 34, 10, C(cs_mix(hue, CARD_BASE, 50)));+ for (int i = 0; i < 4; i++) // the pane glyph: four 8 px squares, 4 px apart+ ht_pro_rect(s, cx0 + 10 + (i % 2) * 12, hy - GLYPH / 2 + (i / 2) * 12, 8, 8, 2, C(hue));+ cs_text(s, cx0 + 10 + GLYPH + 8, hy, kw + 2, &cs_mono_24, CS_INK, k);cs_text(s, left, hy, right - cw - 12 - left, &cs_md_28, CS_INK, c == 0 ? "Recent" : m->tabs[c - 1].name);if (!lead) { pod_hit_add_id(f, x, y, CARD_W, CARD_H, POD_A_OPEN_TAB, c ? c - 1 : POD_TAB_RECENT, c ? m->tabs[c - 1].id : ""); return; }diff --git a/devices/harness-pro/firmware/main/pod/pod_model.c b/devices/harness-pro/firmware/main/pod/pod_model.cindex 352b44779..de7dac9bc 100644--- a/devices/harness-pro/firmware/main/pod/pod_model.c+++ b/devices/harness-pro/firmware/main/pod/pod_model.c@@ -369,19 +369,26 @@ void pod_model_swarms_meta(pod_model_t *m, const cable_swarm_t *items, const chaif (tile_count < 0 || !tiles) tile_count = 0;if (tile_count > POD_PANES_MAX) tile_count = POD_PANES_MAX;- int sel = 0;+ int sel = -1;for (int i = 0; i < n; i++)if (same(items[i].id, selected)) { sel = i; break; }+ if (sel < 0) sel = 0;+ // A tab with no agent (only shells or viewers, or nothing at all) is not shown: nothing on the Pod can drive it.+ int out = 0, nsel_out = -1;for (int i = 0; i < n; i++) {- pod_tab_t *t = &nt[i];+ int ids = (agent_ids && agent_id_counts && agent_ids[i]) ? agent_id_counts[i] : 0;+ bool has_agent = items[i].agents > 0 || ids > 0;+ if (i == sel) for (int k = 0; k < tile_count && !has_agent; k++) if (tiles[k].agent_id[0]) has_agent = true;+ if (!has_agent) continue;+ if (i == sel) nsel_out = out;+ pod_tab_t *t = &nt[out++];copy_str(t->id, sizeof t->id, items[i].id);copy_str(t->name, sizeof t->name, items[i].name);int panes = items[i].panes < 0 ? 0 : items[i].panes > 255 ? 255 : items[i].panes;t->panes = (uint8_t)panes;for (int k = 0; k < POD_PANES_MAX; k++) t->agent[k] = -1;- int ids = (agent_ids && agent_id_counts && agent_ids[i]) ? agent_id_counts[i] : 0;if (ids > 0) {if (ids > POD_PANES_MAX) ids = POD_PANES_MAX;t->members_known = true;@@ -418,10 +425,11 @@ void pod_model_swarms_meta(pod_model_t *m, const cable_swarm_t *items, const cha}}- uint8_t nsel = (uint8_t)sel;- if (n != m->tab_count || nsel != m->selected || memcmp(nt, m->tabs, sizeof nt)) {+ // The window's tab hidden here: selected points past the list, so no tab is marked current.+ uint8_t nsel = (uint8_t)(nsel_out >= 0 ? nsel_out : out);+ if (out != m->tab_count || nsel != m->selected || memcmp(nt, m->tabs, sizeof nt)) {memcpy(m->tabs, nt, sizeof nt);- m->tab_count = (uint8_t)n;+ m->tab_count = (uint8_t)out;m->selected = nsel;m->revision++;}diff --git a/devices/harness-pro/firmware/main/pod/pod_model.h b/devices/harness-pro/firmware/main/pod/pod_model.hindex baa330742..e4792045f 100644--- a/devices/harness-pro/firmware/main/pod/pod_model.h+++ b/devices/harness-pro/firmware/main/pod/pod_model.h@@ -99,7 +99,7 @@ typedef struct {pod_agent_t agents[POD_AGENTS_MAX];uint8_t agent_count;pod_tab_t tabs[POD_TABS_MAX];- uint8_t tab_count, selected;+ uint8_t tab_count, selected; // tabs holding no agent are left out; selected == tab_count: the window's tab is one of thosebool linked;uint32_t revision; // bumped by every feed that changes somethinguint32_t clock_ms; // the newest now_ms seen (pod_model_clock); the stale rule reads itdiff --git a/devices/harness-pro/firmware/test/golden-liberation.txt b/devices/harness-pro/firmware/test/golden-liberation.txtindex 59303e23e..7d23a87ab 100644--- a/devices/harness-pro/firmware/test/golden-liberation.txt+++ b/devices/harness-pro/firmware/test/golden-liberation.txt@@ -15,6 +15,7 @@09b5fe4dc8fe89cba7dad7bb7f4f79d8e3782e0ace7a222c059fde4c3fc779bf talk:be@009ce67750ec5056c7f3776ba0083383498af5e682ebbd86b9bc06887a87c5b7b tabs:9@009ce67750ec5056c7f3776ba0083383498af5e682ebbd86b9bc06887a87c5b7b tabs@0+0c13f073d0be01575b2624a3dbff133e09244d954e1811e0f8c0e430195718e2 default@25000cc64fc3f5cc1bf175d62c0e321bce8f2e6cb81f23fbe6e05c541dbbabab1819 talk:cli@25000e97655e422b1ae989a8e49842b94870cda5bee75fdc1bbcc60574b918e44a70 talk:vault@00f7aa4508da820a0d92d020f94d091b57c8e785e84cc3e4cdc3aead503002bbe tabs:2+3@1234@@ -36,10 +37,12 @@140168159285efb5318dbf51fdb0a8b3d9e3378eebf514ccd3d2e02b1ca61473 recap:vault@1234140168159285efb5318dbf51fdb0a8b3d9e3378eebf514ccd3d2e02b1ca61473 recap:vault@50001436418d2fc4f9274107b2217eaec931e95954bdc8a73b7c440e301c47d02eb3 talk:cur@600+15fb1549c8d42cb0cf11624c194ecd60c875427720ccc427b1612f863f66e9b0 default@123418264414ea892402eb761354e737a43585973a8ee0966dc622b8fe70d8ea20cd agent:site@500018264414ea892402eb761354e737a43585973a8ee0966dc622b8fe70d8ea20cd agent:site@60018a8d0e75d9b953894585ec639e3ec5469807f050f7ed7fe8737f1a7365c832e agent:cli:qresume@25001a1bb057d4971f8f20d2b5291d3b551dfb68290200a97a2c6f7a1e9d90ad5943 notice:failed@2500+1a2b04366f8d80ce1a1fc6599e8ed9ee5826d9a5b142b6d652ebdf0d9fee483a default@6001a3e45b626262296929313537db3c27ff9aa8d590e81a18ce6cba4e5b104d234 tab:empty@01a3e45b626262296929313537db3c27ff9aa8d590e81a18ce6cba4e5b104d234 tab:empty@12341a3e45b626262296929313537db3c27ff9aa8d590e81a18ce6cba4e5b104d234 tab:empty@2500@@ -47,10 +50,8 @@1a3e45b626262296929313537db3c27ff9aa8d590e81a18ce6cba4e5b104d234 tab:empty@6001aaea0e4243ef7a74fd51b1984ee9cd22842afb0158d467ad353b13f2f87ad9c talk:docs@25001c44252852b07efe4efcaca7a490179bf9efa58171cd31d01d58ff7af5b0753d recap:fw@0-1df74a496adad3bd51f009ce704b8f26c8dbda016c6205f7f3bbbddcb07aafd8 default@12341e61cdb7465fdbff08c2a498029a0429b3f1634e83d677271d288abf85aa97d5 talk:fw@6001e61cdb7465fdbff08c2a498029a0429b3f1634e83d677271d288abf85aa97d5 talk:listen@600-2043c80b95a5339faf3e243d95b99630c47f79f2d0e5ee1c945c6d09d9f90a44 default@250020da7f29e40d18e07bd41bd7742d9dd246c57e5d4f2318d89e654d8e844bd8f5 agent:be@020f1d809ec727675980f8e0264dd69034de9f73cb31d1fc29fefe0ae788000ae recap:fw@600216dda7ae1116973601ba137bc41ada356a71d1fc0f8509cf8f5203fe39de4c5 talk:cli@0@@ -167,7 +168,7 @@751930ea60ceaa103fb7479cda1ba5950c581148871f254b00a1c05495691d77 recap:docs@0751930ea60ceaa103fb7479cda1ba5950c581148871f254b00a1c05495691d77 recap:docs@1234751930ea60ceaa103fb7479cda1ba5950c581148871f254b00a1c05495691d77 recap:docs@2500-762dfba9e4cc0a052ed56f818a144e061e06441f5d5718fc9bdcefdfc6d2e3e5 default@5000+779b71eb47e46779e3da6116abc3ba441357a3e2dc23c2a1a12b91bb385b510f default@5000785d5f4010e1af152ddda3286ad4a77c04de80db64ae5df4fb8e2464fdd3c9d2 agent:notes2@6007a96a8519f1e7c5b28f9e27d7eab343751f6e55e3923b1444a223219fc89cb08 agent:ota@12347d31ec341e44719d125172ecb818d9049ee06cca5b8699b7b907891fdd3e1dc8 agent:notes2@1234@@ -224,6 +225,7 @@99e54dfaadaa81d25e85eec257f50a1c821b6dc60712da04f47066adc2624a6d agent:fw@09b19af6b0594feae1e9306fa0884029f4b83ea9c9a36e7324d33a96c50780359 tabs:9@6009b19af6b0594feae1e9306fa0884029f4b83ea9c9a36e7324d33a96c50780359 tabs@600+9bc4fc7ac16e8b80b14da001e4df1c926fa54b8998044f9f2464164daf2cc88c default@09cfb2099afd603d74105525f7b5d1e541beb7378c949cb4fdcc6995daec5be9b agent:vault@25009cfb2099afd603d74105525f7b5d1e541beb7378c949cb4fdcc6995daec5be9b recap:vault@25009d658ea6ee4f4cabaa448f4841d84e757a32be3274cf5e17c32192103488ef2e talk:desk@0@@ -315,14 +317,12 @@ e3263842426abdaaa106cc4859edf9d3e3a2e01da6f29d9c0139e22454e4d4c4 recap:be@5000e3e11905c32cc510f33c9fe4b3570b2bf48ae91b8599ff2412508f15dbe96717 agent:cur@0e4779518a514b9194eec4f8f400d414f9bffb6b70670c8a8541800946f618109 agent:cur@600e53e6ceee3f9f557adaf6c02658b8cefa6cc9f2ecaa2ab9297242bfb6b2e15dd agent:cli@0-e93deb4dbeb4b67443f4992ed126c079fc7eaf6166c59feaa4834924657f33d3 default@0ec27955b7847d206405eb6d4e65cd794ecb9f2b593699d8b84feda2ac1fd23e8 recap:ota@1234ec7130edb1d09398e90d6cf5f994049c8b7d8fa5e317fb94a59b9f104dfbdc5c talk:be@600efd2b9ac7d10e0dd753da356b971700f0e6874260bdf3b343c8a05bbbe4cd222 recap:fw@5000f187e35d1de642ea4ee44168a7cf9f07a509985b5bb142acb0fbd68b2fa0f85e notice:updated@0f1e41f7766da1ed44cda39397e353d12b83070c783f35e61b53dcfd73fca9b74 talk:site@1234f382f1b2369edaf6129d3bb0deda108bf6dfcccd1ca195279cc458236cc24b53 notice:failed@600-f4f4290eb7d344afa63a601aca23692b36e0f0395e561233cb18f5ba572d2a9c default@600f82665b5113adc6d4ae82ba04411d0b67e817f6b7d1b1785cbe2f3540b24543d tab:0@0f82665b5113adc6d4ae82ba04411d0b67e817f6b7d1b1785cbe2f3540b24543d tab:0@1234f82665b5113adc6d4ae82ba04411d0b67e817f6b7d1b1785cbe2f3540b24543d tab:0@2500diff --git a/devices/harness-pro/firmware/test/golden.txt b/devices/harness-pro/firmware/test/golden.txtindex 60cea7f38..15c6d2524 100644--- a/devices/harness-pro/firmware/test/golden.txt+++ b/devices/harness-pro/firmware/test/golden.txt@@ -11,7 +11,6 @@036909202b745942c0521b9bbfffbdf3661a4725d8f1ec87c7d97c87623f0d44 tab:5@5000036909202b745942c0521b9bbfffbdf3661a4725d8f1ec87c7d97c87623f0d44 tab:5@60004532b3999bf93eb85a9e58bd0bf48f171d1a815b4297c5555eebc8624f8bced agent:cli:qresume@0-06de3db308b5933e326e11d0bd848df283f59792f049b8270985f903e7ab84d2 default@60007eca96a7f7a2d29f164b50b1a14c24e1bb144d58115255815eb2da42f537c2e notice:failed@009b5fe4dc8fe89cba7dad7bb7f4f79d8e3782e0ace7a222c059fde4c3fc779bf talk:be@009ce67750ec5056c7f3776ba0083383498af5e682ebbd86b9bc06887a87c5b7b tabs:9@0@@ -48,6 +47,7 @@1a3e45b626262296929313537db3c27ff9aa8d590e81a18ce6cba4e5b104d234 tab:empty@6001aaea0e4243ef7a74fd51b1984ee9cd22842afb0158d467ad353b13f2f87ad9c talk:docs@25001c44252852b07efe4efcaca7a490179bf9efa58171cd31d01d58ff7af5b0753d recap:fw@0+1d20d99a0991c38a5978ee87a0df428e480db1be02662604dc25d6dfbee0ee57 default@50001e61cdb7465fdbff08c2a498029a0429b3f1634e83d677271d288abf85aa97d5 talk:fw@6001e61cdb7465fdbff08c2a498029a0429b3f1634e83d677271d288abf85aa97d5 talk:listen@60020da7f29e40d18e07bd41bd7742d9dd246c57e5d4f2318d89e654d8e844bd8f5 agent:be@0@@ -77,7 +77,6 @@265ed5d199ee0cd59287d9e5737d59f624c5e277ab92865b4126c992f9511fc0 ota:100@2500265ed5d199ee0cd59287d9e5737d59f624c5e277ab92865b4126c992f9511fc0 ota:100@5000265ed5d199ee0cd59287d9e5737d59f624c5e277ab92865b4126c992f9511fc0 ota:100@600-284f743b73c3ab77d804ad68698582084e8407ac267fb08128feada61e88d30d default@50002c2b09ce211e5c434dbd8d4de3f7b9ec4d553bbd878b5590a39bf1a888830688 chrome@02c2b09ce211e5c434dbd8d4de3f7b9ec4d553bbd878b5590a39bf1a888830688 chrome@12342c2b09ce211e5c434dbd8d4de3f7b9ec4d553bbd878b5590a39bf1a888830688 chrome@2500@@ -102,6 +101,7 @@3da469fd6b4f50d2d21f5e606870e2ab67abe6825d3c5c7165db3c49e0b5d389 tabs:9@25003da469fd6b4f50d2d21f5e606870e2ab67abe6825d3c5c7165db3c49e0b5d389 tabs@25003e499d02250796a4989be4a2ccf7f57e9312e1f52b084f0b2829251c38e89513 talk:web@600+40113826b3b4329708774a24f98ff35254e2dc26dfb16f146fcbcd17f0c520fb default@040784cc642b4902d4fc92832c0653c53c1a3d559d3e5470a55ad68096f9f8d60 tabs:9@500040784cc642b4902d4fc92832c0653c53c1a3d559d3e5470a55ad68096f9f8d60 tabs@500040f84152f80906895112b9e02f885d8e817cb5c6cf8d587766f1012b7f7ee4ff agent:fw@1234@@ -148,6 +148,7 @@67af91496e1167018286b7c396118fa029430f04538f5452a29c051d8f6ddafd ota:restart@60067d12bac7e76d3d49358f2fd9b7ef01fa52a57e297dcdf5a8cb5715666829396 talk:notes2@5000681f51cca6af960e1bdd2a6a77a2d3e4da1d3ac89bdda3437ec2b48c2c2749c6 talk:cli@5000+696a48c5da2ac6dacd16294d135d8fbec0d957c93c93698cded065952f15d421 default@2500696ad74bd7dbbffe0b1c0a0d62f1874111ed8193b65509b504e0dc74287b8d11 tabs:2+3@069de72cb18e889e59855388b4cab1a3d66935727013a575cc2471e98ba6d313b talk:desk@50006df2e3e7bc04f61290122dbb985a9ba623fd35b3bdd4f74573470cf83f18a4fe agent:fw:steps6@5000@@ -201,7 +202,7 @@8f774683269ed26ae91642b0cc51687d3a6f1919b6e3da40da06f033d4aa9c56 banner:done@3000@50008f774683269ed26ae91642b0cc51687d3a6f1919b6e3da40da06f033d4aa9c56 banner:done@3000@6008f86fbb951a594006a4a4756a50b61cbcf4d2b001b035ef2274628116e6a977c talk:docs@0-8fedc69858334d75cbd2fbe35410add9468917904494c534dcb69b623afd86aa default@2500+90b89d9b30e0c21c18628d4b1e9228ae68aad2a88abf4862089461f21e9d0e49 default@123490bbe8fd60de51714e27b637990234492a4bbdbac46335573d62148d35eb7767 agent:cur@50009168ac824c16feba2c10ab40a00648f0514698462aca10ceba45d688b518dcce agent:cli:qresume@6009265ad0a8611c411a01d53fdd849896c72fe237c15d818369eb6f5c3770af033 talk:kilo@0@@ -222,6 +223,7 @@9cfb2099afd603d74105525f7b5d1e541beb7378c949cb4fdcc6995daec5be9b agent:vault@25009cfb2099afd603d74105525f7b5d1e541beb7378c949cb4fdcc6995daec5be9b recap:vault@25009d658ea6ee4f4cabaa448f4841d84e757a32be3274cf5e17c32192103488ef2e talk:desk@0+a05d111ca41396f63c59a4a1c1538331a016bbd1b4dcd0e584d39fceb8711b65 default@600a09725b66ca3d6fdf1f6c75830b6dc1c141183002ab8962e094eb59afef7d6e9 talk:site@0a103cb43fd60d28b515e254f6dc0d7aec1879a91c8501b15f151a5f65ca8a6b5 talk:vault@2500a11f43c9eb5bc23eaa3deeff5ebc3682851801eb1baa51c9bc0726f85c1a161c agent:site@0@@ -242,7 +244,6 @@ b0be1bb45b54035a43b57ac22394b1563d29aa68bbacd2183dc17c0436517e12 recap:be@1234b20cfb15b20ebe78736eef7d19165c134f5fda7af67465731329dd32a66f3919 agent:web@5000b30aad877da00f1ed1fade4623ca11792228e2e3bb09384db096230367255c15 talk:kilo@2500b5becd228bf48e3d1d151f45db09d97619e8887b790cfcf94ab067663d16735e agent:be@1234-b64b55462ffffb5eecf9c685e8453413770a8310929dfc8c28abb729677e5db9 default@1234b650ee3c7ab984eb6da027c81b81c48603a86b6fbaad1de069aed7a958bdc929 agent:cli@2500b650ee3c7ab984eb6da027c81b81c48603a86b6fbaad1de069aed7a958bdc929 agent:cli@600b80e0fd30ee2df5b9af735c4dba24a0aa7735b4d2c13f3b5389c4ca73d7bc834 recap:web@1234@@ -286,7 +287,6 @@ d2d4a9331f69bc86e6a7d0799270110ce7962b9f4a967666ea53ccd552870560 recap:docs@600d4e193fb5662e614376c611a1b587575f18f8c9bf55e9866519093cadf9ab3b5 talk:be@5000d4f9eedc595917fa889d2679b787de30fdca6681cfe7ba6ca08b3a593b04b46d talk:web@0d5042314a0e49e8ef956df47e2122539d95c2a6ee116650660bf46f208f24b9c talk:vault@5000-d568d14ae0c365b72a839798a294b048da0871c51cd0e4737eb672e7eb1bdc94 default@0d5800ea7a2afc36a41de545378e2e27801fd336a9334802ee5db88fee10e8a0d tabs:2+3@600d7c89214a319d27805dba071bf93560f8320d03117f8ba3cef01ec5668aa62a7 talk:web@2500d7f170112fea32ee9846a93c3da59f01a3f0e5ad2d66466482a2cecb8f2c5db8 notice:failed@1234diff --git a/devices/harness-pro/firmware/test/pod_render.c b/devices/harness-pro/firmware/test/pod_render.cindex bb4b6f333..c7cb0157f 100644--- a/devices/harness-pro/firmware/test/pod_render.c+++ b/devices/harness-pro/firmware/test/pod_render.c@@ -155,7 +155,7 @@ static void classic_fixture(const char *screen)}}-// The mockup's Option B: Recent, then five tabs with the second selected, the last one empty.+// The mockup's Option B: Recent, then five tabs with the second selected (the mockup's last, empty one is not shown).static void mock_tabs(void){static const char *const names[] = {"Harness repo", "Doi song", "Thoi trang", "Harness Store", "New Swarm"};@@ -329,7 +329,7 @@ int main(int argc, char **argv)}const char *at = strchr(screen, '@'); // tabs:<rows>@<px>: mid-drag, the grid at this offset from the top of page 0if (at) { F.tabs_moving = true; F.tabs_off = atoi(at + 1); }- } else if (!strncmp(screen, "default", 7) && !inbox) { // default marks: a tab with no panes, one of unknown agents, one with a stranger+ } else if (!strncmp(screen, "default", 7) && !inbox) { // default marks: a tab with no panes (not shown), one of unknown agents, one with a strangerpod_model_agents_begin(&M);pod_model_agent(&M, "zz", "stranger", "zzz", "MacBook Pro");pod_model_agent(&M, "fw", "firmware-pro", "claude", "MacBook Pro");@@ -343,8 +343,8 @@ int main(int argc, char **argv)snprintf(sw[1].id, SWARM_ID_MAX, "e1"); snprintf(sw[1].name, CABLE_NAME_MAX, "Strangers"); sw[1].panes = sw[1].agents = 2;snprintf(sw[2].id, SWARM_ID_MAX, "e2"); snprintf(sw[2].name, CABLE_NAME_MAX, "Mixed"); sw[2].panes = sw[2].agents = 3;pod_model_swarms(&M, sw, L, NN, 3, "e0", NULL, 0);- if (strstr(screen, "tab")) pod_nav_act(&N, &M, POD_A_OPEN_TAB, 2, T0);- if (strstr(screen, "talk")) { pod_nav_act(&N, &M, POD_A_OPEN_TAB, 1, T0); pod_nav_act(&N, &M, POD_A_OPEN_AGENT, 0, T0); }+ if (strstr(screen, "tab")) pod_nav_act(&N, &M, POD_A_OPEN_TAB, 1, T0); // Mixed (Empty is not listed)+ if (strstr(screen, "talk")) { pod_nav_act(&N, &M, POD_A_OPEN_TAB, 0, T0); pod_nav_act(&N, &M, POD_A_OPEN_AGENT, 0, T0); }} else if (!strcmp(screen, "recent")) {pod_nav_act(&N, &M, POD_A_OPEN_TAB, POD_TAB_RECENT, T0);} else if (!strncmp(screen, "tabp:", 5)) { // tabp:<n>: one tab of n panes with its real rects (Console Tab): 3 = the mockup's, 1 = full, 8 = a 3 x 3 grid with two spare@@ -368,12 +368,13 @@ int main(int argc, char **argv)uint8_t cnt[1] = {(uint8_t)n};pod_model_swarms(&M, sw, &ids, cnt, 1, "p", tl, n);pod_nav_act(&N, &M, POD_A_OPEN_TAB, 0, T0);- } else if (!strcmp(screen, "tab:empty")) { // a tab with no panes+ } else if (!strcmp(screen, "tab:empty")) { // a tab with no rows to list: an older daemon's, members unknownstatic const uint8_t none[1] = {0};cable_swarm_t sw[1];memset(sw, 0, sizeof sw);snprintf(sw[0].id, SWARM_ID_MAX, "n0");snprintf(sw[0].name, CABLE_NAME_MAX, "New Swarm");+ sw[0].agents = 1;pod_model_swarms(&M, sw, NULL, none, 1, "n0", NULL, 0);pod_nav_act(&N, &M, POD_A_OPEN_TAB, 0, T0);} else if (!strncmp(screen, "tab:", 4)) {diff --git a/devices/harness-pro/firmware/test/test_pod_model.c b/devices/harness-pro/firmware/test/test_pod_model.cindex cceba7ade..3a73d0ad7 100644--- a/devices/harness-pro/firmware/test/test_pod_model.c+++ b/devices/harness-pro/firmware/test/test_pod_model.c@@ -177,6 +177,26 @@ static void pod_model_test_no_agent_ids(void) {CHECK(!M.tabs[0].members_known && !M.tabs[1].members_known && M.selected == 1);}+// A tab with only shells or viewers (agents 0) is left out of the list; the window's tab among them marks none current.+static void pod_model_test_hides_agentless_tabs(void) {+ fresh();+ cable_swarm_t it[4] = {{"s1", "Shell", 0, 1}, {"s2", "Build", 2, 2}, {"s3", "Empty", 0, 0}, {"s4", "Solo", 1, 1}};+ const char *const *ids[4] = {NULL, ids_a, NULL, ids_c};+ uint8_t cnt[4] = {0, 2, 0, 1};+ pod_model_swarms(&M, it, ids, cnt, 4, "s4", NULL, 0);+ CHECK(M.tab_count == 2 && !strcmp(M.tabs[0].id, "s2") && !strcmp(M.tabs[1].id, "s4"));+ CHECK(M.selected == 1 && M.tabs[0].agent[0] == 0);+ pod_model_swarms(&M, it, ids, cnt, 4, "s1", NULL, 0);+ CHECK(M.tab_count == 2 && M.selected == 2);+ // the window's tab with an agent tile is kept even when the daemon's count says 0+ cable_tile_t tiles[2] = {{0, 0, 500, 1000, ""}, {500, 0, 1000, 1000, "a2"}};+ pod_model_swarms(&M, it, ids, cnt, 4, "s1", tiles, 2);+ CHECK(M.tab_count == 3 && M.selected == 0 && !strcmp(M.tabs[0].id, "s1") && M.tabs[0].has_rects);+ // no tab with an agent: an empty list+ pod_model_swarms(&M, it, ids, cnt, 1, "s1", NULL, 0);+ CHECK(M.tab_count == 0 && M.selected == 0);+}+static void pod_model_test_shared_agent(void) {fresh();cable_swarm_t it[2] = {{"s1", "One", 2, 2}, {"s2", "Two", 2, 2}};@@ -1023,6 +1043,7 @@ int main(void) {pod_model_test_library_vs_turn_order();pod_model_test_tabs_with_ids();pod_model_test_no_agent_ids();+ pod_model_test_hides_agentless_tabs();pod_model_test_shared_agent();pod_model_test_recap_lines();pod_model_test_recap_cut();diff --git a/devices/harness-pro/firmware/test/test_pod_nav.c b/devices/harness-pro/firmware/test/test_pod_nav.cindex b54d0c910..284af22b3 100644--- a/devices/harness-pro/firmware/test/test_pod_nav.c+++ b/devices/harness-pro/firmware/test/test_pod_nav.c@@ -361,7 +361,7 @@ static void nav_test_tab_identity(void) {static const char *x[] = {"a1", "a2", "a3"}, *y[] = {"a4"};const char *const *ids[3] = {NULL, x, y};uint8_t cnt[3] = {0, 3, 1};- cable_swarm_t it[3] = {{"s0", "Inbox", 0, 0}, {"s1", "Build", 3, 3}, {"s2", "Docs", 1, 1}};+ cable_swarm_t it[3] = {{"s0", "Inbox", 1, 1}, {"s1", "Build", 3, 3}, {"s2", "Docs", 1, 1}};pod_model_swarms(&M, it, ids, cnt, 3, "s1", NULL, 0);CHECK(pod_nav_sync(&N, &M).fx == POD_FX_NONE);CHECK(N.depth == 3 && N.stack[1].tab == 2 && top()->tab == 2);diff --git a/devices/harness-pro/firmware/test/test_pod_views_tabs.c b/devices/harness-pro/firmware/test/test_pod_views_tabs.cindex 979f88978..032ef964f 100644--- a/devices/harness-pro/firmware/test/test_pod_views_tabs.c+++ b/devices/harness-pro/firmware/test/test_pod_views_tabs.c@@ -260,11 +260,14 @@ static void test_list_long_name_ellipsis(void) {CHECK(!strcmp(vi->text + strlen(vi->text) - 3, "\xe2\x80\xa6"));}-// A tab with no panes: "No panes yet." and its line, no rows, "No panes" in the footer. An empty Recent says so too.+// A tab with no rows to list: "No panes yet." and its line, no rows, "No panes" in the footer. An empty Recent says so too.static void test_list_empty_tab(void) {build(0, 0, true);pod_model_swarms(&M, sw, NULL, NULL, 0, "", NULL, 0);- cable_swarm_t one = {"e", "Empty", 0, 0};+ cable_swarm_t none = {"z", "Shells", 0, 2}; // no agent: not listed+ pod_model_swarms(&M, &none, NULL, NULL, 1, "z", NULL, 0);+ CHECK(M.tab_count == 0);+ cable_swarm_t one = {"e", "Empty", 1, 1}; // members unknown (older daemon): no rows to listpod_model_swarms(&M, &one, NULL, NULL, 1, "e", NULL, 0);pod_nav_act(&N, &M, POD_A_OPEN_TAB, 0, 0);render(0);@@ -431,33 +434,16 @@ static void test_tabs_footer_pages(void) {CHECK(find_text("1 TAB \xc2\xb7 1 AGENT") != NULL);}-// A tab with no panes: a grey cover with a grid icon (four outlined squares), captioned Empty, no ribbon and no mark.-static void test_tabs_empty_cover_grid_icon(void) {+// Tabs holding no agent get no cover: only Recent is drawn, and the bar counts the tabs that are shown.+static void test_tabs_hide_agentless(void) {pod_model_reset(&M);- cable_swarm_t two[2] = {{"a", "Alpha", 0, 0}, {"b", "Beta", 0, 0}};+ cable_swarm_t two[2] = {{"a", "Alpha", 0, 0}, {"b", "Beta", 0, 1}};pod_model_swarms(&M, two, NULL, NULL, 2, "a", NULL, 0);pod_model_link(&M, true);pod_nav_init(&N);render(0);- CHECK(find_text("Empty") != NULL && find_text("Empty")->pro_font == &ci_rg_23 && find_text("0 panes") == NULL);- int x, y;- cover_xy(1, &x, &y);- int squares = 0, arcs = 0;- for (int i = 0; i < S.count; i++) {- ht_rect_t b = ht_run_bounds(&S.runs[i]);- if (b.x < x || b.y < y || b.x + b.w > x + COVER || b.y + b.h > y + COVER) continue;- if (S.runs[i].pro_kind == K_RECT_AA && b.w == 21 && b.h == 21) squares++;- if (S.runs[i].pro_kind == POD_ARC) arcs++;- }- CHECK(squares == 4 && arcs == 0); // the icon, no "+" ring- int cx = x + COVER / 2, cy = y + COVER / 2; // centred in its 72 px box- int lo = 9999, hi = 0;- for (int i = 0; i < S.count; i++) {- ht_rect_t b = ht_run_bounds(&S.runs[i]);- if (S.runs[i].pro_kind == K_RECT_AA && b.w == 21 && b.x >= x && b.x < x + COVER && b.y >= y && b.y < y + COVER) { if (b.x < lo) lo = b.x; if (b.x + b.w > hi) hi = b.x + b.w; }- }- CHECK(hi - lo == 54 && lo + 27 == cx && cy > y); // 54 px of squares in the 72 px box- CHECK(count_in(K_IMAGE, x, y, COVER) == 0 && foot_eq_bars(1) == 0 && find_hit(POD_A_OPEN_TAB, 0) != NULL);+ CHECK(M.tab_count == 0 && find_text("Alpha") == NULL && find_text("Beta") == NULL && find_text("Empty") == NULL);+ CHECK(find_text("Recent") != NULL && find_hit(POD_A_OPEN_TAB, 0) == NULL);}// The worst frame: six covers of 2 to 9 panes, every agent working, a light mark in every third pane, a bell and a banner.@@ -563,12 +549,8 @@ static void tabs_test_default_mark(void) {}CHECK(in_tab == 2 && find_text(">_") != NULL);pod_model_reset(&M);- cable_swarm_t none = {"e", "Empty", 0, 0};- pod_model_swarms(&M, &none, NULL, NULL, 1, "e", NULL, 0);pod_model_link(&M, true);pod_nav_init(&N);- render(0);- CHECK(count_rect(ht_rgb(0x9aa09a)) == 0 && find_text(">_") == NULL && find_text("Empty") != NULL);cable_swarm_t two = {"e", "Two", 2, 2}; // members unknown (older daemon) with 2 panes: two default markspod_model_swarms(&M, &two, NULL, NULL, 1, "e", NULL, 0);render(0);@@ -702,7 +684,7 @@ static void grid_test_motion(void) {// Run budget in motion: 24 tabs, nine marked panes a cover, the worst two partial pages, every offset.static void grid_test_motion_budget(void) {- for (int per = 0; per <= 9; per += (per < 6 ? 2 : 1)) {+ for (int per = 1; per <= 9; per += (per < 6 ? 2 : 1)) {build_shared(24, per);for (int k = 0; k < per; k++) { pod_model_agent(&M, ids[0][k], "x", k % 2 ? "cursor" : "claude", "mac"); pod_model_turn(&M, ids[0][k], "started", NULL, 0, 5 + (uint32_t)k); }if (per > 1) pod_model_question(&M, "m1", "ok?");@@ -808,7 +790,7 @@ int main(void) {test_tabs_selected_ring();test_tabs_ribbon_only_when_working();test_tabs_footer_pages();- test_tabs_empty_cover_grid_icon();+ test_tabs_hide_agentless();test_tabs_budget();tabs_test_minis();grid_test_six_covers();diff --git a/devices/harness-pro/firmware/test/test_pro_app.py b/devices/harness-pro/firmware/test/test_pro_app.pyindex 24ce23916..5ba194c83 100644--- a/devices/harness-pro/firmware/test/test_pro_app.py+++ b/devices/harness-pro/firmware/test/test_pro_app.py@@ -604,7 +604,7 @@ static void many_tabs(void) {setup();static cable_swarm_t sw[8];memset(sw, 0, sizeof sw);- for (int i = 0; i < 8; i++) { snprintf(sw[i].id, sizeof sw[i].id, "t%d", i); snprintf(sw[i].name, sizeof sw[i].name, "Tab %d", i); sw[i].panes = 1; }+ for (int i = 0; i < 8; i++) { snprintf(sw[i].id, sizeof sw[i].id, "t%d", i); snprintf(sw[i].name, sizeof sw[i].name, "Tab %d", i); sw[i].panes = 1; sw[i].agents = 1; }pod_ui_swarms(&U, sw, 8, NULL, "t0", NULL, 0);render();}@@ -867,8 +867,8 @@ static void tap_cover_opens_tab(void) {// A tab inserted before it, by the feed: the tap resolves its id, not the index drawn.static cable_swarm_t more[9];memset(more, 0, sizeof more);- snprintf(more[0].id, sizeof more[0].id, "new"); snprintf(more[0].name, sizeof more[0].name, "Newest"); more[0].panes = 1;- for (int i = 0; i < 8; i++) { snprintf(more[i + 1].id, sizeof more[i + 1].id, "t%d", i); snprintf(more[i + 1].name, sizeof more[i + 1].name, "Tab %d", i); more[i + 1].panes = 1; }+ snprintf(more[0].id, sizeof more[0].id, "new"); snprintf(more[0].name, sizeof more[0].name, "Newest"); more[0].panes = 1; more[0].agents = 1;+ for (int i = 0; i < 8; i++) { snprintf(more[i + 1].id, sizeof more[i + 1].id, "t%d", i); snprintf(more[i + 1].name, sizeof more[i + 1].name, "Tab %d", i); more[i + 1].panes = 1; more[i + 1].agents = 1; }h = hit(POD_A_OPEN_TAB, 6);int cx = h->x + h->w / 2, cy = h->y + h->h / 2;ucontact(true, cx, cy, &c);