diff --git a/CHANGELOG b/CHANGELOG index fd3efc74..b9654730 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ * Glanceboard tap setting includes a Disable option * Refinements to builtin games * Optimize bluetooth message transport +* Short-the-long gesture from screen off activates the glanceboard ## 0.7.0 - 2026-09-12 diff --git a/app/apps/glanceboard/glanceboard-settings.ts b/app/apps/glanceboard/glanceboard-settings.ts index 6036219c..d42dd129 100644 --- a/app/apps/glanceboard/glanceboard-settings.ts +++ b/app/apps/glanceboard/glanceboard-settings.ts @@ -78,7 +78,7 @@ export const glanceShowOnLongPressSetting = new ConfigSettingBoolean({ label: "Show on long press", storageKey: "glanceboard.showOnLongPress", defaultValue: true, - description: "Holding a long-press while asleep shows the Glanceboard until the press is released.", + description: "A long-press or short-then-long-press while asleep shows the Glanceboard until the press is released.", }); /** The head-tilt wake shows the board (for the tap duration) instead of the regular UI. */ diff --git a/app/g2/glance-host.ts b/app/g2/glance-host.ts index 555ee070..d58781c7 100644 --- a/app/g2/glance-host.ts +++ b/app/g2/glance-host.ts @@ -77,7 +77,7 @@ export class GlanceHost { const provider = this.options.getProvider(); if (!provider?.isEnabled()) return null; if (gesture === "click" && !provider.showOnTap()) return null; - if (gesture === "long-press" && !provider.showOnLongPress()) return null; + if ((gesture === "long-press" || gesture === "short-then-long-press") && !provider.showOnLongPress()) return null; if (gesture === "head-tilt" && !provider.showOnHeadTilt()) return null; return glanceEventForGesture(gesture, this.isVisible()); } diff --git a/app/g2/glance-state.ts b/app/g2/glance-state.ts index 8f606f36..b8369486 100644 --- a/app/g2/glance-state.ts +++ b/app/g2/glance-state.ts @@ -2,7 +2,7 @@ * The Glanceboard's visibility rules, as a pure reducer so they can be tested * without the display plumbing. The board is an alternate sleep-time display: * while the shell is asleep a press (single tap, or a head-tilt wake) shows it - * for a short while, a hold (long-press) shows it until the press is released, + * for a short while, a hold (long-press or short-then-long-press) shows it until release, * and a double-tap dismisses it in favour of the regular UI. GlanceHost feeds * these events in and applies the resulting visibility to the compositor. * @@ -49,8 +49,7 @@ export function reduceGlance( case "hold": return { visible: true, holding: true, hideAtMs: null }; case "release": - // Releases also follow presses the board was never holding for (a - // tap-then-hold, a release delivered late); those mean nothing here. + // Releases delivered late or after a disabled hold gesture mean nothing here. return state.holding ? GLANCE_HIDDEN : state; case "timeout": if (!state.visible || state.holding || state.hideAtMs === null || nowMs < state.hideAtMs) return state; @@ -67,7 +66,7 @@ export function reduceGlance( * already handles or ignores while asleep. */ export function glanceEventForGesture( - gesture: "click" | "double-click" | "long-press" | "long-press-release" | "head-tilt" | string, + gesture: "click" | "double-click" | "long-press" | "short-then-long-press" | "long-press-release" | "head-tilt" | string, boardVisible: boolean, ): GlanceEvent | null { switch (gesture) { @@ -75,6 +74,7 @@ export function glanceEventForGesture( case "head-tilt": return { type: "press" }; case "long-press": + case "short-then-long-press": return { type: "hold" }; case "long-press-release": return { type: "release" }; diff --git a/tests/glance-state.test.cjs b/tests/glance-state.test.cjs index 7e1eab49..0bc7d415 100644 --- a/tests/glance-state.test.cjs +++ b/tests/glance-state.test.cjs @@ -47,15 +47,16 @@ test("dismiss hides from any state", () => { assert.deepEqual(reduceGlance(shown, { type: "dismiss" }, T0), GLANCE_HIDDEN); }); -test("gesture mapping: taps and head-tilt press, long-press holds, double-tap dismisses only a visible board", () => { +test("gesture mapping: taps and head-tilt press, both long-press gestures hold, double-tap dismisses only a visible board", () => { assert.deepEqual(glanceEventForGesture("click", false), { type: "press" }); assert.deepEqual(glanceEventForGesture("head-tilt", false), { type: "press" }); assert.deepEqual(glanceEventForGesture("long-press", false), { type: "hold" }); + assert.deepEqual(glanceEventForGesture("short-then-long-press", false), { type: "hold" }); + assert.deepEqual(glanceEventForGesture("short-then-long-press", true), { type: "hold" }); assert.deepEqual(glanceEventForGesture("long-press-release", true), { type: "release" }); assert.equal(glanceEventForGesture("double-click", false), null); assert.deepEqual(glanceEventForGesture("double-click", true), { type: "dismiss" }); assert.equal(glanceEventForGesture("scroll-up", true), null); - assert.equal(glanceEventForGesture("short-then-long-press", true), null); }); test("the press timeout is the host's when supplied", () => {