diff --git a/CHANGELOG b/CHANGELOG index 2f88ae0e..c2b473ce 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ## 0.7.1 - Unreleased * Add Wear OS watch battery indicator to the top bar and Glanceboard +* Glanceboard tap setting includes a Disable option * Refinements to builtin games ## 0.7.0 - 2026-09-12 diff --git a/app/apps/app-definition.ts b/app/apps/app-definition.ts index 25940ab8..0f73ad9d 100644 --- a/app/apps/app-definition.ts +++ b/app/apps/app-definition.ts @@ -46,6 +46,8 @@ export type GlanceboardProvider = { size: { width: number; height: number }; /** Whether sleep-time gestures should show the board at all (user setting). */ isEnabled: () => boolean; + /** Whether a single tap shows the board (for tapTimeoutMs). */ + showOnTap: () => boolean; /** How long a tap or head-tilt keeps the board up. */ tapTimeoutMs: () => number; /** Whether a long-press holds the board up until released. */ diff --git a/app/apps/glanceboard/glanceboard-settings.ts b/app/apps/glanceboard/glanceboard-settings.ts index 1e38e8ca..6036219c 100644 --- a/app/apps/glanceboard/glanceboard-settings.ts +++ b/app/apps/glanceboard/glanceboard-settings.ts @@ -41,21 +41,35 @@ export const glanceboardEnabledSetting = new ConfigSettingBoolean({ "While the display is asleep, a tap, a long-press or a head-tilt shows the Glanceboard instead of the regular UI. Double-tap still wakes the regular UI.", }); -export type GlanceTapDuration = "3s" | "5s" | "7s" | "10s"; +export type GlanceTapDuration = "off" | "3s" | "5s" | "7s" | "10s"; -/** How long a tap (or head-tilt) keeps the board up; each further tap restarts it. */ +const DEFAULT_TAP_DURATION: GlanceTapDuration = "5s"; + +/** + * How long a tap (or head-tilt) keeps the board up; each further tap restarts + * it. "off" means a single tap does not show the board at all; a head-tilt + * then uses the default duration. + */ export const glanceTapDurationSetting = new ConfigSettingEnum({ id: "glanceboard-tap-duration", label: "Show on tap", storageKey: "glanceboard.tapDuration", - defaultValue: "5s", - values: ["3s", "5s", "7s", "10s"], - formatValue: (value) => value.replace("s", " s"), - description: "How long a single tap (or a head-tilt) keeps the Glanceboard on screen.", + defaultValue: DEFAULT_TAP_DURATION, + values: ["off", "3s", "5s", "7s", "10s"], + formatValue: (value) => (value === "off" ? "Disabled" : value.replace("s", " s")), + description: + "How long a single tap (or a head-tilt) keeps the Glanceboard on screen. Disabled: a single tap does not show the Glanceboard.", }); +/** Whether a single tap while asleep shows the board. */ +export function glanceShowOnTap(): boolean { + return glanceTapDurationSetting.get() !== "off"; +} + export function glanceTapTimeoutMs(): number { - return Number.parseInt(glanceTapDurationSetting.get(), 10) * 1000; + const duration = glanceTapDurationSetting.get(); + const seconds = duration === "off" ? DEFAULT_TAP_DURATION : duration; + return Number.parseInt(seconds, 10) * 1000; } /** A long-press holds the board up until the press is released. */ diff --git a/app/apps/glanceboard/index.ts b/app/apps/glanceboard/index.ts index 00616ea1..b2295508 100644 --- a/app/apps/glanceboard/index.ts +++ b/app/apps/glanceboard/index.ts @@ -5,6 +5,7 @@ import { glanceboardEnabledSetting, glanceShowOnHeadTiltSetting, glanceShowOnLongPressSetting, + glanceShowOnTap, glanceTapTimeoutMs, } from "./glanceboard-settings"; import { QUADRANT_LAYOUT } from "./layout"; @@ -17,6 +18,7 @@ const glanceboardApp: AppDefinition = { glanceboard: { size: { width: QUADRANT_LAYOUT.width, height: QUADRANT_LAYOUT.height }, isEnabled: () => glanceboardEnabledSetting.get(), + showOnTap: glanceShowOnTap, tapTimeoutMs: glanceTapTimeoutMs, showOnLongPress: () => glanceShowOnLongPressSetting.get(), showOnHeadTilt: () => glanceShowOnHeadTiltSetting.get(), diff --git a/app/g2/glance-host.ts b/app/g2/glance-host.ts index 7c84736b..555ee070 100644 --- a/app/g2/glance-host.ts +++ b/app/g2/glance-host.ts @@ -68,13 +68,15 @@ export class GlanceHost { /** * The glance event a sleep-time gesture means under the board's settings, * or null when the shell should see the input as usual: nothing while the - * board is disabled, no hold when "Show on long press" is off, no press - * from a head-tilt when "Show on head tilt" is off (it then wakes the - * regular UI). A release always passes so a hold in progress can end. + * board is disabled, no press from a tap when "Show on tap" is disabled, + * no hold when "Show on long press" is off, no press from a head-tilt when + * "Show on head tilt" is off (it then wakes the regular UI). A release + * always passes so a hold in progress can end. */ eventForGesture(gesture: "head-tilt" | string): GlanceEvent | null { 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 === "head-tilt" && !provider.showOnHeadTilt()) return null; return glanceEventForGesture(gesture, this.isVisible());