Access the Floating Workspace from mobile (#8405)

Surface the desktop Floating Workspace (the global, repo-less scratchpad
of terminal tabs under the synthetic `global-floating-terminal` id) on the
mobile app so a Claude session left running there is reachable from a phone.

Adds a terminal-icon button to the mobile host header (phone + tablet
sidebar) that opens the existing Session screen for the floating id. The
sentinel already had host-side RPC support (#5946: local runtime, homedir
cwd, explicit-id fast paths in session.tabs.*); this wires up the mobile
surface and gates it on a new `floatingWorkspaceEnabled` status flag so the
entry hides on hosts that predate it or where the feature is disabled.

The Session screen learns an `isFloatingWorkspaceRoute` flag (mirroring the
existing `folder:` route pattern) that hides repo-backed surfaces — Files,
Source Control, PR/checks, agent history — skips the diff-comment and GitHub
probes, routes terminal URL taps to the phone browser, and limits the New
Tab drawer to terminals + agents (browser/markdown creation resolves a real
worktree host-side and stays desktop-only). useLiveWorktreeName
short-circuits for the sentinel so it no longer polls worktree.show forever.

Extracted the host status.get gating into a useHostStatusGates hook to keep
the host screen under the max-lines ratchet.
This commit is contained in:
Brennan Benson
2026-07-19 23:36:51 -07:00
parent 624c8d4120
commit 0ea9c08b7f
11 changed files with 291 additions and 97 deletions
+13
View File
@@ -1627,6 +1627,19 @@ describe('OrcaRuntimeService', () => {
expect(runtime.getStatus().terminalWindowsShell).toBe('wsl.exe')
})
it('reports floating workspace availability from settings on status', () => {
expect(createRuntime().getStatus().floatingWorkspaceEnabled).toBe(true)
const disabledRuntime = new OrcaRuntimeService({
...store,
getSettings: () => ({
...store.getSettings(),
floatingTerminalEnabled: false
})
} as never)
expect(disabledRuntime.getStatus().floatingWorkspaceEnabled).toBe(false)
})
it('advertises browser screencast only when a renderer window is available', () => {
const runtime = createRuntime()
electronMocks.BrowserWindow.fromId.mockReturnValue({ isDestroyed: () => false } as never)
+2
View File
@@ -881,6 +881,7 @@ type RuntimeStore = {
agentDefaultArgs?: GlobalSettings['agentDefaultArgs']
agentDefaultEnv?: GlobalSettings['agentDefaultEnv']
terminalWindowsShell?: GlobalSettings['terminalWindowsShell']
floatingTerminalEnabled?: GlobalSettings['floatingTerminalEnabled']
agentStatusHooksEnabled?: GlobalSettings['agentStatusHooksEnabled']
defaultTaskSource?: GlobalSettings['defaultTaskSource']
defaultTaskViewPreset?: GlobalSettings['defaultTaskViewPreset']
@@ -3134,6 +3135,7 @@ export class OrcaRuntimeService {
capabilities,
hostPlatform: process.platform,
terminalWindowsShell: this.store?.getSettings?.().terminalWindowsShell ?? null,
floatingWorkspaceEnabled: this.store?.getSettings?.().floatingTerminalEnabled !== false,
protocolVersion: RUNTIME_PROTOCOL_VERSION,
minCompatibleMobileVersion: MIN_COMPATIBLE_RUNTIME_CLIENT_VERSION
}
+3
View File
@@ -77,6 +77,9 @@ export type RuntimeStatus = {
// Why: legacy or saved WebSocket pairings may not carry scope metadata, so
// the server stamps the authenticated token scope here for status.get only.
deviceScope?: DeviceScope
// Why: mobile gates its Floating Workspace entry on this; absent on older
// hosts, false when the user disabled the feature in desktop settings.
floatingWorkspaceEnabled?: boolean
// COMPAT(runtimeStatusMobileAliases): added 2026-05-15 for mobile builds
// that still read these names; new desktop/CLI code uses the fields above.
protocolVersion?: number