Repository navigation
feat(mobile): pickers, workspace parity, active-workspace focus, tap-to-open, source-control parity, artifact viewing - #5330
Conversation
Add an image-attach button beside the dictation mic in the terminal command bar. Tapping it opens a Photo Library / Browse Files action sheet; the picked image is uploaded to the host as a temp file and its bracketed path is pasted into the active terminal — the same payload desktop image paste sends, so TUI agents attach it identically. Works for SSH/remote sessions via the active worktree connectionId. Reuses the existing clipboard-image upload pipeline (no new RPC methods). Adds expo-image-picker and expo-document-picker, the iOS photo-library permission, and unit tests for the picker and the upload/send pipeline. Co-authored-by: Orca <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds mobile image attachment support, terminal file-path tap detection with RPC resolution, worktree inline agent row display, and mobile git features. The image attachment flow introduces picking from the photo library or file browser, converts selected assets to base64, saves them as temporary clipboard files, and sends bracketed file paths to the active terminal. A new React hook handles session state guards and toast-based error messaging. Terminal file-tap detection identifies taps on file paths in terminal output by scanning line text with regex, trimming punctuation, and checking column position; tapped paths are resolved via a new RPC method that converts them to worktree-relative paths and checks existence before opening non-directory files. The agent display feature extends the runtime to retain per-pane agent-status snapshots, attaches them to worktree summaries with lineage parent resolution and sorting by state start time, and renders them on mobile as depth-indented agent rows with rotating state indicators, display labels, and relative timestamps. The host screen integrates an agent list component alongside updated worktree metadata for linked issues and comments, with periodic timestamp refreshes and auto-scroll support via new hooks. Additionally, branch checkout and local branch listing operations are added across local and SSH-backed worktrees, and mobile git features include commit history display with lazy-loaded file changes, AI-assisted commit message generation, PR composition with field generation, and a source control action builder that computes dynamic action eligibility and labels. |
Bring the mobile workspace list to 1:1 parity with the desktop sidebar for displayed info. Each worktree now renders its inline agents — per agent: state dot, identity, last message/prompt, and a live relative timestamp — nested by spawn lineage, plus linked PR state color and notes/Linear/GitLab/issue presence glyphs, and bold-until-visited. The rich per-agent data lived only in the desktop renderer's store; the main process (which serves mobile via worktree.ps) discarded the parsed OSC 9999 payload after forwarding it. Retain the latest payload per pane in the main process and extend worktree.ps to send per-agent rows + the remaining meta, then rebuild the mobile row to consume it. Deferred: prompt-cache timer and git conflict/rebase badge (not cheaply reachable from the main process). - main: latestAgentStatusByPaneKey retains the per-pane payload, cleared on pty teardown; attachAgentRowsToSummaries groups + resolves lineage. - shared: RuntimeWorktreeAgentRow + extended RuntimeWorktreePsSummary. - mobile: pure lineage/display modules (unit-tested), AgentStateDot, WorktreeAgentRow/List, WorktreeMetaGlyphs, useNow tick. Tests: runtime worktree.ps agent attachment; mobile lineage + display helpers. Root + mobile typecheck/lint/test all green. Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
mobile/src/components/WorktreeAgentRow.tsx (1)
12-12: 💤 Low valueConsider adding a comment explaining the indent value.
The
INDENT_PER_DEPTH = 14constant lacks context about why 14 pixels was chosen. As per coding guidelines, non-obvious constraints should be commented.📝 Suggested comment
+// Why: 14px indent per depth level provides clear visual hierarchy on mobile +// screens without consuming excessive horizontal space for nested agents. const INDENT_PER_DEPTH = 14Source: Coding guidelines
mobile/src/components/WorktreeAgentList.tsx (1)
15-29: ⚡ Quick winMemoize the lineage flattening to avoid redundant computation.
flattenAgentRowLineage(agents)runs on every render, including when onlynowchanges (every 30 seconds). Since the flattened structure depends solely onagents, memoizing it will prevent unnecessary tree traversals.⚡ Proposed optimization
+import { useMemo } from 'react' import { StyleSheet, View } from 'react-native' import type { RuntimeWorktreeAgentRow } from '../../../src/shared/runtime-types' import { flattenAgentRowLineage } from '../worktree/agent-row-lineage' import { WorktreeAgentRow } from './WorktreeAgentRow' type Props = { agents: RuntimeWorktreeAgentRow[] now: number unvisited: boolean } // Inline agent list for one worktree row: flattens the spawn lineage and renders // a depth-indented WorktreeAgentRow per agent, mirroring the desktop sidebar's // WorktreeCardAgents. export function WorktreeAgentList({ agents, now, unvisited }: Props) { + const nodes = useMemo(() => flattenAgentRowLineage(agents), [agents]) + return ( <View style={styles.list}> - {flattenAgentRowLineage(agents).map((node) => ( + {nodes.map((node) => ( <WorktreeAgentRow key={node.row.paneKey} agent={node.row} depth={node.depth} now={now} unvisited={unvisited} /> ))} </View> ) }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6a9da54f-c6b5-467f-9860-f02a14793ab6
📒 Files selected for processing (13)
mobile/app/h/[hostId]/index.tsxmobile/src/components/AgentStateDot.tsxmobile/src/components/WorktreeAgentList.tsxmobile/src/components/WorktreeAgentRow.tsxmobile/src/components/WorktreeMetaGlyphs.tsxmobile/src/hooks/use-now.tsmobile/src/worktree/agent-row-display.test.tsmobile/src/worktree/agent-row-display.tsmobile/src/worktree/agent-row-lineage.test.tsmobile/src/worktree/agent-row-lineage.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/shared/runtime-types.ts
✅ Files skipped from review due to trivial changes (1)
- mobile/src/hooks/use-now.ts
When a workspace is focused on the desktop, the mobile list now scrolls that row into view and highlights it, so mobile reflects the desktop's current selection. - main/shared: add isActive to RuntimeWorktreePsSummary, set from session.activeWorktreeId in worktree.ps (resolved via the same helper as tabsByWorktree so SSH/remote path-projected ids match). - mobile: highlight the active row (raised fill + left accent) and scroll it into view on active-id change via useActiveWorktreeScroll (fires only on change; retries on scrollToLocation failure for not-yet-measured variable-height rows). - Extract the worktree row into WorktreeListRow to keep the screen under max-lines (no lint disable). Test: worktree.ps marks the active worktree. Root + mobile typecheck/lint/test all green. Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: cb69db54-4e52-4164-950d-7151bcefb125
📒 Files selected for processing (6)
mobile/app/h/[hostId]/index.tsxmobile/src/components/WorktreeListRow.tsxmobile/src/hooks/use-active-worktree-scroll.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/shared/runtime-types.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/shared/runtime-types.ts
- src/main/runtime/orca-runtime.test.ts
- src/main/runtime/orca-runtime.ts
On desktop you Cmd/Ctrl-click a file path an agent printed in the terminal to open it. Mobile had no equivalent — a tap only focused the input. Now tapping a detected file path opens it in the in-app file viewer; tapping elsewhere still focuses input (unchanged). - WebView: detect the file-path span under the tapped cell (regexes ported from the desktop terminal-links detector) and emit a terminal-file-tap message; the detection JS lives in terminal-path-tap-injected.ts and mirrors the unit-tested pure module terminal-path-tap.ts. - Host: new files.resolveTerminalPath RPC resolves the tapped text against the terminal cwd + worktree root (shared cross-platform-path helpers, SSH-safe) → worktree-relative path + existence. - RN: onFileTap resolves then opens via the existing files.open + fetchSessionTabs flow, so the file shows as a tab in the FileReader. Misses (non-file / outside worktree / directory) silently no-op. Tests: pure path-tap detection (column hit/miss, line:col, trims); resolveTerminalPath resolution (absolute/relative/cwd/outside/missing/ directory) + RPC dispatch. Root + mobile typecheck/lint/test all green. Deferred: scroll-to-line:col in the viewer (line/col plumbed, unused); OSC 8 hyperlinks; open-on-desktop; directory browse. Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/main/runtime/rpc/methods/files.test.ts (1)
287-317: ⚡ Quick winAdd one negative/normalization case for
files.resolveTerminalPathschema behavior.This test covers the happy path, but adding a case for omitted/empty
cwdand empty/missingpathTextwould lock the RPC input-contract behavior and prevent silent regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d3d79676-f346-4d02-a5f5-a33731c1d71b
📒 Files selected for processing (15)
mobile/.oxlintrc.jsonmobile/app/h/[hostId]/session/[worktreeId].tsxmobile/src/session/TerminalPaneView.tsxmobile/src/terminal/TerminalWebView.tsxmobile/src/terminal/terminal-path-tap-injected.tsmobile/src/terminal/terminal-path-tap.test.tsmobile/src/terminal/terminal-path-tap.tsmobile/src/terminal/terminal-webview-scroll-routing.test.tssrc/main/runtime/orca-runtime-files.test.tssrc/main/runtime/orca-runtime-files.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/files.test.tssrc/main/runtime/rpc/methods/files.tssrc/main/runtime/runtime-rpc.tssrc/shared/runtime-types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/shared/runtime-types.ts
| const response = await client.sendRequest( | ||
| 'files.resolveTerminalPath', | ||
| { worktree, pathText }, | ||
| { timeoutMs: 10_000 } |
There was a problem hiding this comment.
Forward terminal cwd when resolving tapped relative paths.
Line 2608 calls files.resolveTerminalPath without cwd. The runtime resolver uses cwd ?? worktree.path, so relative tokens from subdirectories are resolved against repo root and can silently miss. Please thread cwd through the onFileTap payload and include it in this request.
Proposed direction
- const handleFileTap = useCallback(
- (handle: string, pathText: string) => {
+ const handleFileTap = useCallback(
+ (handle: string, pathText: string, cwd?: string | null) => {
if (handle !== activeHandleRef.current || !client) {
return
}
void (async () => {
try {
const worktree = `id:${worktreeId}`
const response = await client.sendRequest(
'files.resolveTerminalPath',
- { worktree, pathText },
+ { worktree, pathText, cwd: cwd ?? undefined },
{ timeoutMs: 10_000 }
)Close the remaining gaps between the mobile source-control screen and the desktop right-sidebar, across three cost buckets. Bucket A (UI only, already-allowlisted RPCs): - Abort merge/rebase from the conflict banner (git.abortMerge/abortRebase). - Rebase-onto-base and Fast-forward entries in the action sheet (git.rebaseFromBase/fastForward). Bucket B (allowlist + UI): - AI commit-message generation: a Sparkles button by the commit input calls git.generateCommitMessage with graceful fallback + cancel, matching desktop. - Commit history: a new /history route lists commits (git.history) and expands each to its changed files with +/- stats (git.commitCompare). Bucket C (new host method + allowlist + UI): - PR creation: a compose sheet (title/body/base/draft, AI prefill via git.generatePullRequestFields) submits hostedReview.create and offers open-in-browser. The previously hard-disabled buttons now work. - Branch checkout: NEW git.checkout + git.localBranches host methods (local helper, SSH provider + relay handler, runtime, RPC) drive a branch picker that switches to an existing local branch. Allowlist: adds the git AI/history/checkout + hostedReview methods. Refactor: the action-sheet list moves to a pure, unit-tested builder (mobile-source-control-actions.ts) with string icon keys resolved in the screen; new pure modules for commit-message AI, PR create, and history mappers — all unit-tested. Tests: host git.checkout/localBranches (runtime dual-path + RPC dispatch + relay functional), mobile pure modules. Root + mobile typecheck/lint/ test all green. Deferred: branch create/force-checkout; per-file line diffs in history (file list + stats only); commit-model picker; stash/amend. Co-authored-by: Orca <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (4)
mobile/.oxlintrc.json (1)
37-37: 🏗️ Heavy liftAvoid raising the
max-linesbudget; split the source-control screen instead.Increasing this cap weakens the lint guardrail and makes future growth easier to slip in. Prefer extracting focused subcomponents/hooks from
app/h/*/source-control/*.tsxand keep the stricter threshold.As per coding guidelines, “Never add a
max-linesdisable comment … Split the file, extract focused modules … or otherwise reduce the counted lines instead.”Source: Coding guidelines
mobile/src/source-control/mobile-git-history.test.ts (1)
56-61: ⚡ Quick winAdd direct tests for
fetchMobileGitHistorysuccess and error mapping.This file currently validates mapping/formatting but misses the new RPC fetch helper’s key branches (
response.ok === true/false). A small mocked-client test here would lock down thrown error messaging and result passthrough.mobile/app/h/[hostId]/history/[worktreeId].tsx (1)
34-35: ⚡ Quick winDocument the
'loading'sentinel contract forfilesById.This union state is non-obvious; add a short “why” comment so future edits preserve the lazy-load/cache behavior.
As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”
Also applies to: 62-63
Source: Coding guidelines
mobile/src/source-control/mobile-commit-message-ai.test.ts (1)
38-67: ⚡ Quick winAdd a malformed-result regression test for failure fallback mapping.
Please add a case for
{ success: false }(withouterror) so the fallback string behavior stays locked in.Suggested test case
it('maps a host failure result to { success:false }', async () => { @@ }) + + it('falls back to a default error for malformed failure payloads', async () => { + const client = clientWith([ok({ success: false })]) + await expect(requestMobileCommitMessage(client, 'wt-1')).resolves.toEqual({ + success: false, + error: 'No commit message generated' + }) + })
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 92872b62-2883-4ab7-83da-8a4e0279ff82
📒 Files selected for processing (25)
mobile/.oxlintrc.jsonmobile/app/h/[hostId]/history/[worktreeId].tsxmobile/app/h/[hostId]/source-control/[worktreeId].tsxmobile/src/components/MobilePrComposeSheet.tsxmobile/src/source-control/mobile-commit-message-ai.test.tsmobile/src/source-control/mobile-commit-message-ai.tsmobile/src/source-control/mobile-git-history.test.tsmobile/src/source-control/mobile-git-history.tsmobile/src/source-control/mobile-pr-create.test.tsmobile/src/source-control/mobile-pr-create.tsmobile/src/source-control/mobile-source-control-actions.test.tsmobile/src/source-control/mobile-source-control-actions.tssrc/main/git/checkout.tssrc/main/providers/ssh-git-provider.tssrc/main/providers/types.tssrc/main/runtime/orca-runtime-git.test.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/main/runtime/runtime-rpc.tssrc/relay/git-handler.test.tssrc/relay/git-handler.tssrc/shared/runtime-types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/shared/runtime-types.ts
Reviewing agent artifacts on mobile was text-only — opening a file worked (terminal tap, agent file tabs), but the viewer rendered every binary/visual artifact as 'Binary preview unavailable'. Add the two highest-impact artifact types to the file viewer. Tier 1 — images (png/jpg/jpeg/gif/webp/bmp/ico/svg): the host already returns base64 via files.readPreview; allowlist it for mobile, fetch it for image paths, and render an <Image> (data URI) with pinch-zoom. Tier 2 — HTML (.html/.htm): render in a sandboxed WebView with a Preview/Source toggle. Navigation is locked — only the inline document loads in place; a tapped link opens in the system browser so a page can't hijack the review surface. - runtime-rpc.ts: allowlist files.readPreview (method already existed). - mobile-artifact-kind.ts: pure classifier (image/html/other) + tests. - FileDocState: add image/html ready variants; readFileTab routes images to files.readPreview, html to files.read. - FileReader: image + html render branches; html 'Source' reuses the existing syntax view. - MobileHtmlPreview.tsx: the navigation-locked WebView. Test: artifact classifier (extensions, case, dotfiles). Root + mobile typecheck/lint/test all green. Deferred: PDF (host returns pdf base64; needs a mobile PDF renderer); CSV tables; mermaid; inline images in rendered markdown; opening an image from the file browser (desktop-driven tab semantics). Co-authored-by: Orca <[email protected]>
Mobile voice dictation worked, but only after you enabled dictation AND downloaded a speech model at the desktop. Now both can be done from the phone: tapping the mic while unconfigured opens a setup sheet to download a model and turn dictation on. Dictation always runs on the paired desktop (verified: startMobileDictation uses getSpeechModelManager(this.store) — the local store; speech does NOT route to a worktree's SSH host), so setup unambiguously targets that desktop with no per-host branching. Host (3 new RPCs, no streaming — progress is polled): - speech.models.list: catalog joined with live download/ready state + enabled flag + selected model. - speech.models.download: fire-and-forget downloadModel; mobile polls list for progress (ModelManager writes progress into per-model state). - speech.dictation.setup: merge-write voice.enabled / voice.sttModel (preserves other voice fields). All three allowlisted. Mobile: - mobile-dictation-setup.ts: pure RPC wrappers + state helpers (in-flight / ready / setup-required error detection), unit-tested. - MobileDictationSetupSheet.tsx: model list (size, recommended, status), Download with progress poll, Enable toggle, Use-model. - The mic's onError opens the sheet on voice_dictation_disabled / voice_model_not_selected / voice_model_not_ready:* instead of a dead-end toast. Tests: speech RPC dispatch (list/download/setup); mobile setup module. Root + mobile typecheck/lint/test all green. Out of scope: OpenAI-API STT setup (needs a desktop API key, not a download); model deletion; download cancel from mobile. Co-authored-by: Orca <[email protected]>
Host:
- resolveTerminalPath: ~/ paths are home-relative — expand against
os.homedir() locally, and don't mis-resolve on remote worktrees
(home unknown) → treat as not-openable instead of resolving under cwd.
- resolveTerminalPath: stop collapsing every remote stat failure into
exists:false; only definite not-found maps to empty, transport/
permission errors rethrow so remote tap-to-open doesn't silently die.
- git.checkout: validate branch name (reject option-like tokens) in the
local helper and the relay handler, and pass a trailing '--' so a
branch can never be parsed as a flag. Defense-in-depth beyond the RPC
schema (the relay entrypoint is independently reachable).
Mobile:
- flattenAgentRowLineage: a cyclic component coexisting with a normal
root was dropped; now any unvisited rows are surfaced as depth-0.
- terminal path tap: match backslash separators (Windows paths) in the
injected regex; reject trailing '\' as directory-only; parity in the
canonical module.
- AI commit message: coerce malformed { success:false } payloads to a
non-empty error string (contract guarantee).
- commit history: nullish-check the timestamp so epoch-0 still formats.
- history screen: reset stale error/rows before each fetch so a
successful retry isn't masked by a prior error.
- PR compose sheet: depend on prefill fields, not object identity, so a
parent rerender doesn't wipe in-progress edits.
- PR create: derive provider/base/title/body from hosted-review
eligibility (resolveMobilePrPrefill) instead of hardcoding 'github' —
non-GitHub repos (GitLab) now get the right provider.
- active-worktree scroll retry: bail if the active selection changed
during the deferred retry (avoid a brief scroll to a stale row).
Tests for each fix. Root + mobile typecheck/lint/test all green.
Co-authored-by: Orca <[email protected]>
- mobile-artifact-kind: drop 'svg' from image extensions — RN <Image>
can't decode svg data URIs, so .svg now falls through to the text path
and renders as (meaningful) XML source instead of a blank image.
- WorktreeAgentList: useMemo the lineage flatten so the spawn tree is
rebuilt only when the agent list changes, not on every useNow tick.
- git checkout: correct the misleading '--' comments (the startsWith('-')
guard prevents flag injection; '--' just marks no pathspecs follow).
Code unchanged — 'checkout <branch> --' switches; '-- <branch>' would
wrongly treat it as a path.
- orca-runtime-git: reference the named RuntimeGitCheckoutResult /
RuntimeGitLocalBranches return types (the former was unused) to prevent
drift from the inline shapes.
- configureMobileDictation: clarify (and keep) the '' guard — an empty
modelId clears the selection and must not throw voice_model_unknown.
Root + mobile typecheck/lint/test all green.
Co-authored-by: Orca <[email protected]>
git.generateCommitMessage is now mobile-allowlisted (AI commit message feature), so it no longer exercises the forbidden-method gate. Switch the assertion to files.delete — a registered RPC intentionally kept off the mobile allowlist. Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
…/e2ee" This reverts commit dea796a.
|
These changes are amazing thank you |
…image-picker-gallery-files
Mobile's typecheck reaches remote-runtime-client.ts transitively (runtime-types -> shared-control-types -> remote-runtime-client) only for the RemoteRuntimeClientError type, but that file value-imports ws and e2ee-crypto (tweetnacl). The mobile CI job installs only mobile/ deps, so typechecking those Node-only files fails with TS2307 for ws/tweetnacl. Move the error class to remote-runtime-client-error.ts (no ws/tweetnacl), re-export it for existing value importers, and point the type-only shared-control consumers at the new module. Severs the mobile -> ws chain; desktop/CLI value importers are unchanged. Co-authored-by: Orca <[email protected]>
An agent that exits without a final status report previously read as Working/Blocked/Waiting forever on mobile. Apply the same staleness decay desktop does in its sidebar renderer: when an active state is older than AGENT_STATUS_STALE_AFTER_MS (30m), show it as idle. Done/interrupted are never decayed. The shared useNow tick re-evaluates rows every 30s, so a hung agent settles to Idle without interaction. Co-authored-by: Orca <[email protected]>
A runtime-value import of AGENT_STATUS_STALE_AFTER_MS from the root .ts broke mobile's vitest transform (no tsconfig resolvable for root files in the mobile-only checkout); root type-only imports are unaffected. Inline the 30-min threshold with a comment pointing at the shared source of truth. Co-authored-by: Orca <[email protected]>
…image-picker-gallery-files # Conflicts: # mobile/.oxlintrc.json # mobile/src/session/TerminalPaneView.tsx # mobile/src/terminal/TerminalWebView.tsx
…image-picker-gallery-files
- Image attach: surface an isAttaching spinner on the ImagePlus button while the picked image uploads (3-5s) so it no longer looks like a no-op. - Android keyboard: switch softwareKeyboardLayoutMode to pan so the OS stops resizing the window underneath the app's own translateY keyboard lift, which double-compensated and pushed the input bar / add-image button off-screen. - Agent rows: render the real agent identity logo (MobileAgentIcon) instead of a two-letter text code, matching the desktop sidebar. - Project icons: render the repo's actual icon (lucide/emoji/image via new MobileRepoIcon) from repo.list's repoIcon instead of a bare colored dot, matching desktop. Falls back to the dot when no icon is set. Co-authored-by: Orca <[email protected]>
The project icon fell back to a colored dot when a repo had no custom repoIcon, but desktop's RepoIconGlyph renders a Folder glyph by default in that case. Always render MobileRepoIcon (which defaults to Folder) in the worktree row and repo section header so a project shows a folder, not a dot. Co-authored-by: Orca <[email protected]>
… revert - Host: agent status mostly arrives via hooks (agent-hooks/server → IPC), not OSC terminal output, so the OSC-only snapshot path left worktree.ps with no agents. Feed latestAgentStatusByPaneKey from the hook listener too via new retainAgentRowSnapshotFromHook — mobile now shows the same inline agent rows the desktop sidebar does. Verified by unit test + live device inspection. - Mobile: render the repo glyph (Folder default, matching desktop's RepoIconGlyph) instead of a colored dot; omit the redundant per-row repo icon+name when the list is already grouped under that repo's section. - Mobile: revert the Android softwareKeyboardLayoutMode=pan change — it double-compensated with the app's own translateY lift and pushed the input bar too far up. adjustResize (the original) is correct. Co-authored-by: Orca <[email protected]>
Agent status mostly arrives via the agent-hooks server, not OSC terminal output, so the OSC-only snapshot left mobile's worktree.ps with no agents. Inject agentHookServer.getStatusSnapshot() into the runtime and read it at query time in attachAgentRowsToSummaries — the same source the desktop sidebar reads, so mobile shows the same inline agent rows. Replaces the earlier listener-callback approach, which no-op'd when the hook replay fired before the runtime was assigned. Co-authored-by: Orca <[email protected]>
- Active terminal tab + active worktree row now use a neutral grey accent (textSecondary) instead of a blue line, matching the desktop terminal tab's muted indicator. - Image attach: tapping the icon opens the photo library directly (one tap, like Discord) instead of a custom source drawer; long-press attaches a file. Removes the intermediate ActionSheet drawer entirely, which also resolves the drawer-not-growing-with-keyboard issue (no drawer to mis-size). Co-authored-by: Orca <[email protected]>
Replace the workspaces list's local AsyncStorage view preferences with the desktop's shared PersistedUIState via ui.get/ui.set, so group-by, sort-by, hide-sleeping, hide-default-branch, the projects filter, and collapsed groups stay in sync bi-directionally between phone and desktop. Reads on connect and on screen focus; writes optimistically on change. - New workspace-view-settings.ts: bidirectional mapping between mobile's local model and desktop's PersistedUIState (group/sort enums, partial-apply). - New workspace-list-sections.ts: extracted the section/sort/filter transforms (keeps index.tsx under its line pin); filter is now desktop's model (filterRepoIds by repo id + hideSleeping + hideDefaultBranch). - Pinning is unchanged (still worktree.set + local pin cache). Card layout + show-properties deferred (need a ui.set schema addition). Co-authored-by: Orca <[email protected]>
New Settings -> Voice page with the same 3 controls as desktop's VoicePane: enable dictation, dictation mode (toggle/hold), and the speech-model list (download with progress, select, recommended badge, size). Talks to the paired desktop over the existing speech.* RPCs. - Host: speech.dictation.setup + configureMobileDictation now accept dictationMode, and RuntimeSpeechSetupState reports it, so the page can read and write the toggle/hold preference. - Mobile: voice-settings.tsx screen + VoiceModelList component, reusing the mobile-dictation-setup helpers (and matching MobileDictationSetupSheet's row UI). Polls speech.models.list while a download is in flight. Model deletion (desktop has it) deferred — no mobile RPC yet. Co-authored-by: Orca <[email protected]>
worktree.ps defaults to a 200-row cap and silently truncates; mobile passed no limit so large hosts dropped workspaces with no indication. Pass limit: 10000 to match the desktop's cap. Co-authored-by: Orca <[email protected]>
|
Ready to review this PR? Stage has broken it down into 13 individual chapters for you: Chapters generated by Stage for commit ca41655 on Jun 16, 2026 4:51am UTC. |
Tapping a file path in the terminal did nothing for bare filenames (e.g. an agent printing README.md): the detection regex required a slash, so a bare filename was never proposed. Desktop matches bare filenames too and lets the host existence-check reject non-files — mirror that by also matching a filename-with-extension token. The tap handler already resolves via files.resolveTerminalPath and only opens when the file exists, so false positives open nothing. Co-authored-by: Orca <[email protected]>
- Show the branch without the refs/heads/ prefix, matching the desktop sidebar (WorktreeCardHelpers). - Stop surfacing a plain terminal's shell-output tail as a row preview line; only agents get a secondary activity line, like desktop. The shell prompt (e.g. 'jinwoohong ~/orca/...') was leftover preview logic. Co-authored-by: Orca <[email protected]>
The home screen's host summary (worktree count + active count) also called worktree.ps without a limit, capping at 200. Pass limit: 10000 like the workspaces list so the count is accurate. Co-authored-by: Orca <[email protected]>
- Register voice-settings with headerShown:false so the native route header (showing 'voice-settings') is gone — only the in-page 'Voice' header remains, matching the other settings sub-pages. - Speech model picker moves into a BottomDrawer opened from a summary row (Speech Model: <selected> >), matching the terminal-settings picker pattern, instead of a long inline list. - Download action is now an icon-only button. Co-authored-by: Orca <[email protected]>
- Tapping an .html path in the terminal now opens it as a browser tab (file:// URL via browser.tabCreate, streamed from the desktop), matching desktop's terminal-click behavior, instead of a plain file view. Needed the absolute path, so resolveTerminalPath now returns absolutePath. - Non-HTML file taps: the desktop creates the file tab asynchronously and a single poll could race it, so refresh session tabs a few times after files.open to reliably surface and switch to the new tab (the file browser got this for free via router.back). Co-authored-by: Orca <[email protected]>
When a tapped .html opens a browser tab, focus it on mobile as soon as it syncs — track the new browser tab by its page id (from browser.tabCreate) and select it in applySessionTabs regardless of the desktop's active flag (which can lag the create). Also read browserScreencastSupported via a ref so a tap that fires before the capability probe resolves still sees the live value (otherwise it wrongly showed the 'desktop update required' toast). Co-authored-by: Orca <[email protected]>
The home Resume card's per-host fallback picked active[0] (or worktrees[0]) — effectively arbitrary list order, so a cold launch showed a random workspace. Pick the desktop-focused worktree (worktree.ps marks exactly one isActive), falling back to most-recent output, then first. Extracted as the tested pickResumeWorktree helper. (Also includes the browser-tab focus via the normal switchSessionTab path + tap-to-open haptic from the prior change.) Co-authored-by: Orca <[email protected]>
Mobile writes workspace view-state (group/sort/filters/collapsed groups) to the shared PersistedUIState via the ui.set RPC, but the desktop renderer hydrates UI state once and never learned of external changes — so a mobile 'hide sleeping' toggle persisted yet didn't show on desktop until reload. Mirror the settings:changed pipeline: the store fires onUIChanged from updateUI, main broadcasts ui:stateChanged to all windows, and the renderer re-hydrates via hydratePersistedUI. Now mobile->desktop view-state sync is live and bi-directional (desktop->mobile already worked via mobile's focus re-read). Co-authored-by: Orca <[email protected]>
The mobile session snapshot only emitted browser tabs that belonged to a laid-out group, so a CLI/RPC-created browser tab (e.g. an HTML file opened from the mobile terminal, created in the background with activate:false) was never published to mobile — it opened on desktop but no tab appeared on the phone. After the group projection, append any remaining browser workspace so mobile sees every browser tab on the worktree, the way it already sees every terminal. Co-authored-by: Orca <[email protected]>
Replace the append-leftover-browser-tabs hack with a proper fix: thread an 'activate' flag through browser.tabCreate so a user-initiated open (mobile tapping an HTML path / address bar) foregrounds the tab in the active group. It then flows through the normal mobile session projection in the right place (to the right of existing tabs) instead of being tacked on at the end — which had made a newly-created terminal appear to the LEFT of the browser. Agent and automation opens keep activate:false (no focus stealing). Also adds the onStateChanged ui-api mock to useIpcEvents tests (missing since the UI-state-sync change). Co-authored-by: Orca <[email protected]>
The active-row highlight waited for the next worktree.ps poll to reflect a workspace the user just opened, so it lagged ~a second behind the navigation. Optimistically mark the opened worktree active locally on open, and clear the override once the host's worktree.ps confirms it. Co-authored-by: Orca <[email protected]>
The Settings ▸ Voice ▸ Dictation Mode control was shown on mobile but the mic button was hardcoded to toggle (tap to start, tap to stop). Read the configured mode and, when set to 'hold', drive the button press-and-hold (onPressIn starts, onPressOut stops) like a walkie-talkie; 'toggle' keeps tap-to-start/stop. The mode is re-read on screen focus so a change in Settings takes effect on return. Co-authored-by: Orca <[email protected]>
…uild 1) The ui.onStateChanged addition referenced PersistedUIState in the preload and web preload API without importing/implementing it, failing the typecheck verify job. Import the type in src/preload and add a noop onStateChanged to the web client (which re-reads UI state via ui.get rather than receiving main-process pushes). Also bump the mobile app version to 0.0.14 with iOS build 1. Co-authored-by: Orca <[email protected]>
…to-open, source-control parity, artifact viewing (stablyai#5330) Co-authored-by: Orca <[email protected]>
This PR bundles seven mobile improvements.
1. Attach images from photo library or files
ImagePlus button in the terminal command bar → Photo Library / Browse Files; the picked image uploads to the host and pastes its bracketed path into the active terminal (desktop-paste payload; SSH-safe).
2. Workspace list: desktop-parity agent info
Per-worktree inline agents (state dot, identity, last message, live timestamp) nested by spawn lineage, plus PR-state color, notes/Linear/GitLab/issue glyphs, bold-until-visited. Main process retains the OSC 9999 payload;
worktree.pssends per-agent rows.3. Highlight + scroll to the desktop-active workspace
The mobile list scrolls the desktop-focused worktree into view and highlights it (
isActivefromsession.activeWorktreeId).4. Tap a file path in the terminal to open it
Tapping a detected path opens it in the in-app viewer; a new
files.resolveTerminalPathRPC resolves it against the terminal cwd + worktree root.5. Source-control parity with the desktop right sidebar
Conflict abort + rebase/fast-forward; AI commit message; a
/historyroute; PR creation (compose sheet, AI prefill,hostedReview.create); branch checkout via newgit.checkout+git.localBranches.6. View image and HTML artifacts (not just source)
Images render as a pinch-zoomable
<Image>(files.readPreview, now allowlisted); HTML renders in a sandboxed WebView with a Preview/Source toggle and locked navigation.7. Enable + download voice dictation from the phone
Dictation worked only after enabling it AND downloading a model at the desktop. Now tapping the mic while unconfigured opens a setup sheet to download a model (with live progress) and enable dictation — all from mobile. Dictation always runs on the paired desktop (speech doesn't route to a worktree's SSH host), so setup targets that desktop unambiguously.
speech.models.list(catalog + live state),speech.models.download(fire-and-forget; progress polled),speech.dictation.setup(merge-write enabled/model) — all allowlisted, no streaming.MobileDictationSetupSheet+ a pure setup module; the mic's error path opens the sheet instead of a dead-end toast.Testing
pnpm typecheck(root) + mobiletsc --noEmitpnpm lint(root) +pnpm --dir mobile lintpnpm --dir mobile test— full suite green, incl. new path-tap, agent-lineage/display, source-control, artifact-classifier, and dictation-setup testsNot verifiable in CI (needs a device/simulator + paired desktop)
Native pickers/permission (1); live agent rows + highlight/scroll (2, 3); tap-to-open (4); conflict abort / AI commit / history / PR / checkout (5);
<Image>+ HTML WebView render (6); the dictation setup sheet driving a real model download + enable (7).