Leave the glasses when idle; new conversation after a long silence (0.1.1)
On a real G2 the app, while open, occupied the display indefinitely and a phone notification did not reach the lenses. The app now leaves the glasses by itself (shutDownPageContainer(0), no dialog) after a resting screen has been untouched: 20 s on an answer, 30 s at Ready, 10 s on an error or "Cancelled". Any gesture restarts the countdown. It never leaves while recording, transcribing, waiting for the agent or for an approval. It is armed only once the glasses are in use (a gesture arrived, or the session was opened from the glasses, which includes voice launch), and touching the phone page holds it open for two minutes, so setting up on the phone is not interrupted. Because the app now closes between questions, a question more than ten minutes after the last one starts a new conversation; sooner continues it. Diagnostics shows how the session was opened. Version 0.1.1. Tests: 233 unit/integration; simulator 7. Not reviewed, not deployed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,8 @@ export interface BootOptions {
|
||||
hostWaitMs?: number;
|
||||
/** Development build: mirror diagnostics to the console. */
|
||||
dev?: boolean;
|
||||
/** `false` keeps the app on the glasses indefinitely (automated simulator runs). */
|
||||
idleExit?: boolean;
|
||||
/** Reload hook, replaceable in tests. */
|
||||
reload?: () => void;
|
||||
}
|
||||
@@ -90,6 +92,7 @@ export async function boot(doc: Document, win: Window, options: BootOptions = {}
|
||||
measure: (text, width) => measureTextWrap(text, width).lineCount,
|
||||
locale: win.navigator.language || 'en-US',
|
||||
onChange: (snapshot) => update(snapshot),
|
||||
...(options.idleExit === false ? { idleExit: null } : {}),
|
||||
// Development builds mirror diagnostics to the console (visible in the simulator and the
|
||||
// Even dev console). Diagnostics never contain questions, answers or credentials.
|
||||
onNote: options.dev ? (entry) => console.info(`[hermeven] ${entry.kind}: ${entry.detail}`) : undefined,
|
||||
@@ -98,6 +101,12 @@ export async function boot(doc: Document, win: Window, options: BootOptions = {}
|
||||
// The real page is on screen: the start-up status has done its job.
|
||||
startup?.remove();
|
||||
|
||||
// Touching or typing on the phone page means someone is using it: Pepper does not leave the
|
||||
// glasses (which also closes this page) while that is going on.
|
||||
for (const type of ['pointerdown', 'keydown', 'input'] as const) {
|
||||
doc.addEventListener(type, () => controller.notePhoneActivity(), { passive: true });
|
||||
}
|
||||
|
||||
// Never leave the microphone open behind a page that is going away.
|
||||
win.addEventListener('beforeunload', () => void controller.stop());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user