refactor: extract document loading session - #274
Merged
alecdotdev merged 1 commit intoJul 30, 2026
Conversation
Collaborator
Author
|
@alecdotdev This is the first document-session PR, dependent on #273. It moves loading and the deferred large-file completion guard without changing document mutation behavior; save, task, watcher, and close ownership will follow in smaller dependent PRs. |
PathGao
force-pushed
the
agent/extract-document-load-session
branch
from
July 30, 2026 04:00
110a3c2 to
f2b10b8
Compare
Collaborator
Author
|
@alecdotdev Rebased after #271 merged; its direct parent is the updated #273 branch. |
PathGao
force-pushed
the
agent/extract-document-load-session
branch
from
July 30, 2026 04:54
f2b10b8 to
024e831
Compare
PathGao
force-pushed
the
agent/extract-document-load-session
branch
from
July 30, 2026 05:04
024e831 to
80118b6
Compare
PathGao
pushed a commit
that referenced
this pull request
Aug 3, 2026
`MarkdownViewer.svelte` declares six top-level bindings that the file never mentions again. They read as live state — a container element, a render debounce and its timer handle, a per-tab load revision map, a caret element and its measured offset — so anyone tracing how rendering or scroll sync works has to prove each one is inert before ruling it out. Five were never used at all. `containerEl`, `renderTimeout` and `renderDebounceMs` arrive in b46a283 and `caretEl`/`caretAbsoluteTop` in ef219cf, each already at exactly one occurrence in the commit that adds them: the declaration, and nothing else. `renderDebounceMs = 50` in particular suggests a debounce that does not exist. One is refactor residue. `loadRevisionByTab` had four occurrences when 41de13b (#247) added it here. bb8dbf3 (#274) moved document loading into `documentSession.svelte.ts`, which carries its own map and the three call sites; the declaration here stayed behind. Two identically named maps in two files, one of them dead, is worse than either alone — `scripts/largeFileLoadRevision.test.ts` pins the live one in `documentSession.svelte.ts` and is unaffected. Nothing else changes. `npm run check` and `npm run build` were the check that matters: an unreferenced binding is only safe to remove if the compiler agrees nothing reaches it, including through Svelte's `bind:this`, which is why this is verified by a build rather than by grep alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PathGao
pushed a commit
that referenced
this pull request
Aug 3, 2026
`MarkdownViewer.svelte` declares six top-level bindings that the file never mentions again. They read as live state — a container element, a render debounce and its timer handle, a per-tab load revision map, a caret element and its measured offset — so anyone tracing how rendering or scroll sync works has to prove each one is inert before ruling it out. Five were never used at all. `containerEl`, `renderTimeout` and `renderDebounceMs` arrive in b46a283 and `caretEl`/`caretAbsoluteTop` in ef219cf, each already at exactly one occurrence in the commit that adds them: the declaration, and nothing else. `renderDebounceMs = 50` in particular suggests a debounce that does not exist. One is refactor residue. `loadRevisionByTab` had four occurrences when 41de13b (#247) added it here. bb8dbf3 (#274) moved document loading into `documentSession.svelte.ts`, which carries its own map and the three call sites; the declaration here stayed behind. Two identically named maps in two files, one of them dead, is worse than either alone — `scripts/largeFileLoadRevision.test.ts` pins the live one in `documentSession.svelte.ts` and is unaffected. Nothing else changes. `npm run check` and `npm run build` were the check that matters: an unreferenced binding is only safe to remove if the compiler agrees nothing reaches it, including through Svelte's `bind:this`, which is why this is verified by a build rather than by grep alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PathGao
added a commit
that referenced
this pull request
Aug 3, 2026
`MarkdownViewer.svelte` declares six top-level bindings that the file never mentions again. They read as live state — a container element, a render debounce and its timer handle, a per-tab load revision map, a caret element and its measured offset — so anyone tracing how rendering or scroll sync works has to prove each one is inert before ruling it out. Five were never used at all. `containerEl`, `renderTimeout` and `renderDebounceMs` arrive in b46a283 and `caretEl`/`caretAbsoluteTop` in ef219cf, each already at exactly one occurrence in the commit that adds them: the declaration, and nothing else. `renderDebounceMs = 50` in particular suggests a debounce that does not exist. One is refactor residue. `loadRevisionByTab` had four occurrences when 41de13b (#247) added it here. bb8dbf3 (#274) moved document loading into `documentSession.svelte.ts`, which carries its own map and the three call sites; the declaration here stayed behind. Two identically named maps in two files, one of them dead, is worse than either alone — `scripts/largeFileLoadRevision.test.ts` pins the live one in `documentSession.svelte.ts` and is unaffected. Nothing else changes. `npm run check` and `npm run build` were the check that matters: an unreferenced binding is only safe to remove if the compiler agrees nothing reaches it, including through Svelte's `bind:this`, which is why this is verified by a build rather than by grep alone. Co-authored-by: PathGao <gaoyanbo@gaoyanbodeMacBook-Air.local> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Depends on #273 (and #272/#271). Merge after #273. This starts the document-session extraction; save, task mutation, watcher, and close flows remain separate follow-up steps.
Validation