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.

feat(device): Focus shows a question in place, and switches panes by button

0xdiego2562bf9e10fae1
diff --git a/devices/harness-device/firmware/assets/README.md b/devices/harness-device/firmware/assets/README.md
index d4f5bf053..79beddf61 100644
--- a/devices/harness-device/firmware/assets/README.md
+++ b/devices/harness-device/firmware/assets/README.md
@@ -19,6 +19,11 @@ from strokes and read as a different icon. The second was `icon_v_mic` from the
`main/ui/icons_voice.c` — a 24 x 32 white mark inside a 72 px blue disc — enlarged to fill the cell:
40% bigger than the design, and without the design's base bar.
+## `chevron_left.png`, `chevron_right.png` — lifted from the design, at 1:1
+
+The pane arrows either side of the microphone, from the same screen: 11 x 20 at (113, 352) and
+(342, 352), #8a8a99 on black, coverage taken as brightness over the mark's own colour.
+
## `sparkle.png`, `sparkle_fill.png` — from the old firmware
`icon_sparkle` and `icon_sparkle_fill` from `main/ui/icons_voice.c`, which was deleted with the LVGL
diff --git a/devices/harness-device/firmware/assets/chevron_left.png b/devices/harness-device/firmware/assets/chevron_left.png
new file mode 100644
index 000000000..e2f1f93e7
Binary files /dev/null and b/devices/harness-device/firmware/assets/chevron_left.png differ
diff --git a/devices/harness-device/firmware/assets/chevron_right.png b/devices/harness-device/firmware/assets/chevron_right.png
new file mode 100644
index 000000000..a9544088b
Binary files /dev/null and b/devices/harness-device/firmware/assets/chevron_right.png differ
diff --git a/devices/harness-device/firmware/main/ui/habitat/focus.c b/devices/harness-device/firmware/main/ui/habitat/focus.c
index 69140818c..d40e72c64 100644
--- a/devices/harness-device/firmware/main/ui/habitat/focus.c
+++ b/devices/harness-device/firmware/main/ui/habitat/focus.c
@@ -41,7 +41,7 @@ enum { FOCUS_ROWS = 7 }; // pill, name, status, and four of recap
* nearly always (h, d, t, k, l), so the gap below the name is the one that needs the three pixels
* back. Verified by banding the rendered face — see focus_face() in test/test_character.c.
*/
-enum { FOCUS_BODY_Y = 118 + 38 + 27 };
+enum { FOCUS_BODY_Y = 124 + 38 + 22 };
/*
* y, and the width the chord allows there, against a 230 px working radius rather than the 233 px
@@ -70,8 +70,10 @@ enum { FOCUS_BODY_Y = 118 + 38 + 27 };
* has a line of text over it; the widths are re-measured for the y they actually use.
*/
static const struct { int y, width; const ht_font_t *font; } ROWS[FOCUS_ROWS] = {
- { 50, 240, &ht_mono_20 }, // the pill: 38 tall from 50, 20 cells of name — see pill()
- { 118, 384, &ht_mono_28 },
+ // The pill: 38 tall from 61, 20 cells of name — see pill(). Well below the bell above it on this
+ // face (ink 15..41, ui_habitat.c); at 50 the two touched on glass.
+ { 61, 240, &ht_mono_20 },
+ { 124, 384, &ht_mono_28 },
{ FOCUS_BODY_Y, 442, &ht_mono_28 },
{ FOCUS_BODY_Y, 408, &ht_mono_28 },
{ FOCUS_BODY_Y + 38, 408, &ht_mono_28 },
diff --git a/devices/harness-device/firmware/main/ui/habitat/fonts.c b/devices/harness-device/firmware/main/ui/habitat/fonts.c
index cd22831ed..73898ef70 100644
--- a/devices/harness-device/firmware/main/ui/habitat/fonts.c
+++ b/devices/harness-device/firmware/main/ui/habitat/fonts.c
@@ -6366,6 +6366,15 @@ static const uint8_t ht_pill_pixels[] = {
85,100,0,85,144,0,90,0,0,164,0,0,64,0,0,0,0,0,
};
const ht_font_t ht_pill = {57408,57412,12,38,ht_pill_pixels};
+static const uint8_t ht_chevron_pixels[] = {
+ 0,0,0,0,0,0,0,0,116,0,1,252,0,7,244,0,31,208,0,127,64,1,253,0,
+ 7,244,0,31,208,0,127,64,0,253,0,0,253,0,0,127,64,0,31,208,0,7,244,0,
+ 1,253,0,0,127,64,0,31,208,0,7,244,0,1,252,0,0,120,0,0,0,0,0,0,
+ 0,0,0,0,0,0,180,0,0,253,0,0,127,64,0,31,208,0,7,244,0,1,253,0,
+ 0,127,64,0,31,208,0,7,244,0,1,252,0,1,252,0,7,244,0,31,208,0,127,64,
+ 1,253,0,7,244,0,31,208,0,127,64,0,253,0,0,116,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_chevron = {57424,57425,12,24,ht_chevron_pixels};
static const uint8_t ht_viet_16_pixels[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,3,208,0,106,0,10,96,0,146,
0,12,36,1,130,128,47,248,2,149,208,96,9,6,0,160,160,6,0,0,0,1,128,0,
diff --git a/devices/harness-device/firmware/main/ui/habitat/terminal.h b/devices/harness-device/firmware/main/ui/habitat/terminal.h
index be9946c81..33ddbd082 100644
--- a/devices/harness-device/firmware/main/ui/habitat/terminal.h
+++ b/devices/harness-device/firmware/main/ui/habitat/terminal.h
@@ -45,6 +45,10 @@ extern const ht_font_t ht_pill;
#define HT_PILL_LEFT "\xee\x81\x80\xee\x81\x81"
#define HT_PILL_BODY "\xee\x81\x82"
#define HT_PILL_RIGHT "\xee\x81\x83\xee\x81\x84"
+// The Focus face's pane arrows either side of the microphone.
+extern const ht_font_t ht_chevron;
+#define HT_CHEVRON_LEFT "\xee\x81\x90"
+#define HT_CHEVRON_RIGHT "\xee\x81\x91"
// The colour a glyph pixel at coverage `alpha` (0..3) takes between `fg` and `bg`, exactly as the
// rasteriser computes it. For a run that has to sit seamlessly on another run's coverage level.
uint16_t ht_blend(uint16_t fg, uint16_t bg, unsigned alpha);
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 f9f2124f4..be822a1c0 100644
--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
@@ -97,6 +97,7 @@ typedef enum {
A_QUESTION,
A_CHOICE,
A_ANSWER, A_QUESTION_READ, A_QUESTION_CHOICES, A_QUESTION_REVIEW, A_QUESTION_BACK, A_QUESTION_SAY,
+ A_PANE_PREV, A_PANE_NEXT,
A_INBOX,
A_NOTICE,
A_TABS,
@@ -374,17 +375,6 @@ static void notice_mark_read(cable_notif_t *n)
// Read is not answered, removed or focused. Keep this exact card in place.
change();
}
-// Put one agent's question on the glass: its inbox card, which is the prompt whole and nothing to
-// press but the card, whose tap opens the pane on the desktop. The answer is given there.
-static void notice_show_question(const char *id)
-{
- for (int i = 0; i < s.notice_count; i++)
- if (s.notice[i].question && !strcmp(s.notice[i].agent_id, id)) {
- view(INBOX);
- s.offset = i;
- return;
- }
-}
static void notice_open(void)
{
view(s.notice_count ? INBOX : HOME);
@@ -568,6 +558,14 @@ static int working(void)
n += s.agents[i].busy;
return n;
}
+// The open question's prompt for this agent, as its notice carries it; NULL when it has none open.
+static const char *question_prompt(const char *id)
+{
+ for (int i = 0; i < s.notice_count; i++)
+ if (s.notice[i].question && !strcmp(id, s.notice[i].agent_id))
+ return s.notice[i].summary[0] ? s.notice[i].summary : "Needs your answer";
+ return NULL;
+}
static bool is_question(const char *id)
{
for (int i = 0; i < s.notice_count; i++)
@@ -644,7 +642,7 @@ static bool home_footer(action_kind_t action)
// bracket control is pressed and released like every other one, while A_PET reads a TAP as a boop
// and only starts speech on a 650 ms hold — which is the creature's gesture, not a button's.
return action == A_TABS || action == A_INBOX || action == A_AGENTS || action == A_RETURN ||
- action == A_CARRY_DROP || action == A_VOICE;
+ action == A_CARRY_DROP || action == A_VOICE || action == A_PANE_PREV || action == A_PANE_NEXT;
}
static bool hit_contains(const hit_t *hit, int x, int y, bool surface)
{
@@ -804,9 +802,9 @@ static void render_workspace_preview(ht_scene_t *f)
}
static void render_home(ht_scene_t *f)
{
- // Where the Focus face's microphone target begins: a little above the mark's ink at 377, so the
+ // Where the Focus face's microphone target begins: a little above the mark's ink at 397, so the
// top of the mark is not its edge. A_PET ends here on Focus.
- enum { FOCUS_MIC_TOP = 366 };
+ enum { FOCUS_MIC_TOP = 386 };
s.caption_arc = (ht_rect_t){0};
if (!s.connected || s.loading) { render_brand(f); return; }
if (workspace.touching && workspace.moved && !workspace.cancelled) { render_workspace_preview(f); return; }
@@ -815,6 +813,15 @@ static void render_home(ht_scene_t *f)
// a recap. The bell has its own lower target, outside the voice surface.
const char *recap = a && !a->busy && a->recap_ready && s.connected && !s.loading &&
!s.nap && !s.voice_retry_until && !carry.active && !carry.error[0] ? a->preview : NULL;
+ /*
+ * An open question takes the recap's place, on this face, where the person already is. It is
+ * shown to be READ: the answer is given in the app, so the face grows no buttons and no other
+ * screen opens for it. A turn's recap would be last turn's news; the question is what the agent
+ * is waiting on now.
+ */
+ const char *asked = a && s.connected && !s.loading && !carry.active && !carry.error[0] ?
+ question_prompt(a->id) : NULL;
+ if (asked) recap = asked;
// A live turn can outlast its terminal footer (or have no readable footer).
// Keep its busy state visible while more specific activity is unavailable.
// An agent with a question open is not working, whatever its turn says: it is waiting on this
@@ -864,7 +871,7 @@ static void render_home(ht_scene_t *f)
bool focus_face = character.id == HT_CHARACTER_FOCUS;
ht_character_face(f, &character, &f_, ACCENT, recap);
if (bell) {
- if (focus_face) ht_notification_bell_at(f, unread, f_.ink, 14);
+ if (focus_face) ht_notification_bell_at(f, unread, f_.ink, 8); // ink 15..41, clear of the pill at 61
else ht_notification_bell(f, unread, f_.ink);
}
s.status_phase = status_animated() ? ht_shimmer_phase(ms()) : 0;
@@ -921,18 +928,35 @@ static void render_home(ht_scene_t *f)
* nothing: a touch out there does not exist.
*/
s.hits[n] = (hit_t){{143, FOCUS_MIC_TOP, 180, HT_HEIGHT - FOCUS_MIC_TOP}, A_VOICE, 0, can_say};
- // Cell at 370 puts the mark's ink at y 377..411 — the design's own rows (mockup/newdesign.html,
- // "Agent — recap"). It sat 22 px lower before, close enough to the bezel to read as crowded.
- ht_text(f, (HT_WIDTH - ht_mic_footer.width) / 2, 370, ht_mic_footer.width, &ht_mic_footer,
+ // Cell at 390 puts the mark's ink at y 397..431: the design's rows (mockup/newdesign.html,
+ // "Agent — recap") plus 20, because on glass the cluster sat tight under the recap.
+ ht_text(f, (HT_WIDTH - ht_mic_footer.width) / 2, 390, ht_mic_footer.width, &ht_mic_footer,
// The design's own green, which is also the recording meter's: the thing that starts
// speech and the thing that shows it are one colour. HT_THEME_DONE, which this used to
// be, is the terminal's "finished" teal and read on glass as a different button.
!can_say ? DIM : n == s.pressed ? ACCENT : color(HT_THEME_VOICE), BG, HT_MIC);
+ /*
+ * THE PANE ARROWS, from the design: either side of the microphone, and only when this tab has
+ * another agent to go to. They do what a sideways swipe does (see the end of habitat_touch),
+ * which is the gesture nobody finds — and they are buttons, pressed and released, for the
+ * same reason the microphone is. Their targets stop where the microphone's starts, x 143 and
+ * 323, so the three never share a pixel.
+ */
+ if (s.count > 1) {
+ int prev = s.hit_count;
+ s.hits[s.hit_count++] = (hit_t){{53, 350, 90, 76}, A_PANE_PREV, 0, s.connected};
+ ht_text(f, 113, 370, ht_chevron.width, &ht_chevron,
+ prev == s.pressed ? FG : DIM, BG, HT_CHEVRON_LEFT);
+ int next = s.hit_count;
+ s.hits[s.hit_count++] = (hit_t){{323, 350, 90, 76}, A_PANE_NEXT, 0, s.connected};
+ ht_text(f, 342, 370, ht_chevron.width, &ht_chevron,
+ next == s.pressed ? FG : DIM, BG, HT_CHEVRON_RIGHT);
+ }
}
if (!carry.active && !carry.error[0] && !visit.available) {
// Both phases of the caption open the same pane picker. On Focus the caption is the pill,
// which sits below where the arc would have been.
- s.hits[s.hit_count++] = focus_face ? (hit_t){{83, 54, 300, 40}, A_AGENTS, 0, true}
+ s.hits[s.hit_count++] = focus_face ? (hit_t){{83, 61, 300, 40}, A_AGENTS, 0, true}
: (hit_t){{83, 0, 300, 66}, A_AGENTS, 0, true};
for (int i = 0; i < f->count; i++) if (f->runs[i].arc == 1) {
ht_rect_t r = ht_run_bounds(&f->runs[i]);
@@ -1791,6 +1815,16 @@ static void dispatch(action_t a)
case A_INBOX:
notice_open();
break;
+ case A_PANE_PREV:
+ case A_PANE_NEXT:
+ // The sideways swipe's step, from a button. Wraps, as the swipe does.
+ if (s.count > 1 && s.connected && !s.loading) {
+ int i = s.active < 0 ? 0 : (s.active + (a.kind == A_PANE_NEXT ? 1 : s.count - 1)) % s.count;
+ action_t pane = {.kind = A_AGENT};
+ COPY(pane.id, s.agents[i].id);
+ dispatch(pane);
+ }
+ break;
case A_NOTICE: {
if (s.connected && !visit.pending && a.id[0]) {
for (int i = 0; i < s.notice_count; i++)
@@ -3472,21 +3506,8 @@ void ui_question_show(const char *id, const char *name, const char *machine, con
s.q.valid=false; s.q.pending=false; s.q.revision++;
if (question_view(s.view)) { COPY(s.q.error,"The question changed. Open the alert again."); view(QUESTION); }
}
- /*
- * A QUESTION TAKES THE GLASS — to be READ, not answered.
- *
- * An agent that asks has stopped: it is waiting on this person and nothing else. Leaving the
- * face on its "working" line with a count in the bell said the opposite, even to somebody
- * looking straight at that agent. So the question's card comes up now, from any screen a person
- * is only reading, on every skin. It is the prompt and nothing else — no [later], [say] or
- * [next]: the answer is given in the app, which is where the card's tap takes them. Not from a
- * screen they are in the middle of — recording, drafting, a form, a question already open, a
- * finger on the glass — where it would take their work away; there the bell counts it, as
- * before, until the question is ANSWERED rather than until it is seen.
- */
- bool reading = s.view == HOME || s.view == AGENTS || s.view == AGENT || s.view == READER ||
- s.view == INBOX || s.view == TABS || s.view == MACHINES || s.view == MESSAGE;
- if (reading && !s.touch_down) notice_show_question(id);
+ // The question is shown on the home face, in the recap's place (render_home): no screen opens
+ // for it. The display wakes so a person glancing over sees it.
change();
display_wake();
display_unlock();
diff --git a/devices/harness-device/firmware/scripts/gen_habitat_fonts.py b/devices/harness-device/firmware/scripts/gen_habitat_fonts.py
index 023f5eeea..7b7505761 100644
--- a/devices/harness-device/firmware/scripts/gen_habitat_fonts.py
+++ b/devices/harness-device/firmware/scripts/gen_habitat_fonts.py
@@ -49,6 +49,7 @@ fonts = [('ht_mono_16',mono,16,10,22,17),('ht_mono_20',mono,20,12,28,22),
('ht_engine',mono,28,24,38,31),
('ht_wave',mono,40,6,124,40),
('ht_pill',mono,20,12,38,30),
+ ('ht_chevron',mono,20,12,24,20),
('ht_viet_16',viet,16,10,22,17),('ht_viet_20',viet,20,12,28,22),
('ht_viet_24',viet,24,15,32,26),('ht_viet_28',viet,28,17,38,31)]
with dest.open('w') as out:
@@ -59,7 +60,7 @@ with dest.open('w') as out:
data=[]
bounds=[]
# Latin-1 keeps common names readable; unknown Unicode renders ?, never changes wire text.
- first,last=(0xe020,0xe020+len(ENGINES)-1) if name=='ht_engine' else (0xe010,0xe01f) if name=='ht_wave' else (0xe040,0xe044) if name=='ht_pill' else (0xe002,0xe002) if name=='ht_spark' else (0xe001,0xe001) if name=='ht_mic_footer' else (0x1ea0,0x1ea0+0x59+len(VIET_TAIL)) if name.startswith('ht_viet_') else (0xe000,0xe000) if name.startswith('ht_bell_') else (0x2713,0x2713) if name=='ht_done_28' else (0x2717,0x2717) if name=='ht_failed_28' else (0x2190,0x2197) if name=='ht_nav_32' else (0x2197,0x2197) if name.startswith('ht_open_') else (0x2192,0x2192) if name.startswith('ht_right_') else (ord('o'),ord('o')) if name=='ht_lock_dot' else (32,255 if name!='ht_pixel_40' else 126)
+ first,last=(0xe020,0xe020+len(ENGINES)-1) if name=='ht_engine' else (0xe010,0xe01f) if name=='ht_wave' else (0xe040,0xe044) if name=='ht_pill' else (0xe050,0xe051) if name=='ht_chevron' else (0xe002,0xe002) if name=='ht_spark' else (0xe001,0xe001) if name=='ht_mic_footer' else (0x1ea0,0x1ea0+0x59+len(VIET_TAIL)) if name.startswith('ht_viet_') else (0xe000,0xe000) if name.startswith('ht_bell_') else (0x2713,0x2713) if name=='ht_done_28' else (0x2717,0x2717) if name=='ht_failed_28' else (0x2190,0x2197) if name=='ht_nav_32' else (0x2197,0x2197) if name.startswith('ht_open_') else (0x2192,0x2192) if name.startswith('ht_right_') else (ord('o'),ord('o')) if name=='ht_lock_dot' else (32,255 if name!='ht_pixel_40' else 126)
for cp in range(first,last+1):
# The tail of the Vietnamese atlas is the eight scattered letters, in VIET_TAIL order.
glyph = VIET_TAIL[cp-0x1efa] if name.startswith('ht_viet_') and cp >= 0x1efa else chr(cp)
@@ -162,6 +163,12 @@ with dest.open('w') as out:
radius=height*S//2 - S, fill=85)
x = piece * width * S
im = big.crop((x, 0, x + width*S, height*S)).resize((width, height), Image.Resampling.BOX)
+ elif name=='ht_chevron':
+ # The Focus pane arrows, the design's own at 1:1 like the microphone: 11 x 20 of
+ # #8a8a99 on black, from "Agent — recap". See assets/README.md.
+ im = Image.new('L', (width, height))
+ im.paste(Image.open(root/('assets/chevron_left.png' if cp == first
+ else 'assets/chevron_right.png')), (0, 2))
elif name=='ht_mic_footer':
# THE DESIGN'S OWN PIXELS, at 1:1 — not scaled, not redrawn.
#
diff --git a/devices/harness-device/firmware/test/test_question_ui.py b/devices/harness-device/firmware/test/test_question_ui.py
index 38e94e765..af5aaa7d9 100644
--- a/devices/harness-device/firmware/test/test_question_ui.py
+++ b/devices/harness-device/firmware/test/test_question_ui.py
@@ -78,8 +78,6 @@ static void display_lock(void) {}
static void display_unlock(void) {}
static int wakes;
static void display_wake(void) { wakes++; }
-static int shown;
-static void notice_show_question(const char *id) { assert(id && *id); shown++; view(INBOX); }
static bool queue(action_t a) {
if (congested) return false;
queued=a; if (a.kind==A_ANSWER) queued_answers++; return true;
@@ -229,16 +227,10 @@ int main(int argc,char **argv) {
reset(false);s.view=MESSAGE;visit.available=true;strcpy(visit.agent,"b");b_known=false;
ui_focus_project("b");assert(!strcmp(s.pending_focus,"b") && s.view==MESSAGE);
b_known=true;ui_focus_project("b");assert(s.view==QUESTION && s.q.loading && !strcmp(s.q.agent,"b"));
- // A question TAKES THE GLASS from a screen a person is only reading — its card, to be read; the
- // answer is given in the app. No answer screen opens and nothing is fetched to answer with.
- reset(false);view(HOME);reads=0;wakes=0;shown=0;
- ui_question_show("b","Other","M2","q-b2",NULL);
- assert(s.view==INBOX && shown==1 && wakes==1 && reads==0);
- // ...and not from one they are in the middle of, nor from under a finger. The alert still counts.
- reset(false);view(HOME);s.touch_down=true;notices=0;shown=0;
- ui_question_show("b","Other","M2","q-b3",NULL);assert(s.view==HOME && notices==1 && !shown);
- reset(false);s.view=VOICE;shown=0;ui_question_show("b","Other","M2","q-b4",NULL);assert(s.view==VOICE && !shown);
- reset(false);s.view=DRAFT;shown=0;ui_question_show("b","Other","M2","q-b5",NULL);assert(s.view==DRAFT && !shown);
+ // A question does NOT change the screen — the home face shows it in the recap's place — but it
+ // does wake the display, and it still counts in the bell until it is answered.
+ reset(false);view(HOME);wakes=0;notices=0;
+ ui_question_show("b","Other","M2","q-b2",NULL);assert(s.view==HOME && wakes==1 && notices==1);
// The ESP32 compiler's -O0 restrict analysis sees the enclosing global s,
// not the disjoint options/answer fields. Exercise every selected subset
// at their real capacities and prove that no neighboring state changes.
diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.py
index e945e2e19..104bf7b3e 100644
--- a/devices/harness-device/firmware/test/test_touch_ui.py
+++ b/devices/harness-device/firmware/test/test_touch_ui.py
@@ -191,7 +191,7 @@ static bool scroll_emit(ht_scroll_phase_t phase, int dy, int velocity, void *ctx
code += function('color')
code += function('settings_item') + function('settings_count') + function('hit_contains')
code += function('find')
-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', 'tabs_open', 'workspace_failed', 'ui_scroll_reportable', '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', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', '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', 'tabs_open', 'workspace_failed', 'ui_scroll_reportable', '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', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:
code += function(name)
code += function('render_settings') + function('ui_visit_state')
code += function('ui_project_known') + function('ui_focus_project') + function('ui_apply_pending_focus')
@@ -237,6 +237,10 @@ static void dispatch(action_t a) {
else if (a.kind == A_VOICE_ABORT) { recording = s.voice_open = false; view(HOME); }
else if (a.kind == A_RETURN || a.kind == A_LATEST) { if(a.kind==A_RETURN)returns++; visit_action(a); }
else if (a.kind == A_PET) boops++;
+ else if (a.kind == A_PANE_PREV || a.kind == A_PANE_NEXT) { // mirrors ui_habitat.c's dispatch
+ int i = s.active < 0 ? 0 : (s.active + (a.kind == A_PANE_NEXT ? 1 : s.count - 1)) % s.count;
+ action_t pane = {.kind = A_AGENT}; COPY(pane.id, s.agents[i].id); dispatch(pane);
+ }
else if (a.kind == A_AGENT) {
switches++; s.active = !strcmp(a.id, "b") ? 1 : 0; view(AGENT);
} else if (a.kind == A_SETTINGS) view(SETTINGS);
@@ -1721,16 +1725,36 @@ int main(int argc, char **argv) {
// The Focus SKIN's home face, footer and all — the "focus" portrait above is the legacy
// focus-face option on the default character, which draws no microphone.
reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); scene_take(); portrait(dir, "focus-skin");
- // A question's card on Focus: the engine badge, the "?" and the name, then the prompt — the whole
- // of what a question puts on the glass. It is answered in the app.
+ // THE PANE ARROWS either side of the Focus microphone: a sideways swipe, as buttons, and only when
+ // the tab has another agent to go to.
+ reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); scene_take(); portrait(dir, "focus-arrows");
+ tap(1000, 98, 388); assert(switches == 1 && s.active == 1 && !starts);
+ reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); scene_take();
+ tap(1000, 368, 388); assert(switches == 1 && s.active == 1 && !starts);
+ reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); scene_take(); // a thumb, not a tap
+ habitat_touch(true, 98, 388, 1000); habitat_touch(true, 110, 400, 1400); habitat_touch(false, 110, 400, 1800);
+ assert(switches == 1 && !starts);
+ reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); s.count = 1; scene_take();
+ tap(1000, 98, 388); tap(1200, 368, 388); assert(!switches && !starts); // one agent: no arrows at all
+ // An open question on Focus: shown on the home face, in the recap's place, and nowhere else.
reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); strcpy(s.agents[0].engine, "claude");
{
cable_notif_t asked={.question=true,.summary="Which database should the retry queue use?"};
- COPY(asked.agent_id, s.agents[0].id); COPY(asked.name, "Kinh T\u1ebf");
- ui_notif_replace(&asked,1); ui_notif_open(); scene_take(); portrait(dir, "focus-question");
- assert(s.view == INBOX);
+ COPY(asked.agent_id, s.agents[0].id); COPY(asked.name, s.agents[0].name);
+ // A pill under the bell, as on glass: the two must not touch.
+ s.tab_count=1; COPY(s.tabs[0].id,"tab-0"); COPY(s.tabs[0].name,"Doi song"); COPY(s.selected_tab,"tab-0");
+ ui_notif_replace(&asked,1); scene_take(); portrait(dir, "focus-question");
+ assert(s.view == HOME);
+ uint16_t gap[HT_WIDTH];
+ for (int y = 42; y < 61; y++) { // the bell's ink ends at 41, the pill's rim starts at 61
+ ht_raster(&scene, (ht_rect_t){0, y, HT_WIDTH, 1}, gap);
+ for (int x = 0; x < HT_WIDTH; x++) assert(gap[x] == 0);
+ }
+ bool shown = false;
+ for (int i = 0; i < scene.count; i++) if (strstr(scene.runs[i].text, "retry queue")) shown = true;
+ assert(shown);
}
- for (int y = 366; y < HT_HEIGHT; y += 4) {
+ for (int y = 386; y < HT_HEIGHT; y += 4) {
// Inside the round glass only: a target row whose centre is off the panel is not a row.
if ((y - 233) * (y - 233) >= 230 * 230) continue;
reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); scene_take();