Skip to content

Switch computers in place and keep work running - #593

Merged
OldKrab merged 10 commits into
mainfrom
shushakov/computer-switcher
Oct 23, 2026
Merged

OldKrab merged 10 commits into
mainfrom
shushakov/computer-switcher

Conversation

@OldKrab

@OldKrab OldKrab commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Implements ADR-0070 in the four slices of docs/plans/computer-switcher.md.

Changes

  • Slice 1 — switcher in the sidebar. The Task navigation lists this device and paired computers and switches between them; Settings shares the same switch state.
  • Slice 2 — Desktop switches in place. Choosing a computer reloads the window onto that computer's App Server. This computer's App Server keeps running under a native shell-hold client, so its Tasks keep working. Desktop Updates prepare this computer's App Server through that client while a paired computer is in use.
  • Slice 3 — connect first.
    • The switch connects before leaving and can be cancelled.
    • Unsent input is asked about before connecting.
    • Each computer's last Task or new-Task place is restored after a switch.
    • On Android, forgetting the computer in use goes through the same switch.
  • Slice 4 — notifications for this device's Tasks.
    • Desktop: a native watcher holds taskAttention/wait on this computer's App Server while a paired computer is in use, and a second notification manager with its own receipts shows those Tasks. A click switches back and opens the Task.
    • Android: the background service also reads the phone's App Server without starting it, keeps the phone awake only for the phone's working Tasks, and a tap switches to the phone.
  • The stack includes the proposal commit for ADR-0069 (SSH Computers), which ADR-0070 refers to.

Verification

  • Frontend, Web, and Desktop unit tests.
  • Desktop Rust tests (except feed_endpoint_is_version_and_channel_specific, which already fails on Linux on main).
  • Android unit tests.
  • Workspace typecheck, source size, and private-data checks.
  • A live App Server checked the watcher's contract:
    • Shell-hold initialize.
    • taskAttention/wait held about 25 s.
    • Update prepare answered ready, then commit succeeded.

Not verified

  • macOS and Windows Desktop builds; Android on a device.
  • Cancelling a switch to the phone does not stop a Termux App Server start that already began.
  • Drafts are still dropped on a confirmed switch; the plan records the follow-up.

Add ADR-0069: an App Shell installs, starts, and keeps the App Server on a
Linux computer over SSH, holds its token, and forwards its loopback endpoint
through the SSH connection. Covers version cases with confirmed updates, a
keeper client for lifetime, system ssh on Desktop and an embedded client on
Android. Add the SSH Computer term to CONTEXT.md.
ADR 0070 records the computer switcher: a compact control at the end of
the Settings row once a computer is paired, one row per App Server,
connect before switching, a prompt before discarding unsent input, and
returning to the last place on each computer. Leaving a computer never
stops its work, both App Shells notify for this device's Tasks, and the
Desktop switches by reloading its WebView instead of restarting.

ADR 0063 points its restart and no-App-Server choices at ADR 0070.
Records the findings behind ADR 0070 and the slices: the shared switcher
with one computers capability, the in-place Desktop switch that keeps
this computer's App Server, connect-first with place restore, and
notifications for this device's Tasks.
Add a compact computer switcher at the end of the sidebar's Settings row
(ADR-0070). It appears only once another computer is paired, names the
computer in use with a dot for a healthy link, and lists this device first,
then computers in the order added. Ctrl/Cmd+Shift+S and macOS File > Switch
Computer… open it; 1 to 9 pick a row.

Both App Shells now expose one `computers` capability, which Settings,
Remote also reads. The Mobile App sends its computer list to every page and
accepts switching from any route; every other connection command stays on
Settings. The Desktop title-bar computer header is removed.

The Desktop still applies a switch by restarting until slice 2.
… Server

The Desktop now connects the chosen computer first and reloads the window
onto it with a new client instance, instead of restarting. It always starts
and holds this computer's App Server, so switching to a paired computer
never stops work here. A failed or cancelled attempt leaves the window
where it was. A remote gateway can now be stopped, freeing its port and
leaving the App Server.

The Frontend shares one switch store between the computer switcher and
Settings. While a paired computer is in use, a Desktop Update stops this
computer's App Server through the native client.
…t place

Switching on Android now connects the chosen computer while the one in use
stays live, and changes nothing when the connection fails or is cancelled.
The phone answers the page before replacing it. The switcher and Settings
offer Cancel while a switch is connecting.

Before connecting, the Frontend asks when the page holds an unsent draft, a
selected attachment, or an upload in progress. Once another computer is
paired, each computer's last Task or New Task Project is remembered on the
device and reopened when the page opens at the start page. A switch's
diagnostics close on the reloaded page under the same operation id.
… in use

Desktop: a native watcher holds taskAttention/wait on this computer's App
Server as a shell-hold client while a paired computer is in use, and hands
each changed list to the window. A second notification manager with its own
receipts and notification ids applies the usual rules; a click switches back
through the shared switch and the reloaded page opens the Task.

Android: the background service also reads the phone's App Server while a
paired computer is in use, without starting it, keeps the phone awake only
for the phone's working Tasks, and notifies under a separate tag. A tap
switches to the phone and opens the Task. Forgetting the computer in use now
goes through the connect-first switch and forgets only once switched.

Also: the native hold now unwraps the App Server's response envelope, so the
local update prepare sees a blocked answer; leaving this computer retries the
window detach once; the plan records the draft persistence follow-up.
@OldKrab
OldKrab merged commit 9ff23b3 into main Oct 23, 2026
9 checks passed
@OldKrab
OldKrab deleted the shushakov/computer-switcher branch October 23, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant