Skip to content

A layout update names each open file the same way in every build (dark, layout-owner build only) - #31140

Merged
Jinwoo-H merged 1 commit into
mainfrom
e2-6/e1-record-keys-build-independent
Oct 20, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
e2-6/e1-record-keys-build-independent

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2

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

  • Before: in a switch-on run, opening a file from the command line could make the layout checker fail with "a record is missing from its order". The window itself was fine, because it is built with the switch on and named files the same way main does.
  • After: a file record's name in an update is always its path plus its owner (the same name a switch-on build already used), whatever the reader's build. Two machines' files at the same path are kept apart, so opening one sends only that record.
  • Mechanism: the editor-file key in workspace-layout-records.ts no longer calls editorFileKey(), which depends on the build switch. It uses ownedEditorFileId(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

  • I manually tested these changes locally: the switch-on layout oracle: host-navigation end-to-end test (hidden window) failed with the CI error before and passes after.
  • Automated tests added/updated: two tests in 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.ts returns 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…a reader built without the switch applies a layout-owner host's order (dark, layout-owner build only)
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bcadfb27-08e4-4b72-b5aa-e39ff38aaab2
📥 Commits

Reviewing files that changed from the base of the PR and between bfc436b and 2fb6c48.

📒 Files selected for processing: 3
  • src/shared/workspace-layout/workspace-layout-editor-tab-file.ts
  • src/shared/workspace-layout/workspace-layout-records.test.ts
  • src/shared/workspace-layout/workspace-layout-records.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

📝 Walkthrough

Editor-file record keys now use ownedEditorFileId with the file path, an empty owner value, and the runtime environment ID. Tests cover ordered record application and files with the same path but different runtime environments. Documentation clarifies the scope of editorFileKey.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 2fb6c

The change appears ready to merge after normal checks. No unresolved issue was identified with applying editor-file updates across build configurations.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: consistent editor-file naming across builds in the layout-owner flow.
Description check Passed The description is complete and focused. It explains the problem, user-visible behavior, implementation, rationale, testing, visual-proof status, compatibility considerations, and checklist status.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jinwoo-H
Jinwoo-H merged commit ea16d1b into main Oct 20, 2026
42 checks passed
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.

1 participant