Repository navigation
fix(editor): isolate restored reading positions by file owner - #34816
Conversation
8c2e55b to
2eed67e
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
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. Comment |
[Medium impact] The PR appears safe to merge. SummaryThe PR separates restored reading positions for files that share a path but have different owners.
No actionable issues were found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "fix(editor): scope default-pane reading ..." · Reviewed by Greptile |
Same-path files with different owners (runtime hosts or worktrees) shared Monaco, rich-markdown, notebook, and PDF/media reading positions when the tab id equals the file id. Key them by file id, matching the diff and markdown preview keys.
2eed67e to
93b3e6b
Compare
Problem
EditorContentkeyed default-pane reading positions byfilePathwhen the view-state scope equals the file id. Two open files with the same absolute path but different owners (different runtime hosts, or different worktrees using ownededitor:<wt>:<runtime>:<path>ids) therefore shared one entry for Monaco cursor/scroll, the derived rich-markdown and notebook scroll keys, and PDF/media scroll/playback position. Switching between them restored the other owner's position.This branch is only taken when the tab id equals the file id: legacy/restored tabs without an
entityId(hydration falls back totab.id) and the legacy no-layout editor surface. Normally created tabs have UUID ids and already use the per-tab${filePath}::${tabId}key.Fix
Key the default-pane editor and PDF/media view state by
activeFile.id, matching the diff and markdown-preview keys that already do. Local files haveid === filePath, so their keys are unchanged. These caches are in-memory only, so there is no migration or mixed-version concern. Folds in the PDF/media key change from #34941.Test
EditorContent.monaco-lifecycle.test.tsx: two owners of the same path get different view-state keys (fails on main).pnpm check:changed --maxWorkers=2passes.