Skip to content

feat(android): native phone app for Remote Access - #292

Open
BigWebstas wants to merge 8 commits into
johannesjo:mainfrom
BigWebstas:feat/android-phone-app
Open

BigWebstas wants to merge 8 commits into
johannesjo:mainfrom
BigWebstas:feat/android-phone-app

Conversation

@BigWebstas

Copy link
Copy Markdown

Description

Adds a native Android app (android/, Kotlin/Compose) for Remote Access, plus the small desktop additions it relies on.

Android app

  • Connect by QR code or link, pair with the desktop PIN, and link several computers, each with its own pairing.
  • Agent list with minimized tasks, pull to refresh, a home-screen widget, and usage meters (shown when the desktop serves /api/mobile/usage, from feat: add phone usage meters and Antigravity usage #291; hidden otherwise).
  • Terminal in the desktop's colors, rendered lazily, with reliable follow (optionally always jump to the latest), quick keys, quick replies, voice input, and an opt-in mode that sizes the PTY to the phone.
  • Changes tab with per-file diffs, notes, new tasks, and closing tasks with the same warnings as the desktop's Close Task dialog.
  • Built-in chat tasks: transcript, approvals and questions, send and stop.
  • Optional notifications when an agent needs input, errors or finishes (foreground service, off by default).
  • Obsidian dark and light themes, splash screen, themed icon, predictive back, animations and haptics; release builds shrink with R8 (about 2 MB).

Desktop support

  • POST /api/mobile/tasks/:id/close (paired token) and GET /api/mobile/tasks/:id/diff (view-only and paired), both renderer-backed like notes. Without force, close answers 409 with the warnings instead of closing.
  • view-size WebSocket message: a paired phone may size a terminal while viewing it. The desktop pane's size is remembered and restored on release or disconnect; only the phone that set the size can hand it back.
  • Subscribing sends a rendered snapshot of the screen plus up to 1000 lines of history from the existing main-process headless mirror (@xterm/addon-serialize, pinned to the same beta as the other xterm packages), instead of the raw byte replay, which redraw-heavy agents fill with repaints of one screen. Exited agents still get the raw replay.
  • Minimized tasks appear in the phone's agent list.

Build and install instructions are in android/README.md. Note: #291 also adds an earlier version of android/; whichever merges second will need a rebase, and I'm happy to do it.

Issues Resolved

None directly. Related to #192 (installing on Android); this offers a native app instead of the PWA.

Check List

  • New functionality includes testing.
  • New functionality has been documented in the README if applicable. (The app has its own android/README.md.)

🤖 Generated with Claude Code

A Kotlin/Compose client for the Connect Phone API in android/.

- Connect by QR code or link, pair with the desktop PIN, and link
  several computers, each with its own pairing
- Agent list with minimized tasks, usage meters (when the desktop
  serves /api/mobile/usage), pull to refresh, and a home-screen widget
- Swipe sideways between open tasks, with the position in the header
- Terminal: desktop colors, lazy rendering, reliable follow (optionally
  always jump to the latest), quick keys, quick replies, voice input,
  and an opt-in mode that sizes the PTY to the phone
- Changes tab with per-file diffs, notes, new tasks, and closing tasks
  with the desktop's warnings
- Built-in chat tasks: transcript, approvals and questions, send / stop
- Optional notifications when an agent needs input, errors or finishes
- Obsidian dark and light themes, splash, themed icon, predictive back,
  animations and haptics; release builds shrink with R8

Desktop support:
- POST /api/mobile/tasks/:id/close (paired) and
  GET /api/mobile/tasks/:id/diff (view-only and paired), renderer-backed
- `view-size` socket message: a paired phone may size a terminal while
  viewing it; the desktop's size returns on release or disconnect
- Subscribing sends a rendered snapshot with up to 1000 lines of history
  (@xterm/addon-serialize over the existing headless mirror)
- Minimized tasks appear in the phone's agent list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BigWebstas
BigWebstas force-pushed the feat/android-phone-app branch from 93175ca to f8ed67b Compare September 29, 2026 23:38
BigWebstas and others added 7 commits September 29, 2026 20:57
Settings -> Widget now sets how opaque the home-screen widget's card is
(100/75/50/25%) and what color it is (Obsidian, Slate, Light). The fill
and border are one color faded together, and each card carries text
colors that stay readable, so a light card gets dark text.

Both settings push to placed widgets immediately instead of waiting for
the next publish, and Settings previews the real card at the chosen
transparency.

RemoteViews can only set a background from a resource, so the stops are
shape drawables: three colors by four stops. A contrast test keeps each
palette's text on its own card at or above the 4.5:1 WCAG AA floor; it
caught Slate's timestamp color at 4.1:1, now lightened.
Add a Diff tab to the phone UI and merge/close actions behind a
read-only readiness dialog.

Diffs come from the renderer's own loadTaskDiff rather than the MCP
coordinator: Coordinator.tasks only tracks delegated sub-tasks, so the
coordinator route would 404 for phone-created and ordinary desktop
tasks. Readiness reuses the desktop's pure buildMergeReadiness so both
surfaces agree on what blocks a merge.

Read routes (diff, readiness) follow notes and accept the view-only
token; merge and close run real git and require the PIN-elevated paired
token. All task ids are rejected at the boundary when they name a
prototype-chain key.
Add a Merge action beside Close on the agent screen, opening a dialog
that renders the desktop's own merge-readiness checks read-only and
gates the confirm button on them.

A blocked verdict disables merging; a warning does not, so someone away
from their desk can still merge with eyes open. canMerge defaults to
false when the field is missing, so an unreadable reply can never
enable a git write.
The phone app now offers the same 15 looks as the desktop instead of its
own Obsidian/Light pair. Appearance in Settings picks a look with a live
swatch, and the theme (follow system, always dark, always light) chooses the
tone, with the dark and light look remembered separately so a theme switch
brings the matching look with it.

LookPalettes.kt is generated from the sources the desktop already keeps its
looks in: src/lib/look.ts for ids, labels, order and tone, src/styles.css for
the colors and radius scale, and src/lib/theme.ts for the terminal ANSI
palettes and look pairings. The generator resolves each preset's full
cascade (no phone-side fallbacks), flattens radial-gradients to their middle
stop, and falls back to the muted Noir ANSI set for dark looks the desktop
leaves on xterm defaults. LookPresetsTest pins the default Obsidian values
so a new desktop theme cannot quietly change the out-of-the-box appearance.

npm run generate:android-looks rewrites the file and
npm run check:android-looks fails when it drifts; the Kotlin tests run the
same check.
…/android-phone-app

Brings the desktop's 15 look presets to the phone (Settings → Appearance),
with LookPalettes.kt generated from src/lib/look.ts, src/styles.css and
src/lib/theme.ts so the two stay in step. Touches Screens.kt alongside the
phone diff review and task lifecycle work already on this branch.
A task with git isolation 'none' edits the project folder in place, so
it has no branch or worktree of its own. handleGetDiff fell through to
loadTaskDiff, which diffed the project folder against the base branch:
the phone either showed a git error or, worse, listed unrelated work
already sitting in the repo as if the task had made it.

Answer with an empty diff and an `unsupported` flag instead, and have
both phone clients say why there is nothing to compare. The flag is
optional, so an older desktop that omits it still renders its diff.

The Kotlin client read the response as a Pair, which had no room for a
third field; fetchDiff now returns a TaskDiff parsed in one place.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Header Switch menu plus latency in the Agents subtitle when
  multiple computers are saved.
- Terminal Stop button, Material icons for stop/history/mic and
  larger arrow quick keys (-> takes Tab's slot, / restored).
- Send-quick-replies-immediately setting and per-agent local
  prompt history with a Recent-messages dialog.
- Custom connection labels, editable in Settings > Computers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant