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.

fix(dial): a tap anywhere finishes a voice recording (#1096)

0xdiego25326b939beb55
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 95fc822b4..f3c3fa2be 100644
--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
@@ -1940,7 +1940,9 @@ static void render_voice(ht_scene_t *f)
s.status_phase = status_animated() ? ht_shimmer_phase(ms() * status_speed()) : 0;
for (int i = 0; i < f->count; i++)
if (f->runs[i].arc == 2) f->runs[i].shimmer = s.status_phase;
- s.hits[s.hit_count++] = (hit_t){{33, 97, 400, 274}, A_PET, 0, true};
+ // The whole glass ends the recording: the voice screen draws no other control, and a tap that
+ // missed the pet by a finger's width used to leave the microphone open.
+ s.hits[s.hit_count++] = (hit_t){{0, 0, HT_WIDTH, HT_HEIGHT}, A_PET, 0, true};
}
static void render_selection(ht_scene_t *f)
{
diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.py
index 37d58e108..e040bd1a5 100644
--- a/devices/harness-device/firmware/test/test_touch_ui.py
+++ b/devices/harness-device/firmware/test/test_touch_ui.py
@@ -1742,8 +1742,9 @@ int main(int argc, char **argv) {
tap(1200,233,220); tap(1400,233,220); assert(!stops); // double/triple are one intent
s.active=1; input_cancel();
assert(!strcmp(target,"a") && !strcmp(s.voice_target,"Deploy latest firmware"));
- tap(2400,233,220); assert(stops==1);
- tap(3200,233,422); assert(s.view==VOICE && s.voice_open && stops==1);
+ // Anywhere on the glass finishes the recording, not just the pet: (233,422) is below its old box.
+ tap(2400,233,422); assert(stops==1);
+ assert(s.view==VOICE && s.voice_open);
dispatch((action_t){.kind=A_VOICE_ABORT}); // Finish the fixture's pending host reply.
tap(4000,233,220); assert(starts==2 && !strcmp(target,"b"));