refactor: debounced preview render goes through renderTabPreviewFromRaw#218
Open
PathGao wants to merge 1 commit into
Open
refactor: debounced preview render goes through renderTabPreviewFromRaw#218PathGao wants to merge 1 commit into
PathGao wants to merge 1 commit into
Conversation
The debounce path hand-copied the render/write-back/marker/refresh sequence that renderTabPreviewFromRaw already encapsulates. One shared path means future pipeline changes reach every render site at once. No behavior change. Co-Authored-By: Claude Fable 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.
What
Replaces the hand-written render/write-back/marker/refresh sequence in the editor debounce path with a call to
renderTabPreviewFromRaw, which already encapsulates exactly those steps (added in #194). Net: −7/+1 lines, no behavior change.Why
The debounce block was a byte-for-byte duplicate of the helper's body. Duplicated recipes drift: when the preview pipeline changes (as it did in #194, when front-matter stripping moved into
renderMarkdownPreview), every hand-copy is a spot the refactor can miss. Keeping a single shared path means future pipeline changes reach every render site at once.The other direct
renderMarkdownPreviewcall sites (initial load, chunked full-content load, untitled-tab toggle, startup restore) were left as-is — each differs from the helper on purpose (conditional rich-content refresh, loading-state handling, empty path for untitled buffers).Verification
npm run check: 0 errors, 0 warningsnode --testover all script tests: 56/56 pass🤖 Generated with Claude Code