0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/apps/android/.gitignore
Wing 684becf0f8
Android app on the shared Rust mobile core (Material 3 Expressive) (#609)
* Android app on the shared Rust mobile core

A Jetpack Compose app (apps/android) that links crates/mobile through
UniFFI — the same transcript layout engine, text measurement and
virtualization as iOS. The painter draws Rust display lists on a Skia
canvas at Rust coordinates with the same Geist bytes; Minikin backs the
fallback measurer. UI is Material 3 Expressive with Zeron's palette.

Kotlin-only renames in crates/mobile/uniffi.toml avoid clashes with
Throwable.message and AutoCloseable.close.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: online hosts first, fade the transcript behind the composer; more screenshots

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: composer-first new session, capsule composer, iOS-parity session rows

- New session is the iOS/desktop canvas: harness mark + "What are we
  building?" over a composer card whose chips (project, branch or host,
  model, effort) open Material 3 Expressive grouped menus.
- One shared composer: a resting one-line capsule that becomes a card
  with context chips when focused; no drop shadow; shape-morphing
  send/stop; a Queue/Steer delivery chip while the agent works.
- Session rows show the harness brand mark, project + branch subline,
  Done/Input/Failed status and state-tinted PR badges; small extended FAB.
- Harness brand marks ported from the shared SVG path data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: Zeron's icon set and a Material 3 Expressive shell

- Every glyph is Zeron's own: the desktop icon set (crates/ui/assets/icons)
  plus the iOS tab/tool icons, compiled to VectorDrawables at build time
  (scripts/android/svg2vd.py) — no Material icons left in the UI.
- Expressive shell: display-weight Geist headers (emphasized type scale),
  filter pills with live counts, SegmentedListItem rows with project-toned
  harness tiles, a floating nav capsule + round search button, and the
  New session bar with the live summary (iOS accessory parity).
- Round tonal chrome on the session screen, expressive action menus for
  row / transcript / overflow actions, rebuilt settings and search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: runway, fold/reveal motion, attachments, @ mentions, queue editing

- Own-turn runway (desktop OwnTurnAnchor): an immediate send glides the
  prompt to the top and holds a viewport of room for the reply; a message
  queued behind the live turn takes the runway once its bubble lands.
- Row motion: fold toggles tween 140 ms ease-out, a growing tool group
  reveals over 360 ms expo; rows interpolate from the previous frame.
- Attachments: Photos / Files / Paste image via the system pickers,
  staged as JPEG (long side <= 2560, <= 24 MB, up to 8) with removable
  thumbnails; pending thumbnails in the transcript show a wavy upload
  ring driven by the escort progress.
- @ mentions: file suggestions above the composer; tokens become
  zeron-file links on send (session + new session).
- Queue editing: host lease with renewal, the user's draft stashed and
  restored, only the visible text committed.
- Project picker is a bottom sheet grouped by machine; choice menus are
  one group with a trailing check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: replace all screenshots with the current UI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: chat wallpaper (iOS parity)

The wallpaper hero behind the sessions list and the new-session page:
aspect-filled artwork fading out downward at the opacity the Rust
contrast guard allows (wallpaper_safe_opacity), the new-session composer
softening it, and the list fading it as it scrolls. Effects (dither,
ASCII, halftone, scanlines) run in the shared core (wallpaper_render).
Settings has choose / effect / remove; --es wallpaper <path> and
--es wallpaper-effect set it at launch, like iOS -wallpaper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: flat session chrome, per-chunk streaming veil

- The transcript ends where the composer begins: no gradient scrim, no
  text streaming behind the composer (the runway's viewport was the full
  height, so reply tails ran under it, faded and cramped).
- Header is a flat Material top app bar that takes the container tone
  once content scrolls under it, instead of a gradient cut-off.
- Jump to latest is a small FAB floating over the transcript.
- Streaming veil: each inserted chunk fades on its own clock, found by a
  prefix+suffix diff (list rows carry their bullet after the item text,
  so the old prefix check skipped the veil and words popped in); chunks
  are recorded during composition so new text is never drawn opaque
  first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: Material navigation — search app bar, extended FAB, no custom nav

Two destinations don't take a navigation bar in Material 3 (it's for
three to five), and a floating capsule isn't a Material component. Home
now follows the search-led Material pattern: AppBarWithSearch with the
account avatar (→ Settings, now its own screen with a large top app
bar), ExpandedFullScreenSearchBar for search, FilterChips, and an
ExtendedFloatingActionButton for New session that collapses on scroll.
Session and new-session headers are standard TopAppBars with icon
buttons. Removes the custom floating nav, pills, and tonal circle
buttons. All screenshots recaptured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: restore the filter pills; white send arrow on the accent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: restore the pre-review home, settings and chat header

Brings back the Sessions header, floating nav with the New session bar,
Settings as a tab, the search screen, and the round header buttons.
Keeps the flat transcript/composer layout, jump FAB, streaming veil,
filter pills and white send arrow, and adds a status-bar scrim on
scrolled home and settings. Screenshots recaptured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: iOS feature parity — questions, drafts, sections, projects, archive

- Question panel: one page per question, auto-advance, "Other…" text,
  Pi input/editor prompts (prefill + multiline) answerable; replaces the
  composer while open.
- Sessions: Group by Project (git identity, Home per device), options
  menu (New section, Collapse all, Group by project, Archived), swipe
  right to pin, Move to section, section rename/delete, pinned reorder,
  Archived screen, Undo snackbar from every archive, iOS row precedence.
- New session: project picker grouped by repository with a host chip
  for checkouts, New project folder browser, text/options/images kept
  when closed unsent.
- Session: per-chat drafts, open failures return to Sessions with a
  note, image viewer (thumbnails and image chips), chip icons, "Sending
  to host…" and reconnect countdown, PR chip Open/Copy link, take photo,
  Ctrl+Enter sends, markSeen on leave.
- App: sends get 25s to deliver after backgrounding (short FGS), an
  expired session keeps its local store, OAuth state checked, tokens
  sealed with Android Keystore, sign-out confirmation, list/detail
  layout on large screens, Ctrl+N / Ctrl+Shift+F.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: README launch routes; pull to refresh waits for a real change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: remote voice mode (port of the iOS voice call)

Adds sh.zeron.android.voice, the Android side of the Codex voice
orchestrator call: audio on the phone, Codex and its tools on a
registered execution host advertising voiceHostCapability().

- VoiceController (iOS RemoteVoiceController): host eligibility and the
  remote-voice dev override, start/stop/mute, end reasons with messages
  and Retry/Settings, per-user/org remembered host and style, call
  sounds, proximity (earpiece + screen off at the ear), one call at a
  time, no auto reconnect, the scripted preview and a WebRTC self-test.
- VoicePeer + VoiceMedia (CodexVoicePeer/NativeVoiceMedia): Google WebRTC
  M150 (io.github.webrtc-sdk:android, the iOS pin's milestone), audio
  only; Prepare/Offer/ApplyAnswer/SetMuted/Levels/Close completed through
  VoiceCall.completeMedia exactly as iOS; manual audio until the host
  confirms, focus loss ends the call, speaker/earpiece/headset routing.
- VoiceCallService: microphone foreground service with a CallStyle call
  notification (host, call clock, Mute, Hang Up; tap opens the stage).
- Compose UI: the core orb on a Canvas, the core caption fader, the call
  stage, voice settings, the New session bar button / live call strip,
  the session header button and VoiceHost (mic prompt, keep-awake,
  off-stage failure snackbar).
- Call sounds from the iOS app in res/raw.

Wiring into AppModel, navigation and the existing screens is left to
the integrating change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: wire voice into the app

The call lives on AppModel (stopped on any sign-out). The New session
bar carries the voice button and the live call strip; sessions get a
header voice button; Settings gets a Voice row; the call stage and
voice settings are routes (also from the call notification and
zeron://voice). Launch extras: voice-preview, voice-stage, remote-voice,
voice-selftest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: zeron://voice opens the call

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: stop re-composing every session row on scroll

The sessions screen read `list.firstVisibleItemScrollOffset` while
composing (for the status-bar scrim), so it re-ran on every scroll frame
while the header was on screen. `RowActions` was rebuilt on each run, so
no row could skip: every visible row re-composed every frame.

`StatusBarScrim` now takes the list and derives `scrolled` itself (the
same read in Settings, Archived and Voice settings goes with it), and
`RowActions` is remembered.

Nothing Phone (2), release build, 1.5 s drag at the list top: UI thread
p90 7.7 -> 5.6 ms; 8 flings: 7 -> 0-3 janky frames.

* Android: fade the status-bar scrim without a grey flash

Animating from Color.Transparent (black at zero alpha) passes through
semi-transparent grey: in the light theme the status-bar band dropped
from luma 249 to 173 for ~67 ms on each toggle (screen recording). Fade
from the page tone at zero alpha instead; same for the nav bar pill.

* Android: ask for the panel's peak refresh rate while touching

Nothing OS holds third-party windows at 90 Hz on its 120 Hz panel
(`PRIORITY_APP_REQUEST_RENDER_FRAME_RATE_RANGE ... mMaxRefreshRate=90.0`)
unless the window asks for a display mode. Ask for the fastest mode while
the user touches the app and for 10 s after, then hand the choice back so
an idle screen isn't pinned at 120 Hz.

Drag at the list top: a frame every 11.2 -> 8.4 ms (90 -> 119 fps), no
dropped frames; coming back from idle costs one ~19 ms frame while the
mode switches.

* Android: side chats, subagents, terminals and visuals (iOS parity); M3 floating toolbar

Companions, as on iOS:
- Chips above the composer ("2 working", side chats, live terminals) and a
  companions sheet listing a session's subagents (live first, ticking),
  side chats (new, fork, swipe to archive) and terminals (swipe to close).
- Session header gains the companions button (badged while agents run); the
  menu groups New side chat / Fork / Terminal, Pin / Copy / Archive, Delete.
- Side chats head themselves under their parent; fresh ones left unused go.
- Subagent cards in the transcript open the subagent's live, read-only
  transcript with a working/finished/failed bar.
- Terminals: a View painting the Rust emulator's frames (box drawing and
  blocks drawn per cell), IME + hardware keys, fling scrollback, pinch to
  resize, word selection with a floating Copy / Add to message / Paste menu,
  a key bar (esc, sticky ctrl/alt, tab, repeating arrows, punctuation,
  paste), a tab switcher, status pill, and refs that reattach after launch.
- Agent visuals (show_visual) paint in the transcript with live surfaces
  and controls.

Home drops the tab bar for a Material 3 Expressive floating toolbar
(Settings, Search, voice) with New session as its FAB; it tucks away to the
FAB while scrolling down. Settings is a pushed page.

Merged main; the Kotlin bindings rename TerminalSession.close → end, and
build-core.sh ships libc++_shared.so (the core now links C++).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Android: Material 3 bottom app bar on the Sessions page

Settings, Search and voice as the bar's actions, New session as its FAB;
the bar slides away while the list scrolls down. Replaces the floating
toolbar, which sat small and centred over the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Android: Cloud and large-screen parity with iOS

Cloud (iOS Cloud/):
- CloudStore: status and credits, GitHub, the vault's logins and their
  usage, billing, session machines; cached reads that revalidate, with
  backoff when a read fails. Browser hand-offs come back through
  zeron://signed-in.
- Settings → Agents: Providers (each device's agents with their switches
  and logins, plus Cloud's), Cloud (GitHub, repositories, Cloud projects),
  Billing (credits, plans, packs, Stripe checkout and portal).
- An agent's accounts on Cloud or a device: usage bars, switch, remove,
  sign in through the browser (paste-code fallback), API keys.
- GitHub device-flow sheet; the Cloud project picker.
- New session on Cloud: the Cloud host, Cloud's models, branches from
  GitHub, "New Cloud project…", "Starting on Cloud…", out-of-credits.
- Sessions: the out-of-credits notice (a refused send shakes it), a failed
  Cloud machine named in the banner, an error card's "Log in".
- Welcome pages after sign-in: appearance, sync, GitHub, agents,
  notifications.

Large screens (iOS SplitRootController), from 700dp wide: the sessions
sidebar beside the open session or the new-session page; companions in an
inspector column with terminals, subagents and side chats pushed inside it
(the sidebar steps aside below 1100dp); Settings as a dialog; Ctrl+N,
Ctrl+Shift+F, Ctrl+B, Ctrl+J, Ctrl+Alt+0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Android: the Cloud list's scrim derives its scroll state too

* Android: drop the title header from the session menu

It repeated the header's title and host, and clipped the first item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Android: the model picker as a sheet (iOS parity)

"Model" over where the chat runs, a provider switcher whose thumb follows
swipeable pages (the chat's provider first), models straight on the sheet
with the current one tinted and checked and scrolled into view, a notice
("Your next message continues this chat with Codex", or why the provider
can't change now), search past 12 models, loading skeletons, and a beat to
see the pick land before it closes. Sessions offer the host's other
providers between turns when the host can switch (Cloud chats: Cloud's
agents); picking one moves the chat there and drops the old effort and
options. The new-session page opens the same sheet with a tab per provider
the target runs.

A host that doesn't answer its model list gets the built-in catalog after
5 s (the FFI call can't be cancelled, so the wait is raced, not timed out);
providers that join after the sheet opens load then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Android: build the APK in CI and offer it on zeron.sh

- .github/workflows/android.yml: a release APK (arm64, the core at the
  mobile-dist profile) whenever the app or the Rust core changes. Pull
  requests get it as an artifact; main publishes it to R2 as
  zeron.sh/releases/zeron-android-arm64.apk (no-cache) plus a versioned copy
  and sha256s. Publishing needs the upload key in secrets; forks and
  unconfigured repos build debug-signed and don't publish.
- Gradle: the version is the workspace's (Cargo.toml), the build number comes
  from CI, and assembleRelease signs with ZERON_ANDROID_KEYSTORE when set.
- build-core.sh: ZERON_ANDROID_PROFILE picks the core's Cargo profile.
- Website: Android in the mobile downloads row; on an Android phone the
  download buttons offer the APK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Android: a third the APK size; CI artifact holds only the APK

- Compress native libraries and dex in the APK: it's downloaded from
  zeron.sh, not delivered by Play (161 MB → 44 MB locally).
- Drop material-icons-extended: the app draws Zeron's own icons, and only
  leftover imports referenced it.
- Package only the ABIs the core was built for (ZERON_ANDROID_ABIS): CI's
  arm64 APK no longer carries WebRTC's x86_64 library.
- The workflow stages in out/android: the repo's dist/ (desktop packaging)
  was swept into the artifact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Android CI: build with the release key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Android CI: stop compiling the core for the host

The Kotlin bindings came from a host build of zeron-mobile, compiled twice
(the plain lib, then again with the generator's feature): about 7 of the
build's 15 minutes. UniFFI's generator now has a crate of its own
(crates/mobile-bindgen, uniffi + its CLI) and reads the bindings out of the
Android library just built, as the iOS script does with its device library;
the output is byte-identical. Without the NDK the script still builds a host
library for the bindings.

Pull requests build the core at the quicker `mobile` profile; main keeps
`mobile-dist` (thin LTO) for the published APK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: wing-anara <wing_13@live.com>
Co-authored-by: Alexandre VARGAS <alexandre.vargas.lopez@gmail.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-10-24 17:12:34 -07:00

7 lines
68 B