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)