* feat(mobile): show folder workspace Source Control on the phone
A folder workspace now has Source Control on the phone: one row per attached
worktree (repo, name, branch, ahead/behind, change count), read from the host
list's own lineage projection and each worktree's git.status. Tapping a row
opens that worktree's existing Source Control in place; Back returns to the list.
* fix(mobile): folder Source Control routing, back, hidden reads and failure states
- A desktop worktree under a server's folder is listed and opens with desktop routing and gates.
- A child opened in the dock gets Back to the folder list beside Close.
- Rows and the catalog stop reading while the screen is covered, as the single-worktree screen does.
- Offline, failed and missing-folder states; rows whose status can't be read say Unavailable.
- Server rows poll like the host list; branch shown without refs/heads/.
- Perf contract: git.status reads per signal at N and 10N rows.
* perf(mobile): folder Source Control reads summaries and rebuilds only on lineage changes
- Rows read a status summary without per-file line stats; relayed servers' rows open no desktop event stream.
- Membership resolves over a projection of lineage and label fields, so agent and terminal churn rebuilds nothing.
- A row whose re-read failed or whose host reported readError shows Unavailable.
- A connection still coming up shows loading, not offline.
- Perf contracts at N/10N rows and H/10H catalog rows.
* perf(mobile): folder membership keys on lineage only; child status reads update the folder list
Membership resolves again only when a row's lineage fields change, keying
only rows the catalog replaced; labels come from the current rows. A child
Source Control's newer status read is handed to the folder list's summary,
so Back shows what an action did without another read.
* fix(mobile): folder summary takes child reads as they land and ignores server health
Membership depends only on each relayed server's installation, so health
and relay flips no longer resolve the folder again. A child Source
Control hands each status read to the folder summary as it is accepted,
so a summary read answering just after can't hide it, and an older read
never replaces a newer summary failure.
* fix(mobile): folder summary skips restored and cached reads that could undo newer ones
Persisted status is marked restored before anyone hears of it, so a
child screen never hands an earlier launch's status to the folder list.
A cached read caught up on opening writes only an idle summary and never
cancels one in flight. Perf contracts count real lineage serializations,
committed row renders and summary publications.
* fix(mobile): clear the restored mark on any answer but the restore's own
A live answer timed before the stored record, as after a clock
correction, is still this launch's, so its reads and the folder summary
treat it as confirmed.
* fix(mobile): the restore's own write skips clearing its mark only once
A listener replacing restored data as it hears of it writes this
launch's answer, so the mark clears for it too.
* test(mobile): type folder Source Control test fixtures without assertions
* test(mobile): name mocked modules with type-only namespace imports
* feat(mobile): show folder worktrees as cards on the sheet surface
Each attached worktree is its own grouped card on the grey sheet
surface, the look the phone's option sheets use, so rows read apart
from the page.
* fix(mobile): keep folder Source Control's states on the card surface
Loading, empty, error and the list now share the sheet surface, so the
screen no longer changes background between states.
Review rebuilt only when a git.status read changed, so a base move that left this worktree's status as it was kept the old compare (also cached 30 s). The compare entries now take git.status's gitStatusChanged signal. A status read that lands after the signal marked the shown compare rebuilds Review without re-keying worktree diffs, and a compare read that lands marked is read again.
* fix(mobile): paint host labels and relay server rows from the phone's store on relaunch
* refactor(mobile): reuse the SSH target summary schema for stored host labels
* perf(mobile): answer a page's ready that arrived before its bridge host
A page's ready can reach the shell before the screen has built its bridge
host (the host waits on the client and the host profile read). It used to
be dropped, so init waited for the page's next retry, up to 2 s later.
Keep the latest ready per session and answer it once the host exists.
* perf(mobile): keep one prewarmed page document while Home is shown
While native Home is on screen, boot one page document for the most
recently connected host with a cached build, parked invisibly in the
window. Opening a page from that build adopts it instead of building a
WebView, which removes the WebView start and script parse from the tap.
The spare is dropped when Home is left without a claim (2 s grace), on
background, memory pressure, its own failure and before the cache deletes
its files. It is never kept beside a shown page, and only phones with
more than 3 GiB of RAM (4 GB phones) get one. A parked page is told to
stop asking for init; the adopting view answers the ready it sent.
Builds on Jinwoo's spare pool and replay work in #32203 and #32204.
Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com>
* fix(mobile): unregister the shell's memory callbacks from the context that registered them
---------
Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com>
The native shell view now hosts a MobileWebShellDocument that owns the
WebView, its scheme handler or request intercept, the network block, the
bridge and the navigation policy. The view keeps layout, the back-edge
swipe and its React events. Nothing changes for a page; this is the seam
a prewarmed spare page needs.
Based on Jinwoo's page split in #32202.
Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com>
The host stops the old agent (about 0.6 s for Claude, up to 3 s with slow
MCP servers) before it writes the divider, so the old transcript lingered.
Linear: STA-14361
* Keep inherited fork actions with the original chat
* Keep fork boundary tests aligned with inherited actions
* Keep inherited fork actions with their original chat
* Keep fork refusal tests within their typecheck projects
* Allow phone forks for supported agents beyond Claude and Codex
* Gate inherited tip forks on host original-chat support
* Require current host proof for inherited fork offers
* Bind inherited fork actions to the current host runtime
* Keep unsent browser forks definitive and offer accurate retry guidance
* Offer copied tip forks only at the fork point and name their source
* Offer forks on all completed copied replies
* Explain which original response can be forked
* perf(session-history): answer Workspace and Project from their own sessions
Workspace and Project send scopeOnly. The scanner then skips listing and parsing cwd-bucket agents (Claude, Pi, CodeBuddy) outside the scope, keeps the recency pass for the other agents but returns only its in-scope rows, and checks name-matched Claude buckets file by file when their newest transcripts name no in-scope cwd. The tab move lookup and All keep the full scan.
* test(session-history): pin that scope-only drops out-of-scope recency rows
* fix(session-history): keep every row main shows when scope-only skips bucket agents
Parse the whole recency window and keep all of its in-scope rows, bound unverified bucket files apart from confirmed ones and let their parse decide, and keep a scope's rows on screen across a depth change.
* fix(session-history): keep Pi listed for scope-only and let scoped rows stand in across scopes
OMP shares Pi's folder under PI_CODING_AGENT_DIR and Pi's listing decides which files OMP parses, so scope-only keeps listing Pi. Workspace and Project rows now stand in for any scope but All, since the renderer filter narrows them.
* fix(session-history): serve scope-only from a cached full list and NFC-fold bucket names
All and Project send the same paths, so a cached All list answers Project without a rescan. Bucket names and scope prefixes are compared NFC-folded, since CodeBuddy and Pi keep the cwd's own Unicode form.
* fix(session-history): match NFD-named buckets by encoding both Unicode forms
Claude replaces each non-alphanumeric code unit with a dash, so normalizing an encoded name can't recover an NFD cwd. Encode the NFD spelling of each scope path too, and drop the post-encoding NFC fold.
* refactor(session-history): build the scope matcher only for scope-only scans and tighten comments
Unread rows show the desktop's bell, swipe right toggles read, swipe
left clears a finished agent, and the long-press and options menus get
Mark read/unread, Unread only, Mark all read and Clear finished. Writes
go through agentActivity.setRead/clear and show optimistically until the
desktop's list confirms them.
* feat(agents): send paired phones the desktop Agents list's verdict per agent
While a phone is paired, the desktop window publishes its own Agents-list
classification for each pane (listed, status, unread, clearable, title,
worker parent) and worktree.ps attaches it to each agent row, so the phone
lists agents exactly as the sidebar does. agentActivity.setRead/clear apply
through the sidebar's own Activity actions and resolve once the new
verdicts are stored.
* feat(mobile): add an Agents tab to Home
One row per agent across every paired desktop, grouped by status, with
a desktop filter, search, group-by, nested workers and a long-press
menu. Feed's per-workspace Agents section becomes a short Needs you
list, and the needs-you badge moves to the Agents tab.
* feat(runtime): tell phones when git status changes
* fix(runtime): tell phones about HEAD and packed-refs moves too
* fix(runtime): don't let a phone's status re-read join a read begun before the change
* perf(runtime): limit status-read invalidation to the checkouts an outside change touched
* fix(runtime): match a checkout's status keys under any execution host
* fix(runtime): invalidate globally while a primary checkout is unread
* test(mobile): re-record the Changes and settings goldens on the rebased main
* fix(runtime): invalidate globally while a listed checkout has no cached path
* test: follow the moved paired-client harness
* refactor(mobile): let the host list's catalog read hold the event router
* Show CI result lines on the phone, following the desktop setting
The host now sends nativeChatCiResultLines resolved in settings.get, the
ready snapshot and a nativeChatCiResultLinesChanged event, from one
publisher that tracks each pushed chat preference separately. The phone
keeps one store per desktop connection and preference, reads the CI value
only from the paired desktop, and hides the lines until that desktop
reports one. CI rows stay in the projection and are filtered after it, so
a flip rebuilds nothing. The phone draws the line with links to the pull
request and commit.
* Let the phone CI line wrap and select like other notices
Long repository names at large font scale no longer push the commit link
past an ellipsis: the line wraps, centered, with the icon on its first
line. Its text follows the system-notice selection policy, so iOS selects
natively and Android keeps the long-press actions sheet. The CI strings
are translated in every mobile locale, the filter copies only once it
meets a CI row, and the tests drop a token assertion and a duplicate case.
* Draw CI results as one-line cards on desktop and phone
The CI result line becomes a one-line card in the same frame as the
opened pull request card, with the Hide button inline at its right end
on desktop, and in the phone's chat card frame without one. Only the
lead and pull request name truncate, so the commit link and the Hide
button stay reachable on narrow widths. The fixture uses real
percent-encoded item ids so its links render.
* Make the CI card's whole lead open its pull request
A translated lead at large font scale can push the ellipsis before
repo#N, which left no visible way to open the pull request. The
truncating segment is now the pull request's target on desktop and
phone, named for it, while "at <sha>" stays the commit's own target.
The ja, zh and zh-Hant leads use a plain colon so the space after it
isn't doubled.
* Read the CI result lines setting only for structured chats
CI result lines come only from structured sessions' journals, so a
terminal chat no longer sends the setting read. The prompt-controller
fixture stubs the setting hook: its tests count only the chat's prompt
writes, and the structured chat's one read per desktop connection is
expected.
* refactor(mobile): give relay and encryption concrete owners
* refactor(mobile): organize session and review feature owners
* refactor(mobile): organize RPC and host ownership
* test(mobile): point render fixtures at concrete owners
* refactor(mobile): use explicit type-only owner imports
* refactor: import journal queue state from defining owners
* refactor(shared): organize execution and automation owners
* fix: retain type imports used by surviving test cases
* refactor: finish work item owners and refresh validation metadata
* test: infer reconnect status fixture type
* test(claude): resolve source files beside same-named directories
* test(runtime): group repository creation mock registrations
* perf(tasks): look up the GitLab comment viewer only on phone reads
The phone is the only reader of viewerDidAuthor, so GitLab detail reads
from desktop IPC and the Checks poll skip the `glab api user` lookup.
The phone sends markViewerComments on every GitLab detail read.
Ported from #39749 (GitLab part only); GitHub REST-fallback viewer
lookup is unchanged.
Co-authored-by: AmoabaKelvin <97001695+AmoabaKelvin@users.noreply.github.com>
* perf(tasks): keep GitLab viewer marks by default; desktop detail reads opt out
Older phones and callers that omit markViewerComments keep author marks.
Co-authored-by: AmoabaKelvin <97001695+AmoabaKelvin@users.noreply.github.com>
---------
Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
Co-authored-by: AmoabaKelvin <97001695+AmoabaKelvin@users.noreply.github.com>
* chore(lint): bump oxlint to 1.91, add perf lint rules and perf audits
* fix(lint): await promises returned inside try/catch/finally for return-await
Prepare typescript/return-await with error-handling-correctness-only: await
returns whose catch or finally was meant to cover them, and suppress the eight
sites where the catch must not re-handle the returned promise.
* chore(lint): enable return-await (error-handling-correctness-only); exempt secondary-scan directives in the changed gate
* refactor(mobile): move file preview discard modal into its own module
Keeps MobileFilePreviewScreen under the 400-line limit after merging main.
---------
Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
* perf(mobile): warm WebKit's processes on iOS before the first page opens
Builds a blank, non-persistent WKWebView a second after Home has a paired
host, so the first page open starts against WebContent, GPU and Network
processes already running. A release before the delayed start now makes
the start a no-op.
Based on #32163 by Jinwoo-H.
Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com>
* fix(mobile): guard warmUp on older binaries and release the warm view on page failure
Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com>
---------
Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
Co-authored-by: Jinwoo-H <73622457+Jinwoo-H@users.noreply.github.com>
* perf(mobile): switch back to a terminal without rebuilding it
* fix(mobile): keep resume positions across terminal handle swaps
* fix(mobile): snapshot a cleared, reloaded or errored terminal instead of resuming it
* fix(mobile): cancel only resumable streams on a dropped connection and forget positions on a text-size change
* test(mobile): give the startup recording its catch-up read
* test(mobile): give terminal webview harnesses the resume state
* fix(runtime): end resume for a stream that saw its coverage reset while live
* feat(mobile): offer to restore unsaved file and markdown edits
* fix(mobile): keep offered edits through other discards and clear saved Markdown drafts
* fix(mobile): offer a copy of edits to a now read-only document and key drafts by host
* refactor(mobile): one guard for the draft save effect
* fix(mobile): clear an offer once its edits are saved by hand
* feat(mobile): keep automation drafts across kills
* fix(mobile): drop a created automation's draft on affirm and restore saved fields under typed ones
* fix(mobile): stop saving an automation draft after it is dropped
* fix(mobile): reopen the automation editor with in-memory edits while the store can't be read
* refactor(mobile): one rule for which automation draft fields changed
* perf(runtime): push worktree row changes; host list poll becomes a 10 s backstop
* fix(runtime): announce title-only agent status changes and gate the rows capability with the switch
* fix(mobile): keep event reads a floor apart while a read is out; announce a retired title clear
* test(runtime): assert the rows notice without counting events
* feat(mobile): keep screen data on the phone between launches
* feat(mobile): keep the repo list snapshot id across launches
* fix(mobile): don't read a key again that the boot read just found empty
* fix(mobile): late-restored strips, revocation fence and reads never built on stored data
* test(mobile): give the session startup recording the late strip watch
* fix(mobile): remember Workspace options, keep the revocation fence until reauth, store no terminal output
* test(mobile): give the view settings recording its remember hook
* docs(mobile): say what a restored key means to a fetch
* style(mobile): format host-query after rebase onto Q11
* refactor(main): organize runtime implementation owners
* test: retire wall-clock CLI title recovery case
* refactor: route new folder mutation to runtime store owner
* test: import folder mutation store contract from its owner
* perf(mobile): open the PR tab with its last state and refresh only what a write changed
* fix(mobile): allow the phone's comment re-read and settle review findings
* fix(mobile): keep PR reads current across path switches and overlapping writes
* refactor(mobile): share PR query keys and simplify PR write rollbacks
* chore(mobile): list every PR action and comment write kind explicitly
* fix(mobile): read the push-time PR reread through an effect event
* fix(mobile): report a comment write interrupted by a path switch as unconfirmed
* fix(mobile): settle a comment write whose reply was lost from the re-read comments
* style(mobile): format host-query after rebase onto Q12
* perf(mobile): show the last task list per filter while it refreshes
* perf(mobile): read Tasks repos six at a time
* fix(mobile): hold Tasks paging while kept rows re-read
* test(mobile): pin Tasks paging held during a query switch
* perf(mobile): read Tasks repos four at a time, the desktop's gh limit
* test(mobile): give the Linear connect recording the revalidating input
* perf(mobile): open Tasks on its kept hydration and lists through host query families
* fix(mobile): keep the desktop's newer Tasks state and only cancel screen-read queries
* fix(mobile): type the Jira refresh harness and Tasks list read for CI
* feat(runtime): confirm a structured chat send by clientMessageId past the first journal page
* fix(mobile): ask the send's own chat before handing it back
* fix(mobile): read send-recorded support when the deadline fires and settle rows that land mid-lookup