Skip to content

feat(git): commit dialog, plus phone commit and usage routes - #298

Open
BigWebstas wants to merge 32 commits into
johannesjo:mainfrom
BigWebstas:android-app-interfacing
Open

BigWebstas wants to merge 32 commits into
johannesjo:mainfrom
BigWebstas:android-app-interfacing

Conversation

@BigWebstas

Copy link
Copy Markdown

Description

Adds a desktop commit dialog, plus the phone routes that let the Android app (#297) and the phone web UI commit and show usage.

This builds on #297. The branch contains #297's commits up to 4 October, so please review #297 first. Once #297 merges, this diff shrinks to the ~1,000 lines described below.

Desktop commit dialog

  • A Commit button in the task title bar opens a dialog that lists uncommitted files and whether each is staged.
  • It offers Stage all (git add -A) and Unstage all, and commits the staged changes with a message.

Phone commit route

  • GET /api/mobile/tasks/:taskId/commit (mobile and paired tokens) lists the uncommitted files and their staged state.
  • POST /api/mobile/tasks/:taskId/commit (paired only) runs stage-all, unstage-all, or a commit with a required message, then returns the new status.
  • The renderer uses the same git helpers as the desktop dialog, which share file loading through src/lib/commit-status.ts. Only worktree tasks that haven't been merged yet are allowed.

Phone usage meters

  • GET /api/mobile/usage (mobile and paired tokens) serves the desktop's usage snapshot through a renderer-backed request, so phones never add load to the rate-limited usage endpoints.
  • The phone web UI shows the 5h/7d meters per provider above the task list; tap to refresh. The Android app reads the same route.
  • UsageState moves into shared-types so main, renderer and phone share it.

Issues Resolved

None filed.

Check List

  • New functionality includes testing. (Git helper, commit route, usage route and phone UI tests.)
  • New functionality has been documented in the README if applicable. (Not applicable: no new setting or command.)

🤖 Generated with Claude Code

BigWebstas and others added 30 commits September 29, 2026 17:36
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>
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.
Add a Home Wi-Fi setting under "Wait for VPN". When the phone is on that
network, connect without waiting for a VPN. Reading the Wi-Fi name needs
location access, which the app requests when the name is set.

Rename VpnMonitor to NetworkMonitor, which now also tracks the Wi-Fi name,
and consolidate the VPN wait check into waitsForVpn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test and build the app when android/ changes. Pushing an android-v* tag
publishes a signed APK as a GitHub release, separate from desktop v*
releases and never marked latest. Release signing and the version come
from the environment, so the keystore stays out of the repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Serve the desktop's usage snapshot at GET /api/mobile/usage (mobile and
paired tokens) via a renderer-backed request, so phones never add load to
the rate-limited usage endpoints. The phone task list shows the 5h/7d
meters for each provider with a snapshot; tap to refresh.

Move UsageState into shared-types so main, renderer and phone share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b7480ee)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 50d50d1)
Adds a Commit button to the task title bar that opens a dialog listing
uncommitted files with their staged state, a Stage all action (git add -A),
and a commit of the staged changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b557201)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c36d0eb)
Serve the desktop commit dialog at /api/mobile/tasks/:taskId/commit. GET
(mobile and paired tokens) lists uncommitted files and whether each is
staged; POST (paired only) runs stage-all, unstage-all, or commit with a
required message, and answers the new status. The renderer runs the same
git helpers as the desktop dialog and only allows unlanded worktree tasks.

Share the dialog's file loading in src/lib/commit-status.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a Commit button next to Merge on a task. Its dialog lists the
uncommitted files and which are staged, offers Stage all and Unstage all,
and commits what is staged with a message, through the desktop's
/api/mobile/tasks/:taskId/commit route. Reading works with the view-only
token; staging and committing need pairing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The main-process screen mirror kept only 1000 lines of scrollback, and
phones opening an agent terminal are sent that mirror, so long sessions
showed a truncated history. Match the desktop renderer's 10k lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lines still too wide for the phone at the smallest font now wrap at word
boundaries, so the agent terminal no longer needs horizontal panning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oesn-t-fully-populate-f4255f

Phone terminal: full history and word wrap
The task pager kept syncing its settled page into the screen while it
animated out, so the list change from the close sent it to a
neighbouring task's terminal. Only follow the pager while an agent
screen is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Save computers, settings and prompt history to a zip, optionally
encrypted with a password (AES-256-GCM, PBKDF2 key). Restore from
Settings or the connect screen; it validates the whole file before
writing and restarts the app. Automatic backups write daily or weekly
to a picked folder, keep the latest 10, and hold their password sealed
by an Android Keystore key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The widget sums agents from every saved computer, polling the others'
agent lists once a minute over HTTP while the app is connected, and
says how many answered ("3 working · 2 comps"). It also gains the app
icon by its name, a status dot colored by what needs you most, and a
divider above the usage meters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RemoteViews inflates only whitelisted view classes, and a plain View is
not one, so launchers showed "Can't load widget".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oesn-t-fully-populate-f4255f

Android: backup/restore, close-task fix, multi-computer widget
# Conflicts:
#	src/remote/AgentDetail.client.test.tsx
…cing

# Conflicts:
#	src/remote/AgentDetail.client.test.tsx
#	src/remote/AgentList.tsx
#	src/remote/api.ts
…roid-app-interfacing

# Conflicts:
#	src/remote/AgentDetail.client.test.tsx
BigWebstas and others added 2 commits October 4, 2026 17:05
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