From a40bebf96c99c24a6965f297fcc6d7bb1cdf7599 Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 7 Aug 2026 16:18:17 +0200 Subject: demo: do not re-navigate to main when the app already landed there The app auto-lands on main once the function index is in, so scene_open typed a goto to a place it was already standing. Every keystroke a driver injects costs a round trip, so that was pure dead time at the very start of the tour -- the worst place to spend it, since it is the part a recording opens on. --- tools/demo.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/demo.py b/tools/demo.py index 2753a60..4508c40 100644 --- a/tools/demo.py +++ b/tools/demo.py @@ -78,9 +78,17 @@ class Demo: # -- scenes ------------------------------------------------------------ # def scene_open(self): """Land on a real function and show the listing.""" - self.say("goto main") - self.do("goto", target="main", delay_ms=TYPE_MS) - self.beat(1.5) + # The app auto-lands on main once the index is in, so typing a goto to + # get there is a redundant round trip -- and every keystroke a driver + # injects costs real time. Only navigate if we are somewhere else. + st = self.do("state") or {} + if ((st.get("function") or {}).get("name")) != "main": + self.say("goto main") + self.do("goto", target="main", delay_ms=TYPE_MS) + self.beat(1.5) + else: + self.say("already landed on main") + self.beat(0.4) self.say("scroll the listing") self.do("move", dir="down", n=12) self.beat(0.8) -- cgit v1.3.1-sl0p