Commit Graph
639 Commits
Author SHA1 Message Date
OrcaWinandOrcaWin 4a5e10223d fix(editor): highlight Justfile recipes and mobile HCL assignments (#35573)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 21:39:54 -07:00
OrcaWinandOrcaWin 646eeef55a fix(mobile): release metadata for retired terminals (#35535)
* fix(mobile): prune metadata for retired terminal handles

* test(mobile): give the terminal-inventory recording adapter the pruned caches

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 21:31:29 -07:00
OrcaWinandOrcaWin c84cca5ce1 fix(mobile): retire closed-tab composer state (#35589)
* fix(mobile): retire closed-tab composer state

* Require confirmed tab retirement before composer cleanup

* fix(mobile): keep drafts of tabs the host has not listed yet

Optimistically created tabs can precede their host listing, so an accepted inventory without them must not retire their composer state.

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 21:15:56 -07:00
OrcaWinandOrcaWin c8f22c9dcb perf(mobile): skip model projection after discovery owner retires (#35540)
* perf(mobile): skip model projection for retired discovery owners

* test(mobile): drop spy-only model discovery projection test

Existing hook suite already covers stale-result exclusion; the new file only asserted a namespace spy call.

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 21:15:38 -07:00
Kelvin Amoaba ad2cce3af3 feat(mobile): show a voice meter and timer while dictating, with start and stop haptics (#35500)
* feat(mobile): show a voice meter and timer while dictating, with start and stop haptics

The phone meters the PCM it already streams with desktop's analyzer,
now shared from src/shared, so both shells get a level without a native
event crossing the page bridge. Recording start and stop tap the phone,
iOS now allows haptics during input, and "Dictation inserted" only
shows for live terminal input, where the text can be hidden.

* refactor(mobile): keep the dictation hooks under the line cap after #35502

Moves the start tap and stop tick into useMobileDictationHaptics and shares one current-finish guard in finishDictation.
2026-10-29 04:13:09 +00:00
OrcaWinandOrcaWin d8eef80bf4 feat(mobile): localize sessions, terminal, agent chat, browser and files (#35553)
Moves ~970 strings in session screens, the terminal, agent chat (including the
copy mobile used to render straight from shared English records), the browser pane
and the file explorer to the translation API, with all ten translations.

- Chat tool-run sentences, task lists, receipts, notices and turn status take
  translated words; the shared sentence joiner accepts an optional continuation so
  German nouns and Turkish casing survive mid-sentence (desktop unchanged)
- "Used the browser" vs "… 21 times" and resolved PR comment headers use explicit
  keys instead of plural rules, which would drop the count for Russian 21, 31, …
- Action sheet rows carry stable ids instead of being keyed by translated labels
- Rename inputs keep the raw title rather than a translated placeholder

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 03:55:41 +00:00
OrcaWinandOrcaWin d5e2c0b169 fix(mobile): refresh custom shortcuts when returning to a session (#34951)
* fix(mobile): refresh custom shortcuts when returning to a session

* fix(mobile): adopt accepted custom-key writes while the session is mounted

A focus or foreground reread could land between queued Settings writes and
keep an intermediate list. Subscribe to accepted writes, and fold the refresh
regressions into the existing lifecycle test fixture.

* test(mobile): type session scope custom keys without an assertion

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 20:35:39 -07:00
Kelvin Amoaba 26aa174b3b feat(mobile): show dictated words as you speak and insert them at the cursor (#35502)
* feat(mobile): show dictated words as you speak and insert them at the cursor

Newer desktops already send the text so far with each audio chunk reply;
the phone now shows it: grey in the chat composer or command field where
it will land, and on the live-input status row. The final transcript
replaces the selection the field had when recording started, and is
appended when the field was never focused or changed since.

* refactor(mobile): pass the dictation preview by context and split its hooks out

The preview reaches composers through a context instead of four layers of
props, and the composer's and session's dictation logic move into their
own hooks, which keeps each file under its line cap.

* fix(mobile): keep dictation selections and live words to their own terminal

* test(mobile): keep the composer dictation test typechecked and under the line cap

* fix(mobile): keep the chat field controlled while dictation previews over it

The native composer field swapped its value for rich-text children while
showing heard words, so Android could duplicate or drop typed characters and
selection offsets could drift from the draft. Draw the preview as a hidden-
from-accessibility overlay shared with the web field, and only hide the
field's own text.

* refactor(mobile): build the dictation route context beside its destination

Keeps the session dictation hook under the line cap after rebasing onto main.

* fix(mobile): land dictation where its preview showed after switching chat or terminal

The final words now go to the target captured at start: the chat it began
in (its own draft when another chat is showing) rather than whichever
surface is visible. The command field preview only uses the saved selection
in the terminal it was read from, so it shows the words appended in another
terminal, as they will land.

* fix(mobile): send terminal dictation to the chat that replaced its terminal

Routing only by the captured target dropped the words when a chat tab
replaced the terminal mid-dictation, since no terminal draft was left to
take them.
2026-10-29 03:26:21 +00:00
OrcaWinandOrcaWin 73c6b6d2ef fix(mobile): release skill scans from retired transport generations (#34949)
* fix(mobile): release skill scans from retired transport generations

* fix(mobile): read skill-scan transport generation when the request starts

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 20:07:56 -07:00
OrcaWinandOrcaWin 02db0146c6 perf(chat): order queued turns without repeated transcript scans (#34945)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 20:07:52 -07:00
OrcaWinandOrcaWin 34536771a7 perf(mobile): skip projection for abandoned diff replies (#34873)
* perf(mobile): skip projection for abandoned diff replies

* test(mobile): consolidate abandoned diff projection regressions

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 20:07:45 -07:00
OrcaWinandOrcaWin d27c795b76 fix(mobile): bound file search cache after empty queries (#34841)
* fix(mobile): bound file search cache after empty queries

* test(mobile): fold empty-query cache bound regression into existing suite

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 20:07:32 -07:00
OrcaWinandOrcaWin 0909b148ad fix(mobile): skip retired file search ranking (#34837)
* fix(mobile): skip retired file search ranking

* test(mobile): fold stale-rank check into existing slow-inventory case

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-28 20:07:29 -07:00
bfa0dc01ba fix(mobile): preserve long terminal and chat pastes (#31473)
* fix(mobile): preserve long terminal and chat pastes

Agents can keep only the last ~1 KiB read of unframed input (#13332).
Frame long single-line chat messages like multi-line ones, and frame Live
input appends over 1 KiB (an OS paste) with the terminal's paste rule,
including held text flushed before a terminal click.

Co-authored-by: Carlos Baraza Haro <carlos.baraza@ieee.org>

* fix(mobile): end the live input session after a framed paste

Agents such as Codex collapse a framed paste into one token, so later
per-character erases from the field mirror desynced the line. A long
append to a terminal in bracketed paste mode now commits the whole field
in one frame and clears the field, recording it like other session ends
so a late native echo cannot send the paste twice; without that mode the
paste stays unframed and editable. Chat sends measure the sanitized bytes
when deciding to frame.

---------

Co-authored-by: Carlos Baraza Haro <carlos.baraza@ieee.org>
Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-10-29 03:02:08 +00:00
b7aa695182 fix(mobile): make agent question cards the one answering surface and keep long ones reachable (#31663)
* fix(mobile): give agent questions one answering surface that fits the screen

A shown prompt card now replaces the chat composer, as on desktop. The
composer stays mounted underneath so its draft and attachments survive,
and comes back when the card collapses, clears, or dictation is running.

The card keeps the conversation visible above it (60% cap) and takes the
whole area while its reply is being typed. Question and Ask cards scroll
inside that bound and keep a focused reply in view as the card shrinks.

Co-authored-by: Neil <neil@stably.ai>
Co-authored-by: Wooseong Kim <innocarpe@gmail.com>
Co-authored-by: fancivez <fancivez@gmail.com>

* fix(mobile): open each ask step at its question

The ask card's body now scrolls inside a bounded card, so a new step must not inherit the previous step's scroll offset.

* fix(mobile): keep the queued tray shrinkable and approval actions reachable

The composer wrapper passes the remaining height down again, the queued-message tray unmounts while a card owns input so a focused editor cannot keep typing out of sight, and an approval card scrolls as a whole when its choices exceed the card's bound.

* fix(mobile): keep the composer for an approval this build cannot answer

Its choices are disabled and only a new turn can cancel it, as desktop's pendingPromptsAllUnanswerableHere rule keeps the composer for.

* fix(mobile): keep the approval card's choices pinned and the composer for a terminal-only ask

A long plan shrinks inside the approval card again instead of pushing its choices below a scroll. An ask only the terminal can answer leaves the composer (and Stop) in place, like an approval this build cannot draw.

* fix(mobile): keep the queued tray mounted under a prompt card

Unmounting it dropped its in-flight guards, so Resume could run while Clear all was still deleting. A hidden focused editor loses focus with display none.

* fix(mobile): keep the composer while dictation lands, and each ask step at its question

Transcribed text arriving after the mic stops stays visible in the composer. A focused reply is revealed only when its card shrinks, so a step that grows the card keeps its reset to the question.

* fix(mobile): keep queued work in view under a question, and end an ask step's edit on navigation

Desktop leaves queued messages and background-task controls visible while a prompt card shows; only the composer steps aside. Moving between ask steps ends the reply edit so typing can't land in a field scrolled out of view.

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
Co-authored-by: Wooseong Kim <innocarpe@gmail.com>
Co-authored-by: fancivez <fancivez@gmail.com>
2026-10-29 02:57:12 +00:00
Neil ce44117d91 refactor(shared): colocate native chat cut-turn notices (#35617) 2026-10-28 19:54:34 -07:00
eb4f541cda fix(mobile): show live input caret and preserve selection edits (#31477)
* fix(mobile): show live input caret and preserve selection edits

Display the existing input directly so its native caret shows. Accessory
Backspace/Delete edit at the field's caret, read from the input when pressed,
so edits that keep the caret (IME composition) still delete, and the caret is
restored for subsequent typing.
Port and adapt community PR #28294 to the current command dock.

Co-authored-by: Kyino <kyino1025@gmail.com>

* fix(mobile): keep live input caret keys local and the dock height fixed

Hardware Left/Right/Home/End moved both the visible field caret and the
PTY cursor, so the mirror erased at the wrong place. With field text they
now move only the field caret, like Backspace and Delete; Right/End at the
field end still reach the PTY so shells can accept an autosuggestion. On
Android the key binding lets plain caret keys through to that decision
instead of sending them to the PTY. The dictation and upload status covers
the field instead of adding a row, so starting or stopping either no longer
resizes the terminal.

* test(mobile): annotate the DOM field cast in the accessory input test

* chore(mobile): allowlist the live input field strings for localization coverage

---------

Co-authored-by: Kyino <kyino1025@gmail.com>
Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-10-29 02:43:47 +00:00
Kelvin Amoaba f5c84eae58 fix(mobile): the first Back while dictating stops it and keeps what was said (#35477) 2026-10-29 01:44:01 +00:00
Kelvin AmoabaandNico Hu 18c4e6bc47 feat(mobile): give chat code, tables, quotes and diagrams a clearer layout (#34456)
Code blocks get a header with the language and copy button, syntax
colours from the file reader's highlighter, a line-number column and
horizontal scrolling. Short tables fill the message width, cells get more
room, quotes sit on a panel, bullets are dots, and Mermaid diagrams use
the app's borders and type.

Co-authored-by: Nico Hu <haoyu.hu@lexmount.com>
2026-10-29 01:36:56 +00:00
Kelvin Amoaba f640517132 feat(mobile): show chat images that live on the paired desktop (#34462)
* feat(mobile): show chat images that live on the paired desktop

* fix(mobile): read every image type desktop chat shows

* refactor(runtime): share the bounded preview read and chat-image type check

* test: keep the chat-image tests typed and off importActual
2026-10-29 01:27:57 +00:00
NeilandKelvin Amoaba 5470ff907c fix(mobile): stop review notes from disappearing or coming back after deletion (#31699)
* fix(mobile): stop review notes disappearing or coming back after deletion

The phone sent its whole notes list on every add or delete, and the host
stored it as is. A note added on desktop after the phone loaded was wiped
by the phone's next edit, two quick taps could overwrite each other, and a
failed save rolled back to an old snapshot.

worktree.set now takes an optional diffCommentsBase, like linkedItemsBase:
the host applies only the writer's own adds, edits and removals to the
stored notes. The phone sends the list it started from, shows the host's
merged list from the reply, and undoes only its own change on failure.
Older hosts drop the field and replace the list as before; older phones
send no base and get the same.

Co-authored-by: Neil <neil@stably.ai>

* fix(mobile): keep loaded review notes when an early save fails

The first load was discarded once any save started, so a save that failed
before it landed left the host's notes hidden. The load now applies the
phone's changes made during the read onto the host's list instead.

* fix(mobile): send review-note requests one at a time

Two in-flight saves could reach the host in either order, so adopting the
later reply hid a note the earlier save had stored. Session notes now send
one request at a time and reconcile every reply with the phone's changes
made since it was sent, replacing the sequence counters.

* fix(mobile): drop review-note saves queued behind a failed one

A save queued behind one that failed still sent the list built on the
failed change, and an older host stores that list whole. Those saves now
undo their own change instead of sending. Also renames the shared base
type so it no longer shares a name with the renderer's mutation record.

* fix(mobile): show review notes as the host's list plus pending saves

A queued reply was reconciled against the list captured at tap time, so a
note desktop deleted meanwhile came back on the phone. The phone now keeps
the host's last list and its unanswered saves per workspace and shows the
two combined; a reply for another workspace is ignored. The review screen
also shows the host's list after a save, so an edit to a note desktop
deleted no longer looks saved.

* fix(mobile): fail queued review-note requests while disconnected

A notes request queued behind a pending load waited for a reconnect with
no timeout, holding every later save. Notes requests now fail at once when
the connection is down, like terminal input.

* fix(mobile): drop every review-note save built on a failed or dropped one

A save made while a dropped save was still pending carried its change,
so an older host could store it. Each failed or dropped save now moves
the failure count.

* fix(mobile): send each review-note save as the host's list plus its change

Each queued save now builds its payload when it is sent, from the host's
last list plus only its own change. A note added before the first load
no longer replaces the loaded notes on an older host, and a failed save's
change never rides along, so later saves no longer need dropping.
Delivered-note cleanup waits for a reconnect again so those notes are not
sent twice.

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-10-29 00:40:56 +00:00
NeilandKelvin Amoaba 90ef900757 fix(mobile): only clear terminal output after the computer accepts Clear (#31703)
* fix(mobile): clear terminal output only after the computer accepts Clear

The phone erased its terminal before sending terminal.clearBuffer and
reported success on any reply, refusal included. Wait for the host's
{ clear: { cleared: true } } reply, fail immediately when disconnected so
the request cannot replay after reconnect, ignore late replies after the
client or terminal changed, and resubscribe a subscribed terminal so its
snapshot (including output that arrived during the request) replaces the
old screen. An unsubscribed tab draws its snapshot when it next subscribes.

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>

* test(mobile): return the subscribe result from the gesture recording adapter

* fix(mobile): keep accepted clears when the terminal view re-renders

The WebView handle is rebuilt on every render and a relay/direct cutover
bumps the connection generation without changing the host, so both
checks treated accepted clears as stale: the phone neither reloaded the
output nor showed a toast. Only a replaced client is stale now.

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-10-28 23:09:18 +00:00
Brennan Benson 78ad9f4255 fix: keep chat option actions independent of inventory (#31927)
* fix: separate chat option input from inventory observations

* fix: preserve scoped chat choices and publication ownership

* fix: complete scoped catalog and applied control ownership

* test: make catalog fixture dependency boundaries explicit

* test: request catalog discovery explicitly in demand contracts

* fix(chat): preserve option observations and operation boundaries

* fix(chat): finish pending option and catalog lifetimes

* fix(chat): project saved permissions without launch preparation

* fix(chat): correct option rejection and catalog retirement

* Preserve Claude effort validation advice through chat rejection

* test: align refresh mocks and preserve fixture type evidence

* fix: share catalog claims only across equivalent owners

* test: use typed catalog corpus instrumentation

* fix: consolidate structured launch imports

* Validate SDK queue regression envelopes without assertions

* fix: complete catalog runtime and fixture type contracts

* Align native option fixtures with explicit discovery and applied facts

* Keep initial compatibility catalog reads on held memory

* Complete the installed catalog fixture envelope

* Observe learned defaults after asynchronous projection settles

* Consolidate host fixture journal type imports

* test(native-chat): align goal and seed fixtures with applied inputs

* fix(codex): retain applied proof when goal settings skip a write

* test: load rejection wording before timed queue regression

* Fix catalog fixtures and queued option snapshot typing

* Align permission publication fixture with passive option reads

* Separate startup config from held turn permission fixture

* Align input lifecycle fixtures with sparse applied choices

* Simplify scoped catalog refresh ownership and coalesce cache snapshots

* Load catalog persistence real-module fixture during collection

* Compose catalog availability fixtures from valid session records

* Align catalog and startup fixtures with current option contracts

* Fix permission read types and separate catalog fixture preparation

* Align option and restart fixtures with current lifecycle owners

* test(mobile): retain reported model alongside discovery

* test(mobile): recalibrate the measured route script envelope

* test: let the preflight shell-capture mock run its detection callback
2026-10-28 16:08:01 -07:00
Kelvin Amoaba 9dd4dc5d17 fix(mobile): show the dictation mic's starting state, hold-mode copy and screen-reader status (#35441)
The chat mic only got isRecording/isProcessing, so it looked idle while starting; it now shows the live look the terminal mic does. The terminal status row says 'Release mic to stop' in hold mode, both mics expose role and busy state, and one live region announces Starting mic / Listening / Processing.

Fixes #35422
2026-10-28 23:02:08 +00:00
Kelvin Amoaba e5b45ac90f fix(mobile): keep dictation recording through a reconnect and keep what was already said (#35338)
* fix(mobile): keep dictation recording through a reconnect

The host tied a phone's dictation to its socket, so any reconnect cancelled
it, and the phone ended the recording as soon as the connection dropped.
The host now owns the session by device and waits a grace period for the
phone to come back. The phone keeps recording through the reconnect and
keeps the text transcribed so far if the connection does not return.

Fixes #35211

* fix(mobile): bound dictation reconnect waits and release retired relay waiters

* fix(mobile): resend an unsent dictation finish after a connection move and send the text so far only when it changes

* fix(mobile): hold dictation requests through a suspended relay and bound the start wait

* fix(mobile): recognise a suspended relay client across the page bridge

* refactor(dictation): refresh one abandon timer, report text by version and share the reconnect wait

* fix(mobile): resend dictation text each second and never wait offline for a cancel
2026-10-28 22:27:21 +00:00
Neil 4881182aad refactor: group native chat image transcript preparation (#35301) 2026-10-28 15:22:44 -07:00
NeilandKelvin Amoaba 64344142fa fix(mobile): stop held terminal keys when you switch terminals or leave the app (#31712)
* fix(mobile): restore lifecycle-safe terminal accessory repeat

The selection hook replaced the established repeat controller with unbounded timers, allowing held keys to cross terminal/client changes. Reintegrate the existing pinned sender, lifecycle cancellation and backpressure.

* test(mobile): stop held terminal input after refusal or disconnect

* test(mobile): give accessory-repeat harnesses the PTY modes and focus hook main now reads

* fix(mobile): stop a held key when its strip unmounts and repeat through the current live-input mode

* fix(mobile): type the accessory repeat sender's input

* refactor(mobile): read app state live in the accessory repeat gate

* test(mobile): pin the key bar's held press to the repeat controller's first send

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-10-28 22:17:20 +00:00
Brennan Benson d0bfbd22ac Keep host-removed rows out of desktop and phone chats (#34996)
* Keep removed chat rows out of coalesced updates

* test: bound destructive history burst work

* test: verify removed history through transcript projection

* test: count retained row reads with typed getters
2026-10-28 13:50:25 -07:00
Neil 7b3fb541f4 Built-in syntax highlighting for .env files (#34542)
* feat(editor): built-in syntax highlighting for .env files

.env, .env.* and *.env files now open as a dedicated dotenv language with
comment, key, export, value, quoted-string and ${VAR} colouring instead of
INI. .envrc opens as shell, since it is sourced as a shell script.

* fix(mobile): map dotenv to the ini grammar for mobile highlighting

* fix(editor): keep quotes after the first dotenv value character literal
2026-10-28 13:40:03 -07:00
Kelvin Amoaba 6c54b4fac5 fix(mobile): show the chat mic busy while a stopped dictation transcribes (#35320)
Fixes #35313
2026-10-28 20:38:01 +00:00
Kelvin Amoaba 88662806c0 fix(mobile): explain dictation setup before asking for the microphone (#35248)
A mic tap opened capture, and with it the OS permission prompt, before
anything asked the host whether it could transcribe; the setup sheet only
appeared after the host refused dictation.start. The session screen now
gates the start on the setup read it already does, opens the setup sheet
when setup is missing, and hands the next tap back to the host and re-reads
when the sheet closes. A host that never had a model selected now offers
the mic. The sheet's switch uses MobileSwitch.

Fixes #35203
2026-10-28 20:14:39 +00:00
92a754a088 fix(mobile): suspend hidden and background terminal gestures (#31468)
* fix(mobile): suspend gestures in hidden and background terminals

Adapt the retained-pane interaction lifecycle from community PR #30324.
Restore policy across readiness/recovery and keep output/query replies flowing.
Release cancelled gesture frames, discard touches interrupted by suspension,
and restore the resting pinch transform on every gesture cancellation.

Co-authored-by: Wooseong Kim <innocarpe@gmail.com>
Co-authored-by: Neil <nwparker@users.noreply.github.com>

* test(mobile): stub route focus where the web mount renders terminal panes

* test(mobile): send production-shaped file taps and the clipboard prop in activity tests

* fix(mobile): keep inactive and interrupted terminal moves away from xterm

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
Co-authored-by: Wooseong Kim <innocarpe@gmail.com>
Co-authored-by: Neil <nwparker@users.noreply.github.com>
2026-10-28 18:53:58 +00:00
Neil 80bbbaff7f refactor: give native chat readability one concrete owner (#35231) 2026-10-28 11:28:03 -07:00
Brennan Benson 28d6883756 fix(mobile): grey the queue's other controls while Clear all or Resume is on its way (#29219)
* feat(native-chat): one queue header that becomes the pause row; no composer Resume or send dialog

The queued cards now sit under one header row on desktop and phone: "Queued"
and the count normally, and "Paused" with the count, Clear all and Resume
while the host holds the queue after a Stop. A chevron folds only the cards;
the choice is local to the view and resets when the queue empties.

The composer's Send no longer turns into a second Resume, and a message sent
into a paused queue no longer asks "Send message?": it sends, its accepted
turn lifts the pause, and the cards follow it. Clear all deletes every card
through the existing per-card delete. No wire or host change.

* test(mobile): find the background-tasks strip's toggle inside the strip, not the queue header's

* Make queued Clear all atomic across clients

* Show queued message failures in collapsed headers

* Use per-card delete for paused queue Clear all

* Join repeated paused queue Clear actions

* fix(mobile): grey the queue's other controls while Clear all or Resume is on its way

On the phone, Resume and each card's Steer and Delete stayed tappable while
Clear all was still deleting the cards, so Resume could start sending cards
Clear was deleting, and a card's Steer could race its own delete. Clear all
and Resume now share one in-flight key, so each greys during the other, and
Clear all holds every card it deletes, leaving out a card whose own action
is already running. Same mechanism as the desktop fix.

* fix(mobile): wait for pending cards before clearing the queue

* style(mobile): format queue control contract test

* fix(mobile): Clear all and Resume share the queue's pending key, as on desktop

Clear all holds every card it deletes and greys Resume until it settles, and
waits for any card's own action instead of starting over it.

* test(mobile): bound queued message conflict work
2026-10-28 11:08:46 -07:00
Kelvin Amoaba 49e53bd345 fix(mobile): greet a just-started terminal Claude with "Start a chat" (#35219)
Claude reports its session at startup but writes no transcript until the
first prompt, so the host answers pending and the phone said "Can't find
this conversation yet". A session the running agent reported live is new;
only remembered sessions keep the not-found copy.
2026-10-28 17:41:03 +00:00
Jinjing 117bbc48e6 Extract mobile native chat prompt controller (#34244) 2026-10-28 10:36:44 -07:00
Kelvin Amoaba 7951f8fe51 fix(mobile): keep dictated words through calls, busy taps and failed inserts, and say why dictation failed (#35216)
* fix(mobile): keep dictated words through interruptions, busy taps and failed inserts

A call, Siri or mic dropout now finishes the dictation instead of
discarding it, a tap while transcribing no longer cancels, a transcript
its target refuses is copied to the clipboard with a toast, and host
dictation error codes show as plain sentences.

* test(mobile): share one session dictation harness for refusals and kept transcripts

* refactor(mobile): share the lost-session dictation sentence and keep speechless helpers private

* fix(mobile): keep a dictated terminal transcript when the live send throws
2026-10-28 17:34:33 +00:00
Neil 49695f37b1 refactor: group native chat subagent transcript rules (#35200) 2026-10-28 10:24:47 -07:00
Kelvin Amoaba 247035b026 fix(mobile): give phone audio back when dictation stops, and fail clearly when iOS can't record (#35214)
* fix(mobile): release the dictation audio session on stop and fail clearly without iOS voice processing

Stopping dictation only muted the native input, so the iOS voiceChat session
and Android audio focus stayed held until the screen unmounted and other apps'
audio stayed ducked. End now tears the engine down; the next open rebuilds it.
iOS tearDown stops I/O before deactivating and notifies other apps.

The iOS engine returned from setup before installing the mic tap when voice
processing could not be enabled, so recording reported success and captured
nothing. Setup now throws, so initialize fails and the phone shows the
microphone error.

* test(mobile): expect dictation stop to tear the audio engine down

* test(mobile): drop the duplicate release-throw case from native capture tests
2026-10-28 17:15:30 +00:00
Neil 74937b50aa refactor: group native chat transcript retention (#34761) 2026-10-28 09:22:44 -07:00
Brennan Benson fa5284aca2 feat: edit queued messages inline with the full chat composer (#31180)
* fix(native-chat): a refused queued message still blocks the queue when its card write fails

Every reader of a queued card goes through one derived view of the journal's dispatch facts,
so a card whose message was refused reads as returned even when its card-table update and heal
both failed. One decision and one writer store the derived state for every action.

* refactor(native-chat): keep each queued message in the chat's journal, not a second table

A queued message lived in its own SQL table, and a hook that may be skipped copied
each refusal from the journal into it. When that write failed, a refused card
vanished: the cards behind it sent, and its Send and Delete did nothing.

Each queued message is now a `queue` row in the chat's journal beside the
submission that hands it off and the dispatch row that answers it. The reducer
folds the card from those rows, so a refusal returns the card and holds the
cards behind it with nothing written, and replay reads the same. Every action
writes its own rows in one transaction. Cards an earlier build stored are read
through the same classification until they move: each action moves its own
card, and a bulk import runs once per open. A new epoch restates every card
still owed an answer in the transaction that deletes the old rows.

The settlement hook and its savepoint, the open-time heal, the drain's heal and
the derived-card view are gone. The published card list is unchanged.

* test(native-chat): adapt the queue tests to cards kept in the journal

Cards are written through the journal, so tests queue them with their body
alone and hand them off under their real fingerprint. Tests of the removed
settlement hook, heal and SQL store are deleted; the text-update spec now
covers the edit decision alone, and a test of an earlier build's stored holds
seeds the legacy table and reads the imported cards. Rolling over an epoch now
keeps a card whose hand-off was never handed over, so that test checks the
retried id never sends rather than that nothing sends.

* test(native-chat): a refused card holds the queue through rewind, a new epoch and a restart

One whole-flow test through the host: the refusal writes no card row, a rewind
that retires the refused hand-off and a rolled-over epoch keep the card
returned, a restart and Resume send nothing behind it, its own Send refused
again still holds the queue, and its Delete releases the next card in order.

* test(native-chat): an earlier build's queued cards move into the journal once, each read the same

One mixed-import test through the host. The first open's import fails and
moves nothing, yet every card reads as it will; Delete and Send each move only
their own card. The next open moves the rest in one transaction, writing a
refusal only where its hand-off is gone, nothing for answered cards, and leaving
an unreadable row on disk. A later command turn spends a moved command card, a
third open writes nothing, an old Delete replays from its receipt, and a chat
with only answered legacy rows clears them in a delete-only transaction.

* test(native-chat): adapt typechecked tests to cards kept in the journal

The row-kind table lists a queue row, the clear and legacy-import tests
match the current signatures, and the downgrade test keeps only the
leftover-send case: a queued card is now a newer-version journal row an
older build keeps read-only, and users don't downgrade.

* refactor(native-chat): drop the journal row writer's unused transaction hook

No caller passes one since the queue's savepoint bookkeeping left.

* test(native-chat): downgrade probes write rows at the version older builds read

The highest version this build reads is now 4, the queue row's. A newer
build's row in these probes is written at version 3 so the older build
meets its kind, not a newer version, and the Stop-event probe hands the
older build the rows as stored, since a read raises each row's version.

* test(native-chat): unit tests follow the queue row's version 4

The legacy-import test opens real SQLite, so it runs in the Node runtime
project. The newest version this build reads is now 4, and a read raises a
row's version to it, so the turn-lifecycle test no longer pins the
in-memory version (the written one stays pinned by journalRowSchemaVersion).

* fix(native-chat): one batch echoing two refused queued messages spends both

The per-row delivery check returned only the first waiting card an echo
proved delivered, so when one settlement carried echoes for two cards the
second stayed waiting and was sent again. It now returns every card the
row proves delivered, and the fold withdraws each; replay folds the same.

* fix(native-chat): a rewind moves an earlier build's cards into the journal first

While the open's import had failed, an earlier build's card that read as
refused through its hand-off lost that reading when an in-place rewind
retired the hand-off: it disappeared and the card behind it sent. The
rewind now adopts every legacy card ahead of its tombstones and deletes
their rows in its own transaction, as an epoch replacement already does,
so the fold latches each card's reading before its hand-off is gone.

* fix(native-chat): keep an earlier build's card whose hand-off is still unconfirmed

The import dropped a legacy card handed off as a send whose delivery was
unknown, though the fold keeps such a card linked and a later refusal
returns it. The import now keeps every card whose hand-off a later row can
still answer, through the same check the reducer folds dispatch rows by.

* fix(native-chat): one delivery echo withdraws at most one queued card

One provider echo proves one delivery, yet it withdrew every waiting card
with the same text whose hand-off was refused, so a second identical card
was lost. The fold now pairs each echo with one card: on its own row the
earliest-positioned match no other echo of that row took, and for a card
that waits again the earliest applied echo no card has taken. Paired echoes
live in the fold's state, so live and replay pair the same; readers of
cards not yet imported work on a copy.

* fix(native-chat): a queued message handed to the agent is sent again only on proof it never got it

Pressing Stop after Orca handed a queued or steered message to the agent,
before the agent confirmed it, put the card back in the queue, and Resume
or the next send sent it again. A check matching the agent's echo of the
text was the only guard against a double send, and it kept trading a
resend for a lost card. Whether the card waited again was decided by the
rejection's category, not by proof the agent never got the message.

A refused hand-off now waits again only where Orca proves the agent never
received it: the host still held it, or whoever settled it recorded that.
A failure still returns the card and holds the cards behind it. Anything
else may have reached the agent, so the card is spent and its message
reads as sent, derived on every fold from the stored rejection: with the
turn it was answered into, as that turn's unconfirmed message where it was
handed over; withdrawn before any turn opened, as a person's own send a
Stop took back. The reopen mark ignores a recovered doubt, and the restart
reconciler no longer judges a queued hand-off unsent from what history
lacks. The echo text matching and its pairing are deleted.

A close or quit while the agent starts settles sends with the unrun hold.
The host hands nothing to a child before its start answers
(structured-agent-session-delivery-loop.ts: a handover needs phase
ready), so such a send went to an earlier child and may have run: it now
reads as sent instead of waiting again.

* fix(native-chat): Claude's report that it removed a queued message unrun lets the card wait again

Claude says when it removed a send without running it: the interrupt
receipt's cancelled list, or a command_lifecycle cancelled, discarded or
refused frame for a command that never started. Every one settles through
rejectClaudeDispatchWaiters, which now marks the settlement unrun. For a
queued card's hand-off the host records that as proof the agent never got
it, so the card waits again under the queue's pause. A direct send keeps
the plain refusal: there the proof would owe it as stopped history.

* fix(native-chat): an earlier build's card stopped after hand-over follows the same rule on upgrade

Earlier builds put a card back to waiting after any refusal without a
verdict and cleared its link, so a card the agent may already have would
be sent again after the upgrade. The card's own hand-offs in the journal
decide now: unchanged and last sent as one that may have reached the
agent, it is spent on that hand-off and its message reads as sent; edited
or sent again since, it is held for its own Send under a host-only marker
that publishes as a plain hold; with no hand-off in doubt, including one
that never left Orca, it waits as before. The import writes a card spent
on a hand-off in doubt, so its message shows.

* fix(native-chat): read a queued row's hand-off before the lookup that uses it

The lookup's callback lost the narrowing of the row's change, which the
mobile test typecheck rejects.

* test(native-chat): a card steered into a turn a Stop ends stays sent in the Stop tests

Three tests pinned the old rule, that a card handed into a running turn
comes back to waiting when a Stop ends it. Under the new rule nothing
proves the agent never got it, so the card is spent: with the turn named,
its message reads as that turn's unconfirmed one; without, as a send the
Stop took back. Neither is ever sent again.

* fix(native-chat): a queued message stopped before Orca handed it to the agent waits again

A Stop that aborts a hand-off after its row is written but before the agent call now records
the withdrawal as never reaching the agent, for queued hand-offs only, so plan D's rule returns
the card to waiting under the Stop's pause instead of spending it. Direct sends keep the plain
withdrawal (the flag would owe them as stopped history). The agent's own refusal while aborted
is kept rather than overwritten, and an abort thrown during the call stays in doubt.

* fix(native-chat): a queued message stopped while the agent prepares it waits again

The abort signal reaches only an adapter's preparation (its options, the previous turn opening),
never its write, so the signal's own reason thrown back is the adapter saying nothing was
written. The handover now reads that, for queued hand-offs only, as never reaching the agent,
so the card waits again under the Stop's pause. Claude no longer wraps that abort as an option
refusal, which had returned a stopped card as a refused one blocking the queue. A real refusal
keeps its cause and its barrier; any other throw stays in doubt and is never resent.

* test(native-chat): the usage-limit Continue backlog case writes its card through the journal queue

Main's #30396 wrote its backlog card with the stored fingerprint and host-instance stamp the
journal queue derives instead; the card the Continue must yield to is the same waiting card.

* test(claude): the real-CLI queued Stop expects the unrun mark Claude's cancelled-unrun receipt carries

* feat(mobile): edit a queued message's images on the phone: remove or attach

* fix(mobile): gate queued image edits on the host reader verdict

* test(mobile): declare the upload fixture chat mode

* fix(native-chat): retain spent legacy messages when import fails

* fix(mobile): reveal the full queued image editor on open

* fix(mobile): invalidate queued editor geometry without a render ref write

* refactor(chat): prepare composer drafts and measured queue dragging

* feat(native-chat): add conditional queue removal and authoritative reordering

* feat(native-chat): move queued edits into the normal composer on desktop and phone

* fix(native-chat): own complete phone drafts before authoring

* fix: preserve submitted composer drafts across storage replacement

* fix composer validation and mobile CI diagnostics

* fix mobile composer test contracts and diagnostic output

* Capture mobile test compiler diagnostics in CI

* Fix queued message contract typing and English strings

* test: complete queued extraction transport fixtures

* refactor: separate composer skill binding from send mutations

* fix(mobile): grant draft storage within route limits

* fix(native-chat): settle each draft save on its own and publish complete composer drafts

Phone: a queued Edit copy no longer consumes the save that later typing
owns. Each ordinary save and the exact copy settle only their own result;
an explicit save waits for its own pending write, and a failed or retired
write never schedules another or revives the copy.

Desktop: a pasted-text leaf no longer shifts which selected file binds
where, and a hand-back held during an IME composition reaches the store
only merged with the visible editor document, including writes the editor
admits without an update and the composition settle.

* fix(native-chat): import the draft type once in the draft cache

* test(mobile): type the held-write state without an assertion

* test(native-chat): assert the handed-back file on Send without reading a typed transport as a mock

* test(mobile): pass main's agent-confirmed flag to the submitted-files harness

* fix: reveal queued reorder grip on touch screens

* fix: save reopened phone drafts and batch reorder measurements

* test: use an explicit React module type

* Preserve queued message sortable identities on unchanged renders

* Prevent stale queued drag completion after unmount

* fix(mobile): hand off navigation across session workspaces

* test(mobile): use resolved session identity in dictation fixture

* feat: edit queued messages inline with the chat composer

* fix: normalize queued edit skill ownership

* fix: retire phone skill selections with the sent draft

* fix: consolidate queued edit module imports

* fix: separate edit save action and stabilize image callbacks

* fix: complete phone inline composer integration

* fix: retain same-name queued skill selections

* fix: complete desktop queued composer integration

* test: use typed phone composer host lookups

* fix: include queued edit localization keys

* Preserve inline edit input across save and attachment completion

* Preserve complete queued edits across delayed saves

* Preserve queued edit input across delayed completion

* Complete queued edit lease loss and pending cancellation

* Use recognized queued edit test fixtures

* Consolidate queued edit imports and type host test spy

* Print mobile test compiler diagnostics on ratchet failure

* Correct queued edit integration fixture types

* fix: keep queued edit placeholder independent of readiness

* Fix queued edit compiler fixture boundaries

* Align upload completion test with ordinary insertion

* Combine mobile composer draft imports

* Load queued edit host fixture during test collection

* Size inline phone queue editor to available space

* Use typed scroll components in phone presentation contract

* Save typed text in a queued edit as written

The inline editor is the chat composer, so it keeps the composer's own identity model and no longer refuses Save for text that looks like a command. Command rows picked from the menu are still refused, Enter still means Save, and Edit never sends or runs anything.

Regression tests cover Undo after deleting an accepted command or skill pill, a scanned skill named like a command, two saved files behind one token, and typed command text saving literally. Also fixes two merge leftovers in tests: a missing import and a fixture that stored the whole menu row as a skill.

* Keep ordinary sends on the main composer contract

* Fix mobile composer imports and fixture loading

* Consolidate queued edit imports and duplicate regression

* Restore ordinary send catalog short circuit and repair test boundaries

* Preserve returned rich drafts through send acceptance

* Remove obsolete queued editor strings from new locales
2026-10-28 02:09:49 -07:00
Jorge AlbarracínandNeil d155cfba05 feat(editor): syntax highlighting for Glimmer .gjs/.gts files (#13236)
Register glimmer-js and glimmer-ts Monaco languages that embed
JavaScript/TypeScript as the background script and tokenize each
<template> block as a Handlebars island. Embed entry is bounded by the
shared line budget so long lines cannot blow the Monarch recursion
limit. Mobile maps the new ids to javascript/typescript highlighting.

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-10-28 01:10:23 -07:00
OrcaWinandOrcaWin 9d33005090 perf(mobile): defer unopened terminal document allocation (#34743)
* perf(mobile): defer terminal documents until first selection

* test(mobile): address review findings on pane-gating test

* test(mobile): use T[] array type in terminal document mount test

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-27 23:58:24 -07:00
Wooseong KimandNeil 55f9525c49 feat(editor): highlight CUDA C and C++ files (#21384)
Register a `cuda-cpp` Monaco language (VS Code's id) that reuses Monaco's
C++ grammar with CUDA qualifiers, built-ins, and vector types as keywords.
Map `.cu`/`.cuh` to it, and alias it to lowlight's cpp grammar on mobile.

Fixes #21267

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-10-27 23:15:01 -07:00
OrcaWinandOrcaWin eac5699bcd perf(mobile): pause active turn clocks while backgrounded (#34746)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-27 23:06:36 -07:00
Neil 6bb0c14a98 refactor: group native chat text presentation (#34647) 2026-10-27 19:48:24 -07:00
Neil 4d3451601a refactor: group native chat live presentation (#34638) 2026-10-27 17:56:38 -07:00
Neil ea532813b1 refactor: group native chat turn presentation (#34629) 2026-10-27 17:33:03 -07:00
Pandu dwi PutraandBrennan Benson ec49e9fac0 fix(native-chat): list OMP skills in the / menu as /skill:<name> (#31999)
* fix(native-chat): list OMP skills in the / menu as /skill:<name>

* test(native-chat): OMP now carries the Pi-shaped skill profile

* Publish native OMP skills with compatible command catalogs

* Index native skill descriptions once per picker build

* Combine catalog test composer imports

* Correct native catalog test types and project inputs

* Run cross-platform picker scaling contract with mobile tests

* fix: discover native commands before the first chat message

* test: isolate native command discovery from mobile typechecking

* fix: release command discovery ownership after managed root exit

* refactor: reuse the ACP child owner during shutdown drain

* test(acp): load filesystem implementation before test execution

* test: drive discovery close completion explicitly

* test: await discovery admission cleanup between demand waves

* test: control discovery close ordering in demand waves

---------

Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
2026-10-27 17:14:20 -07:00
Neil f3adb8f85a refactor: group native chat work-run boundaries (#34528) 2026-10-27 15:18:29 -07:00