Repository navigation
A layout-owner server tells a paired desktop it takes layout changes (dark, layout-owner build only) - #31131
Conversation
…paired desktop's layout intents (dark) status.get adds layout.intents.v1 only in an ORCA_LAYOUT_OWNER=main build. It versions the layout.subscribe frame shape and the layout.apply contract a paired desktop will rely on. Tests pin the layout methods open to a paired desktop and closed to phones, and that an older desktop still reaches every session.tabs mutation on such a server. Co-Authored-By: Claude <[email protected]>
…r without casts Co-Authored-By: Claude <[email protected]>
…s pin each next check Co-Authored-By: Claude <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
When a desktop is paired to an Orca server, the desktop needs a way to ask "does this server's own background process decide tab and pane layout?" before it starts sending layout changes there. This PR makes such a server say "yes" when asked, and only in the internal test build where that new layout model is turned on. Nothing changes in any build we ship.
What Changed
ORCA_LAYOUT_OWNER=main, the server's status reply listslayout.intents.v1. Shipped builds never list it, and they behave exactly as before.Mechanism:
src/shared/workspace-layout/layout-intents-capability.ts, defines the name and the contract it versions:orca-runtime-get-status.tsadds the capabilities that build switches turn on, from a new file,dark-switch-runtime-capabilities.ts. The existing unread-flag capability moved there unchanged. The status file was at its line limit, and this keeps the switch points together.Paired desktops could already reach the layout methods: their pairing grants the permission those methods declare, and the methods are not on the phone allow list. No access rule changed.
Design note for the follow-up PRs (not in this one): which group a client is showing is that client's own fact, never shared layout. The server will keep it per connection. It will open a file from the CLI or phone in the group of the most recently active client, else in the saved view. Today the server keeps one value, reported by its own window. The desktop's report of this fact joins the same contract before the switch is flipped.
Why
Linked Issue
Part of the terminal-layout final design (paired desktop to a server). No separate issue.
Visual Proof
N/A: no interface or behaviour change. The capability exists only in a build made with the layout-owner switch on, and no client reads it yet.
Testing
New
src/main/runtime/rpc/methods/workspace-layout-paired-desktop.test.ts. It was written first, and the capability test failed before the change. It checks that:layout.subscribe,layout.unsubscribeandlayout.applyadmit a paired desktop and refuse a phone; a paired desktop can subscribe, receive a snapshot, unsubscribe, and get the end frame;Ran the status, scope, allow-list and layout-method suites with the switch on and off: 31 files pass both ways.
Ran the pre-push gate: changed-code quality,
pnpm tc, type-aware oxlint, layout-writer ratchets, the paired-server guard and unit routing tests.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)