Repository navigation
Conversation
…the last build meanwhile Each runtime preview build POSTs the whole site document and the server re-validates it, re-bundles the page scripts and renders the page. The Preview overlay and the Site Explorer hover card rebuilt on every `site` change, so typing or a collaborator's edits aborted the in-flight build and started another — production logs show bursts of 8 cancelled requests within two seconds — and the preview blanked to "Building…" each time. - useRuntimePreviewDocument builds from the draft only once it has stayed unchanged for 400ms (PREVIEW_SITE_SETTLE_MS). - While a newer build runs, `html` keeps the previous build for the same page and context; both callers show the loading state only when there is nothing to show yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ngocht
marked this pull request as ready for review
October 14, 2026 18:12
This branch has not been deployed
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
Each runtime preview build POSTs the whole site document to
/admin/api/cms/runtime/preview, and the server re-validates it, re-bundles the page scripts and renders the page. The Preview overlay and the Site Explorer hover card rebuilt on everysitechange. Typing, or a collaborator's edits arriving over collab, aborted the in-flight build and started another. Production nginx logs show bursts of 8 cancelled (499) requests within two seconds, 41 cancelled vs 88 completed in one day. The preview also blanked to "Building…" on each change.Changes:
useRuntimePreviewDocumentbuilds from the draft only once it has stayed unchanged for 400ms (PREVIEW_SITE_SETTLE_MS).htmlkeeps the previous build for the same page and template context.PreviewOverlayandSiteExplorerHoverPreviewshow their loading state only when there is nothing to show yet.Impact: far fewer full-site uploads and server builds while editing; previews update in place instead of flashing.
Verification
bun run build— rantsc -p tsconfig.app.json(clean)bun test— ranbun test src/__tests__/publisher/previewOverlay.test.tsx src/__tests__/panels: 450 pass. NewruntimePreviewSettle.test.tsx: five edits inside the settle window cause one rebuild and the previous build stays visible; fails onmain.bun run lint— eslint on the changed files (clean)Checklist
🤖 Generated with Claude Code