Repository navigation
A layout update names each open file the same way in every build (dark, layout-owner build only) - #31140
Conversation
…a reader built without the switch applies a layout-owner host's order (dark, layout-owner build only)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
In the layout-owner build, main sends small updates that list records by a name. For open files, the name depended on how the reader was built. So a reader built without the switch, such as the layout checker in the end-to-end tests, could not apply the update once a file was opened. Now every reader uses the same name: the file's path plus which machine owns it.
What Changed
workspace-layout-records.tsno longer callseditorFileKey(), which depends on the build switch. It usesownedEditorFileId(path, '', owner)directly.editorFileKey()still keys files inside one process, and its comment now says so.Why
An update names its records by keys the sender computes, so the key has to come from the record alone, not from the reader's build. Changing the checker instead would fix only that one reader and leave any later reader built without the switch (command line, web) broken the same way.
Linked Issue
N/A (follow-up to #31109; found by the switch-on layout oracle run on main).
Visual Proof
N/A: no visible change. Only switch-on builds send these updates, and the window already used this key.
Testing
layout oracle: host-navigationend-to-end test (hidden window) failed with the CI error before and passes after.workspace-layout-records.test.ts. One checks that a reader built without the switch applies a switch-on host's editor-file update; the other checks that two machines' files at one path are kept apart. Both fail before this change and pass after.Switch-off build: unaffected. Records updates are built and sent only with the switch on (
workspace-layout-stream.tsreturns before any diffing when it is off).Review
One independent review found no defects. Its one note, a stale comment on
editorFileKey, is fixed.Agent skill upstream boundary
Notes
Remote and paired machines: the key now includes the file's owner in every build, which is what a paired reader needs. No message shape changes.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)