From df77b672f5a7de0868fa3e27e87da81bb779ebea Mon Sep 17 00:00:00 2001 From: JMO Date: Tue, 22 Sep 2026 22:09:35 -0700 Subject: [PATCH 1/7] Stop the shell render loop spinning when there is no display target renderShell paints first and checks for a display target last, and the stale-data repaint re-requests before that check. requestShellRender runs `do { renderShell() } while (shellRenderQueued)`, and because a render is already in progress the re-request just sets shellRenderQueued. So with no display target the two feed each other: paint, report stale, re-queue, discard the work, round again, with no yield and no backoff. SHELL_REFRESH_INTERVAL_MS is 60 seconds, so the timer is not the driver. Measured on a device with the glasses not presenting, from the app's own frame-timings export: 40 of 40 recorded frames were render:shell target=shell-overlay, every one discarded, mean 55 ms and median 53 ms apart, so about 19 full renders a second all thrown away. Main thread state=Runnable with utm=22599, and seven ANR records over three days, each "Input dispatching timed out ... Waited 10001ms". Afterwards the same state produced 5 renders in 100 seconds, and the export showed a normal mixed workload again instead of one loop crowding everything else out. Hoisting the check above the paint fixes both halves at once: a frame with nowhere to go costs nothing, and the stale-data re-request lives downstream of the early return, so it can no longer feed the loop. The copy of the check that used to sit after the paint is removed rather than left in place. Nothing between the two points can change the result, and the compiler agrees: the early return narrows this.phase, which made the "charging" comparison unreachable (TS2367). submitWindowFrame, the sibling path for in-process window frames, already checks the display target before doing any work. Not unit-tested. The change is in dashboard-controller.ts, which imports 56 modules, so a test there would mostly exercise mocks, and it is an ordering defect rather than a predicate, so extracting a shouldPresent() helper would pass both before and after. The shape that would work is pulling the render gate and its stale-data retry into a small module taking the display target and the stale flag and returning whether to paint and whether to re-request. --- app/g2/dashboard-controller.ts | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index caa893c8..1edfb46c 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -2480,6 +2480,19 @@ class DashboardController { this.pendingShellRenderCauseFrameId = 0; const frameId = frameTimings.startFrame("render:shell", causeFrameId); frameTimings.annotateFrame(frameId, shell.describeInputTarget()); + // Nothing to send a frame to: stop here, BEFORE painting. This check used + // to run only after the paint, which made a no-display state a + // main-thread busy loop: paint (~55 ms) -> endRenderPass reports stale + // data -> requestShellRender re-queues (shellRenderQueued, since a render + // is in progress) -> the display check discards the work -> the do/while + // in requestShellRender goes straight round again. Measured on a device + // with the glasses not presenting: 40 of 40 frames discarded, ~19 a + // second, enough to starve input and ANR. Leaving early costs nothing and + // breaks the loop, because the re-request lives downstream of this point. + if (!this.display || this.phase === "charging") { + frameTimings.finishFrame(frameId, "discarded: shell render with no display target"); + return; + } const wantFreshData = this.nextShellRenderWantsFreshData; this.nextShellRenderWantsFreshData = false; if (wantFreshData) frameTimings.logFrame(frameId, "follow-up repaint that must not use cached data"); @@ -2498,11 +2511,12 @@ class DashboardController { this.nextShellRenderWantsFreshData = true; this.requestShellRender(frameId); } + // The display-target check that used to live here now runs before the + // paint, at the top of this function. Nothing between the two can change + // it -- paintSurface is synchronous and there is no await in between -- so + // repeating it here is dead code, and the compiler agrees: the early + // return narrows this.phase, making the "charging" comparison impossible. const display = this.display; - if (!display || this.phase === "charging") { - frameTimings.finishFrame(frameId, "discarded: shell render with no display target"); - return; - } // A shell overlay that dims what it covers (a context menu) must dim the // window surfaces too, which live below the shell surface in the // compositor: forward the factor before this frame composites. From e6ec542f5602752537764581223c2161bfd9af17 Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sat, 26 Sep 2026 14:54:36 -0700 Subject: [PATCH 2/7] Version 0.8.0 --- CHANGELOG | 18 +++++++++++++++++- app/version.ts | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e3f76a11..67ed686b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,16 +1,18 @@ # Changelog -## 0.7.3 - Future +## 0.8.0 - 2026-09-26 ### Depth and Animation * A new display-list system for glasses-side drawing, unlocking z-effects and animation * Menus animate when changing selection and scrolling * Menus bounce at the ends, and show part of the next row when there is more below +* The launcher and Files app icon grids animate sliding, scrolling and bouncing * Fade-in/out effects when turning the screen on/off * Custom auto-brightness control algorithm, with configurable min, max and curve * Depth effects for the window switcher, top bar, and modals * Glanceboard has configurable distance +* Dimmed background behind the system context menu dithers rather than hiding minimum-brightness underlays ### Other Features and Bugfixes @@ -20,12 +22,26 @@ * EvenHub: Fix login form being stuck open without a cancel button * Calendar: Fix a timezone issue that could cause all-day events to appear on the preceding day * Compass: Make the calibration readiness visible by default +* Terminal app: Tap a host heading to launch a shell there (alternative to the app context menu) +* Nightscout: Move the "Always show in top bar" setting earlier in the form so it's harder to miss +* EvenHub: Fix the sign-in form reopening on every launch after an unfinished sign-in +* EvenHub: Fix the installer not rerendering when an app finishes downloading +* Fix a frozen menu in the notification modal +* Fix a race when restoring open apps at startup, which could leave the previously-foreground window covering the new one +* Reduce phone CPU usage +* Fix a memory leak +* Better handling of silent mode +* Tweak the layout of the voice input dialog +* Add GitHub workflows for automated tests ### iOS port: * Add iOS calendar integration * iOS main screen matches the Android version's styling * Hub apps on iOS no longer have their timers stopped while the phone app is in the background +* Some settings that were Android-only are now available on iOS +* Move a lot more of the iOS implementation onto shared Kotlin code +* Converted most Android-specific duplicative code to shared code ## 0.7.2 - 2026-09-19 diff --git a/app/version.ts b/app/version.ts index 28d4db8f..b4ab7c40 100644 --- a/app/version.ts +++ b/app/version.ts @@ -1,2 +1,2 @@ -export const FACECLAW_VERSION = "0.7.2"; +export const FACECLAW_VERSION = "0.8.0"; export const USER_AGENT = "Faceclaw/"+FACECLAW_VERSION; From f473855710b2ffe239731d757963103821a21dac Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sat, 26 Sep 2026 20:42:08 -0700 Subject: [PATCH 3/7] Add animation preferences menu --- app/ui/dashboard-settings.ts | 19 ++++++++++++++++++- app/ui/dashboard/settings-menus.ts | 18 ++++++++++++++++++ app/ui/menu-animation-pref.ts | 18 ++++++++++++++++++ app/ui/menu-highlight-motion.ts | 4 +++- app/ui/menu-scroll-motion.ts | 6 ++++-- app/ui/menu.ts | 7 +++++++ tests/brightness-curve.test.cjs | 7 +++++++ tests/brightness-picker.test.cjs | 1 + tests/icon-grid.test.cjs | 6 +++++- tests/menu-display-list.test.cjs | 1 + tests/menu-scroll-animation.test.cjs | 21 +++++++++++++++++++++ tests/music-settings.test.cjs | 1 + tests/notification-filter.test.cjs | 1 + tests/settings-panel.test.cjs | 1 + 14 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 app/ui/menu-animation-pref.ts diff --git a/app/ui/dashboard-settings.ts b/app/ui/dashboard-settings.ts index 6eec38d3..01ffac01 100644 --- a/app/ui/dashboard-settings.ts +++ b/app/ui/dashboard-settings.ts @@ -18,6 +18,7 @@ import { } from "~/assistant/models"; import { isLocalModelReady } from "../native/llama"; import { drawRightValueMenuItem, drawToggleMenuItem, MenuItem, openModalMenu } from "./menu"; +import { MENU_ANIMATION_KEY } from "./menu-animation-pref"; import { LIST_ROW_TEXT_INSET, lineStep } from "./metrics"; import { Layer, type LayerContext } from "./layers"; import { GrayImage } from "~/graphics/image"; @@ -361,11 +362,27 @@ export const autoBrightnessCurveSetting = new ConfigSettingString({ }); const SCREEN_FADE_MS = 280; +export const menuAnimationSetting = new ConfigSettingBoolean({ + id: "menu-animation", + label: "Menu animation", + storageKey: MENU_ANIMATION_KEY, + defaultValue: true, + description: "Slide the highlight, scroll, and bounce at the ends in menus, lists, and the launcher and Files icon grids. When off, they move instantly.", +}); + +export const screenFadeSetting = new ConfigSettingBoolean({ + id: "screen-fade", + label: "Screen fade", + storageKey: "display.screenFade", + defaultValue: true, + description: "Fade the display in and out when the screen turns on or off. When off, it switches instantly.", +}); + export function getBrightnessPreferences() { const level = brightnessSettingToLevel(brightnessSetting.get()); return { auto: level === null, level: level ?? 50, minimum: Number(autoBrightnessMinSetting.get()), maximum: Number(autoBrightnessMaxSetting.get()), - curve: autoBrightnessCurveSetting.getValidValue(), fadeMs: SCREEN_FADE_MS }; + curve: autoBrightnessCurveSetting.getValidValue(), fadeMs: screenFadeSetting.get() ? SCREEN_FADE_MS : 0 }; } export const screenTimeoutSetting = new ConfigSettingEnum({ diff --git a/app/ui/dashboard/settings-menus.ts b/app/ui/dashboard/settings-menus.ts index a51af850..6a24ee4c 100644 --- a/app/ui/dashboard/settings-menus.ts +++ b/app/ui/dashboard/settings-menus.ts @@ -60,9 +60,11 @@ import { phoneRotationSetting, ringConnectionModeSetting, sonioxApiKeySetting, + screenFadeSetting, enumSettingMenuItem, firmwareDebugFlagsSetting, lockScreenEnabledSetting, + menuAnimationSetting, saveVoiceRecordingsSetting, showBleBandwidthSetting, suspendEvenHubWhenScreenOffSetting, @@ -114,6 +116,8 @@ function settingsSections(): SettingsSection[] { enumSettingMenuItem(displayModeSetting), // Submenu: top-bar battery indicator style plus per-device visibility. batteryIndicatorsMenuItem(), + // Submenu: toggles for menu/icon-grid motion and the screen on/off fade. + animationsMenuItem(), // Controls the top-bar clock (24-hour vs 12-hour). enumSettingMenuItem(timeFormatSetting), // Opens the modal font picker (face, weight, size) for UI text. @@ -312,6 +316,20 @@ function batteryIndicatorsMenuItem(): MenuItem { }; } +/** The Display section's "Animations" row: opens a modal submenu of animation toggles. */ +function animationsMenuItem(): MenuItem { + return { + label: "Animations", + description: "Turn off menu and icon-grid motion, or the fade when the screen turns on and off.", + onSelect: (ctx) => { + openSettingsSubMenu(ctx, "Animations", [ + toggleSettingMenuItem(menuAnimationSetting), + toggleSettingMenuItem(screenFadeSetting), + ]); + }, + }; +} + const LOCAL_MODEL_GB = `${(LOCAL_MODEL.sizeBytes / 1e9).toFixed(1)}GB`; // While a download is running, re-render on progress updates so the row's diff --git a/app/ui/menu-animation-pref.ts b/app/ui/menu-animation-pref.ts new file mode 100644 index 00000000..40381fb2 --- /dev/null +++ b/app/ui/menu-animation-pref.ts @@ -0,0 +1,18 @@ +/** + * Whether menus and icon grids animate on the glasses (Settings > Display > + * Animations > Menu animation). The motion classes can't read the settings + * store themselves (it is native, and they load under Node in unit tests), + * so ui/menu.ts installs a reader in each isolate that paints menus. Without + * one, menus animate. + */ +export const MENU_ANIMATION_KEY = "display.menuAnimation"; + +let readMenuAnimation: () => boolean = () => true; + +export function menuAnimationEnabled(): boolean { + return readMenuAnimation(); +} + +export function setMenuAnimationReader(read: () => boolean): void { + readMenuAnimation = read; +} diff --git a/app/ui/menu-highlight-motion.ts b/app/ui/menu-highlight-motion.ts index b10e16fd..71a2dd53 100644 --- a/app/ui/menu-highlight-motion.ts +++ b/app/ui/menu-highlight-motion.ts @@ -1,3 +1,5 @@ +import { menuAnimationEnabled } from "./menu-animation-pref"; + export const MENU_HIGHLIGHT_DURATION_MS = 240; export type MenuHighlightAnimation = { dx: number; dy: number; startedAt: number; token: number; durationMs: number }; @@ -30,7 +32,7 @@ export class MenuHighlightMotion { fromX += this.animation.dx * remaining; fromY += this.animation.dy * remaining; } - const eligible = previous && previous.index !== index && this.fromIndex === previous.index && + const eligible = menuAnimationEnabled() && previous && previous.index !== index && this.fromIndex === previous.index && (previous.scroll === scroll || scrolling) && previous.width === width && previous.height === height; this.animation = eligible ? { dx: Math.round(fromX - x), dy: Math.round(fromY - y), startedAt: now, token: nextAnimationToken(), durationMs: MENU_HIGHLIGHT_DURATION_MS } : undefined; this.fromIndex = null; diff --git a/app/ui/menu-scroll-motion.ts b/app/ui/menu-scroll-motion.ts index 85540825..ec098007 100644 --- a/app/ui/menu-scroll-motion.ts +++ b/app/ui/menu-scroll-motion.ts @@ -1,4 +1,5 @@ import { DrawExpression as E, ExprOp } from "../graphics/draw-expression"; +import { menuAnimationEnabled } from "./menu-animation-pref"; import { MENU_HIGHLIGHT_DURATION_MS, nextAnimationToken } from "./menu-highlight-motion"; /** Longest scroll, in pixels, that animates; longer jumps snap. */ @@ -72,16 +73,17 @@ export class MenuScrollMotion { /** Record this paint's settled offset; returns the animation in flight, if any. */ paint(scroll: number, box: Box, now: number): MenuScrollAnimation | undefined { const previous = this.previous; + const enabled = menuAnimationEnabled(); const sameBox = !!previous && previous.box.x === box.x && previous.box.y === box.y && previous.box.width === box.width && previous.box.height === box.height; if (!previous || !sameBox || previous.scroll !== scroll) { const from = previous ? this.offsetAt(previous.scroll, now) : scroll; - const eligible = sameBox && this.navigated && from !== scroll && Math.abs(scroll - from) <= MAX_ANIMATED_SCROLL; + const eligible = enabled && sameBox && this.navigated && from !== scroll && Math.abs(scroll - from) <= MAX_ANIMATED_SCROLL; this.animation = eligible ? { from, to: scroll, startedAt: now, token: nextAnimationToken(), durationMs: MENU_HIGHLIGHT_DURATION_MS } : undefined; this.previous = { scroll, box: { ...box } }; - } else if (this.bounceBy) { + } else if (this.bounceBy && enabled) { const from = this.offsetAt(scroll, now); this.animation = Math.abs(scroll - from) <= MAX_ANIMATED_SCROLL ? { from, peak: scroll + this.bounceBy, to: scroll, startedAt: now, token: nextAnimationToken(), durationMs: MENU_BOUNCE_DURATION_MS } diff --git a/app/ui/menu.ts b/app/ui/menu.ts index 39af0a14..dc64c901 100644 --- a/app/ui/menu.ts +++ b/app/ui/menu.ts @@ -1,12 +1,19 @@ import { G2_LENS_HEIGHT, G2_LENS_WIDTH, GrayImage, type UiFont } from "../graphics/image"; import { wrapText } from "../graphics/textwrap"; import { getDefaultSmallFont } from "../graphics/ui-fonts"; +import { getBooleanSetting } from "../native/settings-store"; import { clamp } from "../util/numeric-util"; import { Layer, LayerContext, PaintBelow } from "./layers"; +import { MENU_ANIMATION_KEY, setMenuAnimationReader } from "./menu-animation-pref"; import { Menu, MENU_HIGHLIGHT_FILL, MENU_HIGHLIGHT_STROKE } from "./menu-core"; import { GESTURE_DOUBLE_CLICK, InputEvent } from "./gestures"; import { LIST_ROW_TEXT_INSET, centeredTextY, lineStep, listRowHeight, menuTitleHeight } from "./metrics"; + +// Menu and IconGrid consult this (through their motion classes) at each +// paint; a SharedPreferences read, so changes apply to the next navigation. +setMenuAnimationReader(() => getBooleanSetting(MENU_ANIMATION_KEY, true)); + const DEFAULT_MENU_X = 8; const DEFAULT_MENU_Y = 8; const DEFAULT_MENU_WIDTH = 272; diff --git a/tests/brightness-curve.test.cjs b/tests/brightness-curve.test.cjs index 03db54e2..1f81e744 100644 --- a/tests/brightness-curve.test.cjs +++ b/tests/brightness-curve.test.cjs @@ -22,6 +22,7 @@ function settingsFixture(store = new Map()) { if (id.includes('settings-store')) return { onSettingsStoreChanged() {}, getStringSetting: (k, d) => store.get(k) ?? d, setStringSetting: (k, v) => store.set(k, v), + getBooleanSetting: (k, d) => store.get(k) ?? d, setBooleanSetting: (k, v) => store.set(k, v), }; if (id.includes('brightness-curve')) return require('../.test-build/app/g2/brightness-curve.js'); return { Layer: class {}, ASSISTANT_MODEL_CHOICES: [] }; @@ -35,6 +36,12 @@ test('auto minimum defaults to 20 and preserves a saved preference', () => { assert.equal(settingsFixture().getBrightnessPreferences().minimum, 20); assert.equal(settingsFixture(new Map([['display.autoBrightnessMin', '25']])).getBrightnessPreferences().minimum, 25); }); +test('the screen fade setting switches the on/off fade between 280 ms and instant', () => { + const api = settingsFixture(); + assert.equal(api.getBrightnessPreferences().fadeMs, 280); + api.screenFadeSetting.set(false); + assert.equal(api.getBrightnessPreferences().fadeMs, 0); +}); test('curve drafts preview exactly while brightness keeps the previous valid saved curve', () => { const store = new Map([['display.autoBrightnessCurve', '0:0,2:50,8:100']]); let api = settingsFixture(store), curve = api.autoBrightnessCurveSetting; diff --git a/tests/brightness-picker.test.cjs b/tests/brightness-picker.test.cjs index 4c793b4d..a8a07672 100644 --- a/tests/brightness-picker.test.cjs +++ b/tests/brightness-picker.test.cjs @@ -27,6 +27,7 @@ const layers = load('app/ui/layers.ts', { '../native/frame-timings': { spanCurrent: (_name, paint) => paint() }, }); const menu = load('app/ui/menu.ts', { + './menu-animation-pref': require('../.test-build/app/ui/menu-animation-pref.js'), '../native/settings-store': { getBooleanSetting: (_key, fallback) => fallback }, './menu-highlight-motion': require('../.test-build/app/ui/menu-highlight-motion.js'), '../graphics/menu-scroll-list': require('../.test-build/app/graphics/menu-scroll-list.js'), './menu-scroll-motion': require('../.test-build/app/ui/menu-scroll-motion.js'), '../graphics/draw-expression': require('../.test-build/app/graphics/draw-expression.js'), '../graphics/image': graphics, '../graphics/ui-fonts': fonts, '../graphics/textwrap': textwrap, '../util/numeric-util': numeric, './gestures': gestures, './metrics': load('app/ui/metrics.ts'), diff --git a/tests/icon-grid.test.cjs b/tests/icon-grid.test.cjs index d8f48594..79e78324 100644 --- a/tests/icon-grid.test.cjs +++ b/tests/icon-grid.test.cjs @@ -60,7 +60,11 @@ function loadIconGrid({ lastInputWasWatch = false } = {}) { './menu-core': build('ui/menu-core'), './metrics': metrics, }; - const menu = load('app/ui/menu.ts', { ...common, './layers': {} }); + const menu = load('app/ui/menu.ts', { + ...common, './layers': {}, + './menu-animation-pref': build('ui/menu-animation-pref'), + '../native/settings-store': { getBooleanSetting: (_key, fallback) => fallback }, + }); const grid = load('app/ui/icon-grid.ts', { ...common, '../graphics/draw-expression': build('graphics/draw-expression'), diff --git a/tests/menu-display-list.test.cjs b/tests/menu-display-list.test.cjs index fdfe12df..57a57a6b 100644 --- a/tests/menu-display-list.test.cjs +++ b/tests/menu-display-list.test.cjs @@ -19,6 +19,7 @@ const menuCore=load('app/ui/menu-core.ts',{ '../graphics/image':graphics,'./menu-highlight-motion': require('../.test-build/app/ui/menu-highlight-motion.js'), '../graphics/menu-scroll-list': require('../.test-build/app/graphics/menu-scroll-list.js'), './menu-scroll-motion': require('../.test-build/app/ui/menu-scroll-motion.js'), '../graphics/draw-expression': require('../.test-build/app/graphics/draw-expression.js'), }); const {MenuLayer}=load('app/ui/menu.ts',{ + './menu-animation-pref': require('../.test-build/app/ui/menu-animation-pref.js'), '../native/settings-store': { getBooleanSetting: (_key, fallback) => fallback }, '../graphics/image':graphics,'../graphics/textwrap':{},'../graphics/ui-fonts':{getDefaultSmallFont:()=>font}, '../util/numeric-util':{clamp:(n,a,b)=>Math.max(a,Math.min(b,n))},'./gestures':{}, './menu-highlight-motion': require('../.test-build/app/ui/menu-highlight-motion.js'), '../graphics/menu-scroll-list': require('../.test-build/app/graphics/menu-scroll-list.js'), './menu-scroll-motion': require('../.test-build/app/ui/menu-scroll-motion.js'), '../graphics/draw-expression': require('../.test-build/app/graphics/draw-expression.js'), diff --git a/tests/menu-scroll-animation.test.cjs b/tests/menu-scroll-animation.test.cjs index cf7047c8..112a2a9c 100644 --- a/tests/menu-scroll-animation.test.cjs +++ b/tests/menu-scroll-animation.test.cjs @@ -9,6 +9,7 @@ const { DrawExpression: E } = require('../.test-build/app/graphics/draw-expressi const { menuScrollList, slidingHighlightY } = require('../.test-build/app/graphics/menu-scroll-list.js'); const { MENU_BOUNCE_DURATION_MS, scrollOffsetExpression } = require('../.test-build/app/ui/menu-scroll-motion.js'); const { encodePresentation } = require('../.test-build/app/graphics/presentation-wire.js'); +const { setMenuAnimationReader } = require('../.test-build/app/ui/menu-animation-pref.js'); // Also consumed by FrameDisplayListTest.kt. const SCROLL = '078a000000030002000400020000070000009600000001000200040011223344556677880200020000000000ff250100300102300180f0800180f0161101001732800180f01610300180f0302341403101001102000200010008000000ff280101300100300180f0800180f0161101001732800180f01610300180f030234140310100170100160400020000000103'; @@ -196,6 +197,26 @@ test('a bounce during a scroll starts from the offset on screen', () => { assert.ok(offsets[0] < offsets[1], 'it starts where the scroll had got to, above its settled offset'); }); +test('with menu animation off, scrolls, slides and bounces snap', (t) => { + setMenuAnimationReader(() => false); + t.after(() => setMenuAnimationReader(() => true)); + const timed = (image) => image.draws.filter((draw) => draw.presentation?.displayList?.timeline); + const menu = inkMenu(); + paint(menu, 1000); + menu.moveSelection(1); + const slid = paint(menu, 2000); + assert.equal(menu.scrollTop, 0); + assert.equal(timed(slid).length, 0, 'the highlight snaps'); + menu.moveSelection(1); + const scrolled = paint(menu, 3000); + assert.equal(menu.scrollTop, 20); + assert.equal(timed(scrolled).length, 0, 'the scroll snaps'); + menu.select(6); + paint(menu, 4000); + menu.moveSelection(1); + assert.equal(timed(paint(menu, 5000)).length, 0, 'no bounce'); +}); + test('scroll lists survive the bridge with animated copy coordinates', () => { const strip = { width: 2, height: 4, pixels: Uint8Array.of(17, 34, 51, 68, 85, 102, 119, 136) }; const timeline = { from: 0, to: 2, startedAt: 1000, token: 7, durationMs: MENU_HIGHLIGHT_DURATION_MS }; diff --git a/tests/music-settings.test.cjs b/tests/music-settings.test.cjs index 97da8432..d40b3f9d 100644 --- a/tests/music-settings.test.cjs +++ b/tests/music-settings.test.cjs @@ -155,6 +155,7 @@ test('Music settings keeps toggles and selection when a new app arrives and supp '../util/numeric-util': { clamp: (n, lo, hi) => Math.max(lo, Math.min(hi, n)) }, './menu-highlight-motion': require('../.test-build/app/ui/menu-highlight-motion.js'), '../graphics/menu-scroll-list': require('../.test-build/app/graphics/menu-scroll-list.js'), './menu-scroll-motion': require('../.test-build/app/ui/menu-scroll-motion.js'), '../graphics/draw-expression': require('../.test-build/app/graphics/draw-expression.js'), './metrics': load('app/ui/metrics.ts'), './gestures': {}, + './menu-animation-pref': require('../.test-build/app/ui/menu-animation-pref.js'), '../native/settings-store': { getBooleanSetting: (_key, fallback) => fallback }, }; deps['./menu-core'] = load('app/ui/menu-core.ts', (name) => deps[name]); const menu = load('app/ui/menu.ts', (name) => deps[name]); diff --git a/tests/notification-filter.test.cjs b/tests/notification-filter.test.cjs index 90e57a9c..ea1be2bd 100644 --- a/tests/notification-filter.test.cjs +++ b/tests/notification-filter.test.cjs @@ -86,6 +86,7 @@ function ui(fontSize = 12) { '../util/render-freshness': { renderPassAllowsStaleData: () => false }, './menu-highlight-motion': require('../.test-build/app/ui/menu-highlight-motion.js'), '../graphics/menu-scroll-list': require('../.test-build/app/graphics/menu-scroll-list.js'), './menu-scroll-motion': require('../.test-build/app/ui/menu-scroll-motion.js'), '../graphics/draw-expression': require('../.test-build/app/graphics/draw-expression.js'), './metrics': load('app/ui/metrics.ts'), + './menu-animation-pref': require('../.test-build/app/ui/menu-animation-pref.js'), '../native/settings-store': { getBooleanSetting: (_key, fallback) => fallback }, './gestures': {}, }; const requireModule = (name) => { diff --git a/tests/settings-panel.test.cjs b/tests/settings-panel.test.cjs index dcfbabac..0a6b2448 100644 --- a/tests/settings-panel.test.cjs +++ b/tests/settings-panel.test.cjs @@ -22,6 +22,7 @@ const font = BdfFont.parse(fs.readFileSync(path.join(__dirname, '../app/fonts/te const textwrap = load('app/graphics/textwrap.ts', {}); const fonts = { getDefaultSmallFont: () => font }; const menu = load('app/ui/menu.ts', { + './menu-animation-pref': require('../.test-build/app/ui/menu-animation-pref.js'), '../native/settings-store': { getBooleanSetting: (_key, fallback) => fallback }, '../graphics/image': graphics, '../graphics/textwrap': textwrap, '../graphics/ui-fonts': fonts, '../util/numeric-util': { clamp: (n, lo, hi) => Math.max(lo, Math.min(hi, n)) }, './gestures': {}, './metrics': metrics, './menu-core': menuCore, From aeeea5ead395f80a27e3a5b3e3fa06d88febea86 Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sat, 26 Sep 2026 22:44:39 -0700 Subject: [PATCH 4/7] Animations in EvenHub menus; closer style matching --- .../app/FaceclawEvenHubWebViewHost.kt | 40 ++++- app/apps/evenhub/compositor.ts | 45 +----- app/apps/evenhub/containers.ts | 13 +- app/apps/evenhub/list-menu.ts | 126 +++++++++++++++ app/apps/evenhub/session.ts | 10 +- app/apps/evenhub/webview.ts | 7 +- tests/evenhub-containers.test.cjs | 14 ++ tests/evenhub-list-menu.test.cjs | 148 ++++++++++++++++++ tests/tsconfig.json | 1 + 9 files changed, 349 insertions(+), 55 deletions(-) create mode 100644 app/apps/evenhub/list-menu.ts create mode 100644 tests/evenhub-list-menu.test.cjs diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubWebViewHost.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubWebViewHost.kt index 7e563d0e..bee8e1da 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubWebViewHost.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubWebViewHost.kt @@ -1,6 +1,7 @@ package com.faceclaw.app import android.app.Activity +import android.content.MutableContextWrapper import android.os.Build import android.os.Handler import android.os.Looper @@ -54,9 +55,20 @@ import java.util.ArrayList * timers/onResume asserted on attach. The main Looper keeps ticking under the * foreground service, so apps keep driving their glasses windows in the * background. + * + * Activity recreation: this host outlives any one activity (it is a process + * singleton, and apps keep running while the activity is destroyed and + * recreated, e.g. after an app update or a config change). The overlay lives in + * one activity's content view, so attach and showOnPhone first move it, with + * every WebView in it, into the activity they are given if it isn't already + * there; otherwise "show" would raise it in a dead window. WebViews are created + * on a MutableContextWrapper whose base is re-pointed at the same time, so the + * dialogs Chromium opens from the page (e.g. a