You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(editor): isolate restored PDF and media reading positions - #34941
Restored PDF tabs use the file path as their scroll-cache key, so two workspace owners of the same path inherit each other's reading position. The same default key also backs media playback progress. Explicit split-tab IDs already isolate newly created tabs; the bug is reachable through supported saved-session tabs whose view ID equals the file ID.
Use the existing file-view preference key for the default PDF/media position scope. It includes workspace, runtime environment, external SSH target, and path, so closing a raw-path tab and later reusing its ID in another workspace also stays separate. Keep explicit split-pane scopes unchanged. Position caches retain their existing bounds; no schema or transport changes are introduced.
Actual Linux Electron reproduction uses a local Git worktree and a local folder workspace reading the same on-disk PDF. Tabs are restored through the public session hydration actions, and each viewer is unmounted by selecting another text tab before returning:
Step
Before
After
Original worktree, page 2
1166 px
1166 px
Folder workspace, first open
1166 px (inherits page 2)
0 px (page 1)
Folder workspace, after page 3 scroll
2232 px
2232 px
Return to original worktree
2232 px (overwritten)
1166 px
Return to folder workspace
2232 px
2232 px
Before, folder workspace incorrectly opens on page 2:
After, folder workspace starts on page 1:
Validation:
Original actual-component regression: six failing ownership cases, two passing split controls. Final suite adds two cases for a legacy raw-path ID reused by a later workspace.
All 64 focused tests pass across the final ownership suite, PDF position controls, and viewer reload/recovery suite.
Three successful fixed fresh-app runs preserve the measured offsets. One additional initial attempt was interrupted when renderer/network processes exited; the fresh retry passed. The final version of the rendered test also passes after replacing fixed sleeps with render-frame progression.
A normal newly created-tab control passes on the original code, confirming the scope is restored/default view IDs.
The exact final commit passes all 22 changed-file checks (ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2, 717.8 s), including formatting, lint, typecheck, affected tests, and ratchets.
Apps remained hidden on an isolated display. This measures PDF behavior on Linux with local disk reads; media ownership and paired-runtime/workspace key cases are component-tested. Live SSH, macOS, Windows, mobile, and codec playback were not executed.
Closing after an adversarial review pass (correctness + value lenses, judged per cluster).
Folded into #34816. The bug is real but narrow: the default-pane PDF/media position key is ${filePath}:pdf when the tab id equals the file id, so same-path owners share it. The fix belongs next to #34816's matching one-line editorViewStateKey change, with one owner-scoping scheme (activeFile.id, as the diff and preview keys already use) rather than a second scheme based on preference keys. The PR also adds 351 lines of tests (a 225-line e2e spec and a 126-line component test that string-matches the lazy factory) for a two-line change. Closing comment: "Thanks. Folding the one-line pdfViewStateKey fix into #34816 so every default-pane view-state key in EditorContent uses the same owner-scoped id scheme. The e2e spec and the large component test are not being carried over."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restored PDF tabs use the file path as their scroll-cache key, so two workspace owners of the same path inherit each other's reading position. The same default key also backs media playback progress. Explicit split-tab IDs already isolate newly created tabs; the bug is reachable through supported saved-session tabs whose view ID equals the file ID.
Use the existing file-view preference key for the default PDF/media position scope. It includes workspace, runtime environment, external SSH target, and path, so closing a raw-path tab and later reusing its ID in another workspace also stays separate. Keep explicit split-pane scopes unchanged. Position caches retain their existing bounds; no schema or transport changes are introduced.
Actual Linux Electron reproduction uses a local Git worktree and a local folder workspace reading the same on-disk PDF. Tabs are restored through the public session hydration actions, and each viewer is unmounted by selecting another text tab before returning:
Before, folder workspace incorrectly opens on page 2:
After, folder workspace starts on page 1:
Validation:
ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2, 717.8 s), including formatting, lint, typecheck, affected tests, and ratchets.Apps remained hidden on an isolated display. This measures PDF behavior on Linux with local disk reads; media ownership and paired-runtime/workspace key cases are component-tested. Live SSH, macOS, Windows, mobile, and codec playback were not executed.