Skip to content

Workspaces 9/10: dor workspace move, dor list --window, iframe move gate - #622

Draft
nedtwigg wants to merge 25 commits into
workspaces-fidelityfrom
workspaces-move-verb
Draft

Workspaces 9/10: dor workspace move, dor list --window, iframe move gate#622
nedtwigg wants to merge 25 commits into
workspaces-fidelityfrom
workspaces-move-verb

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

dor workspace move <ref> --window <label|new> --index <n> through a platform hook; dor list --window <label>. A move between windows that would destroy a plain iframe's page state asks with the kill's typed letter on drag, and the CLI refuses unless --dangerously-destroy-iframe-page-state is passed.

Based on workspaces-fidelity.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PkPyEFCxiPo5UFeju5Ya9u

`dor workspace move <ref> --window <label|new> --index <n>` runs the same
transfer the strip's drag does, through a platform hook the Tauri adapter
fills; `--index` alone reorders, and a host with one window reorders only.
`dor list --window <label>` lists a sibling window, routed there by Rust.

A move between windows cannot carry a plain iframe's document: it reopens at
its saved URL. The Wall handle now names its iframe Surfaces, Doored ones
included; the drag release raises the kill's typed-letter confirmation when
there are any, and the CLI refuses unless
--dangerously-destroy-iframe-page-state is passed, naming them. Agent-browser
Surfaces reconnect and are not gated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkPyEFCxiPo5UFeju5Ya9u
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7c2100d
Status: ✅  Deploy successful!
Preview URL: https://5e2ba13a.mouseterm.pages.dev
Branch Preview URL: https://workspaces-move-verb.mouseterm.pages.dev

View logs

@nedtwigg
nedtwigg added this pull request to stack #624 September 10, 2026 21:44

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback on work in progress — not a merge verdict. Mark it ready when you want the full review.

The new CLI surface has no dor-side test. dor/test/cli-output.test.mjs pins the exact request every other Workspace verb sends (newWorkspace, renameWorkspace, switchWorkspace, closeWorkspace with force: true) and snapshots the --force-on-the-wrong-action refusal, but fixtureClient has no moveWorkspace and nothing exercises move or list --window. So nothing pins that --window becomes toWindow and --index becomes index, nor the four new misuse errors. That mapping is where the first inline comment's bug lives: a test asserting the request shape for move build --window ws-2 --index 0 is what would have caught the dropped index.

Comment thread lib/src/components/wall/workspace-control.ts
Comment thread lib/src/components/WorkspaceStrip.tsx Outdated
Comment thread dor/src/commands/workspace.ts Outdated
Comment thread standalone/src/workspace-move.ts Outdated
nedtwigg and others added 2 commits September 10, 2026 17:38
`dor workspace move` reported `moved` the moment Rust took the invoke,
but the target can still close mid-transfer or the watchdog can hand the
Workspace back, so a script chaining `dor list --window` behind it read a
move that never happened. `transferWorkspaceTo` / `tearOutWorkspace` now
resolve only when `workspace-departed` (adopted) or
`workspace-arrival-failed` (handed back, with Rust's reason) arrives for
that Workspace, from a per-Workspace deferred settled by `handleDeparted`
and `handleArrivalFailed`; a refused invoke settles at once. The Tauri
adapter rejects with the reason, so the CLI prints `was not moved: ...`.
A window emptied by the move now issues `close_window` on a later task,
so the answer leaves the webview before Rust destroys it. The drag
callers keep ignoring the outcome.

`--index` was dropped on a move between windows: the cross-window branch
answered before the reorder and the payload carried no slot. The payload
now has an optional `index`, which the target reads ahead of the
pointer-derived slot; it is threaded through `PlatformAdapter.
transferWorkspace(workspaceId, toWindow, { index })`. A tear-out has one
tab, so the adapter does not forward it there.

The strip's move gate now waits behind a close confirmation (the two key
handlers are siblings on one node, so with both pending the close's
letter could also move the Workspace), and ignores a bare Shift or Meta
the way the pane kill confirmation does.

`--index` parses through a shared `parseNonNegativeInt` beside
`parsePositiveInt`, so its failure reads like every other flag's
(`invalid --index 'x'`). `dor list --workspaces --window <label>` was
refused by the overview's flag allowlist despite its usage line; the
allowlist now admits `--window`.

dor tests pin the `move` request shape, the four flag-misuse errors, the
invalid index, and `list --window`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RChsJ5rMUMyfu22UZDfUus
Carries the review fixes from the earlier stages up the stack. The
hand-off arms its mark wait before the invoke and settles the move on
adoption or hand-back, replaying a hand-back's since-mark tail into the
source; the move tests install an id pool now that refs are stable only
under one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RChsJ5rMUMyfu22UZDfUus

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback on work in progress — not a merge verdict. Mark it ready when you want the full review.

Making moved mean "the target adopted it" puts dor's 30 s socket deadline in a fixed order against routing::ARRIVAL_MAX (20 s, in standalone/src-tauri/src/routing.rs), and nothing on either side says so. Raise the watchdog past 30 s — its own doc comment frames it purely against the target's 3 s collection and a torn-out window's boot, so there is nothing there to stop you — and every hand-back this commit exists to report arrives after the client has already given up: dor workspace move prints timed out waiting for workspace.move instead of the reason docs/specs/dor-cli.md now promises, and the caller is back to not knowing where the Workspace is. The inline suggestion names the ordering at the dor end; the Rust constant is where an editor raising it would actually be looking, so it wants the same line.

Comment thread dor/src/control-client.ts
Comment on lines +180 to +181
// A move between windows serializes every terminal and waits for the target
// to adopt the Workspace, so it too can outlast the ordinary deadline.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// A move between windows serializes every terminal and waits for the target
// to adopt the Workspace, so it too can outlast the ordinary deadline.
// A move between windows serializes every terminal and waits for the target
// to adopt the Workspace, so it too can outlast the ordinary deadline — and
// must outlast `routing::ARRIVAL_MAX` too, the watchdog that hands an
// unadopted arrival back: under it, a hand-back reaches the CLI as a
// transport timeout rather than the reason it is supposed to print.

# Conflicts:
#	standalone/src/workspace-move.ts
# Conflicts:
#	standalone/src/workspace-move.ts
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.

2 participants