Commit Graph
69 Commits
Author SHA1 Message Date
James Babcock 06146c2b08 Introduce oxlint, and fix lint warnings 2026-09-29 11:54:22 -07:00
James Babcock cb6dddd120 Add a video player, launched by selecting a video file from the Files app 2026-09-28 14:11:04 -07:00
James Babcock 2052e268b0 Add touch-down event to simulated and watch inputs 2026-09-28 02:34:08 -07:00
James Babcock c6949fde3b Reorder Done and Follow-up options in voice input dialog 2026-09-27 18:50:43 -07:00
James Babcock 392554dd37 Depth effects 2026-09-22 10:59:51 -07:00
James Babcock 4320021222 Display lists 2026-09-22 00:25:40 -07:00
James Babcock ccb320c66f Add tokens and faceclaw-input script, which allows using a CLI utility as an input device for the glasses 2026-09-20 00:34:58 -07:00
James Babcock 7b19c00443 Forward ring input events before filtering, and include swipe info 2026-09-19 19:02:11 -07:00
James Babcock b972cd7682 Rebase firmware on 2.3.0, fixing issue with lost ring input events 2026-09-19 17:19:21 -07:00
James Babcock 617cdc39eb Port assistant integration (with cloud AIs) to iOS 2026-09-19 00:02:15 -07:00
James Babcock e8e144f3f2 Merge main into ios-port and update the iOS CFW transport 2026-09-17 23:33:51 -07:00
James Babcock c9e95a3f69 Refinements to bulitin games
All: settings persistence
All: pause on menu
Flappy: both swipe directions trigger flaps
Freecell: skip irrelevant locations
Blocks: Lower speed/difficulty
Pinball: remove the half-implemented Nudge gesture.
2026-09-12 23:50:23 -07:00
James Babcock 937c73d81b Add battery indicator for Android Wear watch 2026-09-12 19:35:38 -07:00
James Babcock ca839f45d6 Fancier battery displays: Stacked view, segmenting 2026-09-09 14:46:47 -07:00
James Babcock adf9fa89c4 Add R1 ring battery indicator 2026-09-09 11:31:44 -07:00
James Babcock 92d5857c3e Add brightness control to the system context menu 2026-09-09 02:09:08 -07:00
James Babcock 0765e943fb Add "AI Chat" app. 2026-09-09 01:15:19 -07:00
James Babcock b07ae0b479 iOS TTF support; voice input 2026-09-07 16:57:49 -07:00
James Babcock 99793a37a7 iOS porting: Main screen and compositor 2026-09-05 22:59:37 -07:00
James Babcock 1524766996 Add screen-size setting to Navigate and Terminal apps 2026-09-05 10:45:39 -07:00
James Babcock aef6194687 Add keyboard-input button to the phone home screen 2026-09-03 16:06:46 -07:00
James Babcock 9234458dd6 Dim the screen underneath when a context menu is open 2026-09-03 01:25:10 -07:00
James Babcock 83c3732ba7 Swap app and system context menu gestures 2026-09-02 21:17:15 -07:00
James Babcock 987f442897 Context menus: gesture switch between app and system context menus; gesture help text; move items from app to system menu 2026-09-02 21:14:40 -07:00
James Babcock fddb6ea886 Long-press and short-then-long with a context menu open switches between context menus 2026-09-01 21:38:52 -07:00
James Babcock b1493a353d Context menus are centered and include window title 2026-09-01 00:58:28 -07:00
James Babcock 6483d00647 Add support for the new short-then-long-press gesture 2026-08-31 20:31:08 -07:00
James Babcock 54005ae95a Preview mode uses phone mic 2026-08-30 20:04:33 -07:00
James Babcock 061b2eb215 Update the launcher, Files app and builtin games to better handle watch swipe gestures 2026-08-30 15:03:53 -07:00
James Babcock 80d688dd4e Move and rename DashboardInputEvent->InputEvent 2026-08-30 13:02:44 -07:00
James Babcock f3ad55ca3d Merge branch 'calculator' of https://github.com/kalanihelekunihi/faceclaw into calculator 2026-08-26 00:49:20 -07:00
James Babcock 1f9f3b35d3 UI refinements to watch app and phone preview
<details>
<summary>Prompts Used</summary>
Thanks. Next up, let's add a "Phone display" section to the Settings app (above the Watch section). We'll add a "Preview color" setting (options: White, Green; default White), which controls whether the mirror display is white/grayscale (best looking) or green (matches the physical glasses). We'll move the "Touch mirror" toggle setting (currently on the phone main screen) into the phone display settings menu. We'll add a "Show brightness control" toggle setting (default off) and a "Show screen size" toggle setting (default off), which control the visibility of the corresponding elements on the phone main screen.

Let's also make it so that double-tapping the watch (or simulated watch on the phone, mirror, etc) while the app-switcher is selected turns off the glasses display, in the same way that double-tappign the R1 ring does.

> All four pieces are in and everything builds (webpack, Gradle with the Java changes, and a clean `tsc`). Summary:
>
> **"Phone display" Settings section** — added between Roam and Watch in the on-glasses Settings app, with four entries:
> - **Preview color** (White/Green, default White) — new enum setting `phone.previewColor`. The colorization happens in the Java preview path: `PreviewBitmapUtil.fromGray` gained a `green` variant whose LUT maps luminance to green-on-black instead of grayscale, threaded through `getCompositePreviewBitmap` → `getCompositePreview(green)` → the controller, which reads the setting per refresh. A settings change also schedules an immediate preview refresh, so flipping the color updates the mirror right away instead of waiting for the next composited frame.
> - **Touch mirror** — moved from the phone main screen. It's now a proper `ConfigSettingBoolean` reusing the existing `phone.mirrorTouch` storage key, so anyone who already turned it off keeps that choice. The label+switch pair is gone from the ring row in `remote-controls.xml`, and the view model reads the setting per gesture.
> - **Show brightness control** and **Show screen size** (both default off) — new booleans controlling visibility of the brightness slider/Auto toggle and the display-mode picker on the phone main screen. The whole display-controls row collapses when both are off; the bindings refresh through the existing `onAnySettingChanged` → `refreshDisplayControls` path, so toggling them from the glasses updates the phone screen live. Note this means the main screen is more minimal out of the box — brightness and screen size remain reachable via the Settings app either way.
>
> **Watch double-tap at the app switcher** — the watch-scheme special case in `handleSidebarInput` is removed: a double-click from any source (watch, phone pad/d-pad, mirror double-tap — they all arrive as source `"watch"`) now turns the display off when the sidebar is selected, exactly like the ring's. The original code deliberately excluded the watch on the theory that sleeping was a trap since any watch gesture re-wakes; with your "Watch input wakes display" setting now gated (and double-tap waking a dark display regardless), the toggle behavior is symmetric: double-tap at the switcher sleeps, double-tap again wakes.
>
> Hardware-test notes: the green preview tint and the collapsed-controls layout are worth one visual check on the phone, and the double-tap-to-sleep from the watch is a quick on-device confirm.
</details>
2026-08-25 01:37:29 -07:00
James Babcock eef7aa2679 <details>
<summary>Prompts Used</summary>
Act as a code reviewer for https://github.com/jimrandomh/faceclaw/pull/14 (checked out in this working directory).

> * The review finished — 42 raw candidates were verified down to 10 confirmed findings. Reporting them now.
>
> * Code review(review · 10 findings)
>   ⎿  app/phone-ui/main-view-model.ts
>        ●  766 [correctness]   mirrorFraction subtracts view.getLocationOnScreen() from tap coordinates that NativeScript already delivers
>                               view-local, so every phone-mirror tap is shifted up/left and misroutes
>        ●   84 [resource-leak] MainViewModel's constructor registers onAnySettingChanged and discards the unsubscriber; a new view model is
>                               built on every page navigation, leaking listeners and retained preview bitmaps
>      wear/app/src/main/kotlin/com/faceclaw/wear/MainActivity.kt
>        ●   52 [correctness]   onStop abandons an in-progress stem-button hold without sending LONG_PRESS_RELEASE, so the glasses shell
>                               escape menu opens by itself
>      wear/app/src/main/kotlin/com/faceclaw/wear/ui/TouchpadGestures.kt
>        ●   62 [correctness]   Breaking out of the touchpad gesture loop on a consumed pointer event (or coroutine cancellation mid-hold)
>                               skips onLongPressEnd, leaving a stuck long-press
>      wear/app/src/main/kotlin/com/faceclaw/wear/PhoneLink.kt
>        ●  270 [correctness]   loadStateItem queries the Data Layer with a hostless Uri (`wear:/faceclaw/state`), which matches no stored
>                               items, so the cached phone state is never read
>      app/ui/shell/modal-layer.ts
>        ●   14 [correctness]   MODAL_INTERIOR is a module-level constant frozen at import time from the (now runtime-dynamic) display mode,
>                               while modalRect() is computed live, so modals render corrupted after a display-mode switch
>      app/g2/dashboard-controller.ts
>        ● 1404 [correctness]   handleMirrorTouch wakes the glasses display unconditionally, bypassing the watchWakesDisplaySetting gate
>                               that the parallel injectSyntheticRingInput path honors
>        ● 1440 [correctness]   A mirror tap while any second layer is stacked (e.g. an in-window long-press menu) degrades to a blind
>                               synthetic click that activates whatever is highlighted, not what was tapped
>      App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawWearBridge.java
>        ●  147 [correctness]   Watch gestures/commands queued while the JS listener is down are replayed up to 30 seconds later on listener
>                               registration, executing stale non-idempotent input the watch already reported as failed
>      wear/app/src/main/kotlin/com/faceclaw/wear/ui/RemoteScreen.kt
>        ●  232 [efficiency]    WristTwistDetector (gyroscope, default-on) samples at 100 Hz via DisposableEffect and is not stopped when
>                               the activity stops, draining the watch battery while the process is cached
>
> * Review of PR #14 (Wear OS companion app + remote controls, 85 files, +5813/−102) is done — 10 confirmed findings reported above, ranked by
>   severity. The headline items are the phone-mirror tap coordinate double-correction (which misroutes every mirror tap in the default
>   configuration) and two independent paths on the watch that can drop LONG_PRESS_RELEASE, each of which makes the shell escape menu open on the
>   glasses by itself.
>
> A few things beyond the reported list, for context:
>
> Refuted during verification (looked like bugs, aren't): the watch ack-timeout-during-render theory (input injection never blocks on BLE
> transmit), mirror swipes stealing page scroll (no enclosing ScrollView), and a suspected raw-settings-key notification gap (the store-level
> broadcast covers raw keys).
>
> Confirmed but below the 10-finding cap — worth folding in if you're touching those areas anyway:
> - shell.closeAssistant() no-ops via popIfTop when another layer sits above the assistant, yet still acks ok to the watch.
> - Landscape preview sizing still assumes the old 260-wide panel after the XML moved to 360 (overlap under ~568 dip).
> - The shell escape menu and tool-debug dialogs hardcode SIDEBAR_WIDTH + 8, wrong in the new full-panel mode.
> - A CapabilityClient IPC fires every 250 ms during streamed assistant replies even on watchless phones; backgrounded preview updates bypass
>   their 150 ms floor.
> - Cleanups: the sidebarWidth() > 0 || focus === "sidebar" predicate appears three times, sidebar slot math is duplicated in chrome-layer.ts,
>   dead protocol-version plumbing, dead padPointers field, and display-mode is missing from wear/PROTOCOL.md.
>
> If you'd like, I can apply fixes for any subset of these, or post the findings as inline PR comments (/code-review 14 --comment).

<hr>

Thanks, let's go ahead and write fixes for all of the issues you described.

> Everything builds and tests pass. All 16 issues from the review are fixed — the 10 reported findings plus the six below-cap items. Here's what changed, by fix:
>
> **Watch app (Kotlin)**
> - **Stuck long-press via onStop** — `MainActivity.onStop` now sends `LONG_PRESS_RELEASE` when a stem hold is in progress before dropping the link, so the phone's escape-menu countdown can't run to completion on its own.
> - **Stuck long-press via the gesture loop** — `detectTouchpadGestures` wraps the loop in try/finally that pairs every `onLongPressStart` with an `onLongPressEnd`, covering both the consumed-event `break` and coroutine cancellation mid-hold.
> - **Cached state never loading** — `PhoneLink.loadStateItem` now queries `wear://*/faceclaw/state` (wildcard host) instead of a hostless Uri that matched nothing, so the watch shows the cached dashboard state when the phone is unreachable.
> - **Sensors draining battery while stopped** — the gyroscope/accelerometer/off-body detectors are now driven by a `WhileStartedEffect` helper tied to the activity lifecycle: they stop on `ON_STOP` (palmed screen, back to watch face) and restart on `ON_START`, instead of running at 100 Hz for as long as the process is cached.
> - **Dead protocol plumbing** — removed the unused `Protocol.PROTOCOL_VERSION` const and the never-read `PhoneState.protocol` field; the wire field stays and PROTOCOL.md now documents it as reserved.
>
> **Phone Java**
> - **Stale input replay** — `FaceclawWearBridge` now queues only idempotent `/faceclaw/state/request` messages for replay after the JS listener registers; gestures and commands that arrived while the dashboard was down are acked as failed and dropped, never executed up to 30 seconds later.
>
> **Phone TypeScript**
> - **Mirror taps misrouting (the top finding)** — `mirrorFraction` no longer subtracts `getLocationOnScreen()`; NativeScript's `getX`/`getY` are view-local DIPs (I verified this in the installed `@nativescript/core` gesture source), so every mirror tap was being shifted up-left by the status bar + action bar. Taps now land where you touch.
> - **Mirror touch ignoring the wake setting** — `handleMirrorTouch` now honours `watchWakesDisplaySetting`: with it off, only a double-tap reaches a dark display, matching the rest of the watch scheme.
> - **Blind click through open menus** — `LayerStack.hitTest` now consumes a mirror tap when any layer is stacked (menu, dialog) instead of reporting a miss, so a tap on visible app content can no longer activate whatever menu row happened to be highlighted (e.g. "Close window").
> - **Modal corruption after display-mode switch** — `MODAL_INTERIOR` is now a live `modalInterior()` function, and `ShellModalLayer.paint` re-syncs the inner stack's size each paint, so notification modals render correctly after switching Band ↔ Full panel.
> - **View-model leak** — `MainViewModel` keeps its controller/settings unsubscribers and exposes `attach()`/`dispose()`; `main-page.ts` disposes on unload and re-attaches on load (re-attach is needed because suspend/resume fires unloaded/loaded without a navigation, and `subscribe` delivers a fresh snapshot so nothing is missed).
> - **`closeAssistant` no-op** — new `LayerStack.popThrough` closes the assistant overlay plus anything stacked above it (follow-up voice dialog, alert); the watch ack now says "The assistant was not open." when there was nothing to close.
> - **Watchless-phone IPC churn** — assistant stream events and alerts are skipped when no watch is reachable, so a streaming reply no longer triggers a CapabilityClient lookup every 250 ms.
> - **Backgrounded preview floor bypass** — the 150 ms floor check (and timestamp) in `updateCompositePreview` now runs before the foreground-activity check, so backgrounded per-frame refreshes actually throttle.
> - **Full-panel hardcodes** — the shell escape menu and tool-debug dialogs position at `sidebarWidth() + 8` (0 in full-panel mode) instead of the fixed 64 px strip.
> - **Cleanups** — the strip-visible predicate is now one `sidebarStripVisible()` helper in geometry.ts (used in three places); sidebar slot math is a single `slotPosition()` shared by drawing and hit-testing; dead `padPointers` removed; landscape preview sizing updated to the XML's 360 dp panel; `wear/PROTOCOL.md` documents the `display-mode` command and `displayMode` state field.
>
> Verification: `./build.sh` (webpack + Gradle) succeeds, `npx tsc --noEmit` is clean, the wear `:app:assembleDebug` builds, and all 59 tests pass. The behavioral fixes — especially mirror-tap coordinates, the two long-press-release paths, and the watch state cache — still need a hardware pass to confirm on device.
</details>
2026-08-25 00:09:47 -07:00
James Babcock 646335cb64 Merge branch 'main' of https://github.com/jimrandomh/faceclaw into android-wear-integration
# Conflicts:
#	app/phone-ui/main-page.xml
#	app/phone-ui/main-view-model.ts
2026-08-24 22:24:03 -07:00
Kalani Helekunihi fe85846e6f Add calculator and microphone conversation apps
Add symbolic math and graphing tools, dual-microphone audio processing, live captions, translation, speaker diarization, sentiment analysis, and searchable conversation history.

Extend Android voice and BLE support for microphone control, recording, transcoding, and on-device speaker identification, with coverage for calculator and microphone workflows.
2026-08-25 00:22:19 -05:00
James Babcock ab963974e5 Overridden ring long-press handling also applies for the glasses touchpad 2026-08-24 19:23:09 -07:00
Kalani Helekunihi 8fa04d1b46 Add Wear OS companion app and remote controls
Add a Wearable Data Layer bridge for syncing dashboard state and commands.

Introduce a standalone watch app with assistant, app launcher, touchpad remote, settings, and connectivity UI.
2026-08-23 15:02:35 -05:00
James Babcock f6035ea9ec Performance optimizations 2026-08-20 02:46:03 -07:00
James Babcock eef9fbaab4 Adjust UI to account for user-configured variable font size 2026-08-19 20:48:18 -07:00
James Babcock 96842ceb23 Use TTF fonts throughout the UI; also add some more functions to app extension API 2026-08-19 19:35:24 -07:00
James Babcock fdf683761e Apps submit mutli-plane images with glyphs, rather than mere images 2026-08-16 21:01:20 -07:00
James Babcock b86f395866 Add mic support for EvenHub apps 2026-08-16 21:01:20 -07:00
James Babcock d7d12afcaa Modify sidebar size and vertical sizing options to allow 576x288 EvenHub apps to fit cleanly 2026-08-11 00:07:14 -07:00
James Babcock 6f45888627 Add support for a local model (Qwen3) 2026-08-09 23:52:21 -07:00
James Babcock 9b3832d7a7 Refactor: Organize files by app 2026-08-03 00:08:52 -07:00
James Babcock 1ec6b3ff83 Crop screenshots 2026-08-02 19:36:16 -07:00
James BabcockandClaude Fable 5 48bac85cbe External assistant backend: agent bridge client + MCP server
Phase 3 of the voice-assistant design: assistant.backend=external routes
utterances over a dial-out websocket to faceclaw-agent-bridge (an OpenClaw
plugin on the user's machine). The phone serves its ToolRegistry as MCP on
the same socket, with proactive gating and rate limiting enforced locally.
New Assistant settings section with backend/bridge settings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XCdkQyB3RUVPTuEmhxVEdp
2026-08-01 18:28:47 -07:00
James Babcock 37e95627b1 Add window persistence across app restarts 2026-08-01 15:27:44 -07:00
James Babcock 7d2a41bd56 Apps are variable height; add vertical position setting 2026-07-31 14:52:51 -07:00
James Babcock 434419c8e4 Add a minesweeper game, a freecell game, and some voice assistant tools for window management 2026-07-26 19:45:14 -07:00