Improve rendering pipeline to be much more selective when to render#1
Merged
Improve rendering pipeline to be much more selective when to render#1
Conversation
Owner
schemen
commented
Jan 1, 2026
- Widget reuse: Added MetadataWidget.eq() so CodeMirror reuses DOM when values/styles don’t change, avoiding re‑render per keystroke (editor-metadata.ts).
- Selection behavior: Only reveal raw syntax when the cursor is inside a marker, not for selection ranges; reduces rebuilds during selection (editor-metadata.ts).
- Fast‑path for plain values: Skip MarkdownRenderer when the value has no markdown hints; just set textContent (markdown-render.ts).
- Range scanning skip: Avoid regex scanning a range if it doesn’t contain the opener ({{ / [%) (editor-metadata.ts).
- Rebuild gating: On edits, map decorations and rebuild only if the change touches a marker or frontmatter, or if the cursor enters/leaves a marker (editor-metadata.ts).
- Per‑line marker cache: Cache marker positions per line and only re‑scan changed lines instead of full visible ranges (editor-metadata.ts).
- Frontmatter lookup caching: Added a lazy resolver with per‑key memoization and case‑insensitive key‑map caching; no cache is created unless a marker is actually resolved (metadata-utils.ts, editor-metadata.ts, metadata-renderer.ts).
- Empty‑value click fix: Empty widgets now pass events through + have a tiny hit‑box, preventing cursor misplacement without extra rendering (editor-metadata.ts, styles.css).
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.