Exclude editor bottom padding from split scroll sync - #316
Merged
PathGao merged 3 commits intoAug 2, 2026
Merged
Conversation
Collaborator
Author
|
@alecdotdev This is the follow-up for the remaining end-of-document drift reported in #205. It keeps Monaco’s normal bottom-padding preference but removes that padding from the sync calculation. It is stacked after #314 and the predecessors; please review in order. |
This was referenced Jul 31, 2026
PathGao
force-pushed
the
fix/exclude-editor-bottom-padding-from-scroll-sync
branch
from
August 2, 2026 03:57
d15b4fa to
7a11594
Compare
PathGao
force-pushed
the
fix/exclude-editor-bottom-padding-from-scroll-sync
branch
from
August 2, 2026 04:11
7a11594 to
6b0d3b9
Compare
PathGao
added a commit
that referenced
this pull request
Aug 2, 2026
Four already-fixed behaviours each left a copy behind, and every copy looks like a reusable shared implementation: - `markdown.ts::renderRichContent` (141 lines, exported, zero importers) lacks `rememberDiagramSource`, so anything that "switched to the shared version" would silently disable the light-theme Mermaid re-render that PDF and HTML export depend on. It also hand-rolls the theme choice instead of `resolveMermaidTheme` and carries an inline DOMPurify config instead of the shared contract. - `markdown.ts::getLanguage` and `::highlightColorMap` duplicate the live copies in the viewer. - `Editor.svelte::getEditorScrollMax` is the pre-#316 version, using `getScrollHeight()` where the live one uses `getContentHeight()`. They were invisible because the tests guarding those behaviours each read one hard-coded path. `scripts/singleImplementationConvention.test.ts` generalises the allowlist idea to the whole `src` tree: one row per fixed behaviour, scanned everywhere, plus a meta-test asserting every rule still matches something so a rename cannot turn a rule into a no-op. Also fixes a `$effect` cleanup in Toc.svelte that removed its listener from the current value of a prop rather than the node it attached to. Co-authored-by: PathGao <gaoyanbo@gaoyanbodeMacBook-Air.local> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 3, 2026
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.
Fixes #315
Monaco keeps blank space below the final line because
scrollBeyondLastLineis enabled. The previous synchronization range used scroll height, so that non-content space made the editor’s final document line map to a preview position above its end.Uses Monaco content height for both directions of split-scroll synchronization while retaining the editor’s scroll-beyond-last-line preference and front-matter segmentation.
Adds a regression assertion that synchronization does not use the padded scroll range.
This is stacked after #314 and its predecessors. Merge the predecessor chain first.
Validated with
npm run check(0 errors, 0 warnings),npm test(136 passing),npm run build, andcargo test(21 passing).